feat: add 'Go to Explore' for combo charts and custom charts#9331
Open
TheRillJon wants to merge 4 commits intomainfrom
Open
feat: add 'Go to Explore' for combo charts and custom charts#9331TheRillJon wants to merge 4 commits intomainfrom
TheRillJon wants to merge 4 commits intomainfrom
Conversation
…-existing bugs
Add "Go to Explore" support for combo_chart and custom_chart canvas components,
and fix three bugs (two pre-existing) that prevented correct navigation to the
Explore pivot page.
Files changed:
- Toolbar.svelte: Add "combo_chart" and "custom_chart" to EXPLORE_SUPPORTED_TYPES
- BaseCanvasComponent.ts: Fix pre-existing bug — add `selectedTimeRange` to
`timeRangeState` for both global and local time intervals, so "Go to Explore"
includes the time range in the URL for ALL canvas chart types
- ComboChart.ts: Add override `getExploreTransformerProperties()` that explicitly
maps x, y1, y2 to pivot chips (skipping synthetic color field)
- custom-chart/index.ts: Add `QueryFieldMeta` interface, `queryFieldsMeta`
writable store, and `getExploreTransformerProperties()` using server-returned
meta.fields
- CanvasCustomChart.svelte: Add `handleMetaChange` callback to pipe meta.fields
from the renderer into the component store
- CustomChartRenderer.svelte: Add `onMetaChange` prop and reactive statement to
emit meta.fields from the first query
- convertURLToExplorePreset.ts: Fix pre-existing empty-string split bug in
`fromPivotUrlParams()` for both PivotRows and PivotColumns
Bugs fixed:
1. Missing time range (pre-existing, all chart types): BaseCanvasComponent never
populated `selectedTimeRange` in the `timeRangeState`, so the explore URL
never included a `tr=` param
2. Synthetic color field (combo-specific): BaseChart.getExploreTransformerProperties()
processed the combo chart's synthetic color: {type:"value", field:"measures"}
as a real dimension
3. Empty string split (pre-existing): "".split(",") returns [""] not [], causing
crashes when PivotRows or PivotColumns are empty
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Use the canvas dashboard's rill-time expression (e.g. "24h as of latest/h+1h") as the time range name instead of always using CUSTOM with absolute dates. Falls back to CUSTOM only when no named range is available (e.g. a custom date picker selection or a local chart filter with a custom range). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…t TDD - Block TDD when y.fields has multiple measures (multi-metric charts) - Block TDD when both x is nominal and color is a dimension (multiple dims) - Skip synthetic type:"value" fields (e.g. rill_measures color encoding) in transformChartSpecToPivotState so they don't appear as fake dimensions - Place all non-measure fields in rows initially; when rows contain dimension chips, move time chips from rows to columns Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ough - Combo charts now place x-axis fields in rows initially, matching the standard chart behavior: time chips stay in rows when no dimensions are present, and move to columns when dimension chips exist in rows. - Bar chart types (bar_chart, stacked_bar, stacked_bar_normalized) no longer force showTimeComparison to false, allowing the global comparison time range to pass through to the explore URL. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.
Add "Go to Explore" support for
combo_chartandcustom_chartcanvas components, and fix several pre-existing bugs in the explore link flow for all chart types.New features:
y1andy2measures as pivot columnsmeta.fieldsfrom the metrics SQL resolver to classify columns as dimensions or measuresBug fixes:
rowsorcolsparams —"".split(",")returns[""]not[], which produced invalid pivot chip entriesselectedTimeRangewas never populated inBaseCanvasComponent'stimeRangeState, so explore URLs had no time rangerill-P7D) fromrangeStoreinstead of always generatingCUSTOMtime rangescolor: {type: "value"}fields (used for multi-measure legends) when building pivot state, preventing gRPC UTF-8 marshaling errorsbar_chart,stacked_bar,stacked_bar_normalized) now pass through the global comparison time range to explore instead of suppressing itChecklist:
Developed in collaboration with Claude Code