feat: per-widget hide_comparison toggle for canvas components - #9913
Open
nishantmonu51 wants to merge 3 commits into
Open
nishantmonu51 wants to merge 3 commits into
nishantmonu51 wants to merge 3 commits into
Conversation
Adds a `hide_comparison: true` renderer property that turns delta/comparison off for a single canvas component regardless of the canvas-level comparison toggle or a local `time_filters` override. Exposed in the inspector Filters tab as a "Time comparison" switch next to "Local time range".
The tab now holds time range, comparison, and dimension filter overrides. Uses a new message key since `canvas_filters` also labels a filter input.
AdityaHegde
requested changes
Sep 22, 2026
Collaborator
There was a problem hiding this comment.
Adding a separate toggle makes this confusing. In the example I have toggled the new setting on and have comparison in top level filters, but have toggled off local comparison, leading to a mismatch. But if the new toggle is off comparison selector is not shown at all while the yaml still has it like time_filters: tr=7D+as+of+latest%2FD%2B1D&compare_tr=rill-PP So there is a mismatch in how things are interpreted.
Not a 100% sure what will make this consistent. Perhaps we can add inherit option to time and comparison selectors?
Comparison becomes its own axis on canvas components, independent of the local time range: absent inherits the canvas comparison, `none` turns it off, and any comparison range overrides it. The inspector shows one selector with Inherit / Off / ranges instead of a separate toggle, so the UI and YAML can no longer disagree. `compare_tr` inside `time_filters` is still read for existing projects but no longer written.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When comparison is enabled on a canvas it applies to every widget. This makes comparison its own per-widget axis so a component can turn it off, or compare against its own range, independently of the canvas toggle and of a local time range.
comparison_rangerenderer property on canvas data components (KPI grid, table/pivot, leaderboard, cartesian charts). Absent inherits the canvas comparison,noneturns it off, and a comparison range (rill-PW, a customstart,endpair, ...) overrides it. Comparison intervals are computed against the component's effective time range, local or canvas.compare_trinsidetime_filtersis still read (a local time range without it keeps meaning "no comparison", as today) but is no longer written. Enabling a local time range from the UI writescomparison_range: inheritso the widget keeps the comparison the user sees.BaseCanvasComponent.timeAndFilterStore, since every widget and the open-in-explore link readshowTimeComparisonfrom that derived store.updatePropertieswrites several spec keys in a single YAML update. No backend, proto, or schema change needed.en.jsonandes.json.web-local/tests/canvas/filters.spec.ts: a widget can turn comparison off and back to inherit while the canvas comparison stays on; the local time range test now picks its comparison from the new selector.Checklist: