Repository navigation
fix: escape dotted field names in Vega chart specs so dimension comparison charts render - #10086
Merged
Merged
Conversation
…comparison charts render
AdityaHegde
approved these changes
Nov 2, 2026
8 tasks
…e in chart specs Follow-up to the dimension comparison fix: audit every spec builder for raw field names handed to Vega as field references and escape them. - builder.ts: buildHoverRuleLayer takes the raw x field, escapes it for the encoding and looks up custom sort values by the raw name, so a custom x sort is no longer lost for dotted dimensions. - stacked-bar/normalized.ts: joinaggregate groupby and field are escaped. - funnel/spec.ts: window field and sort, multi-measure fold, color, value label and stage tooltip encodings are escaped. - multi-metric-chart.ts, comparison-builder.ts: fold inputs are escaped while fold.as keeps the raw name, which is what Vega emits as the key. - heatmap/spec.ts, circular/pie.ts: data label text encodings are escaped. - test-fixtures.ts: vegaFieldReferences helper collects every field reference in a spec; new tests assert dotted names only reach Vega escaped for the normalized bar, grouped bar sort lookup, multi-measure fold, comparison fold, funnel, heatmap and pie specs.
createVegaTransformPivotConfig so dimension comparison charts renderbuildHoverRuleLayer escapes the x field itself, but the area and combo builders still passed a pre-escaped name, so any x field with punctuation was escaped twice and the hover rule referenced a field that does not exist. Both now pass config.x?.field. The combo fold inputs are escaped as well, matching the multi-measure and comparison builders. Adds regression tests for the area and combo hover x field and sort, and for the combo fold, filter and color domain.
nishantmonu51
added a commit
that referenced
this pull request
Nov 2, 2026
…rison charts render (#10086) * fix: escape dotted dimension names in Vega chart pivots so dimension comparison charts render * fix: escape dotted field names at every remaining Vega field reference in chart specs Follow-up to the dimension comparison fix: audit every spec builder for raw field names handed to Vega as field references and escape them. - builder.ts: buildHoverRuleLayer takes the raw x field, escapes it for the encoding and looks up custom sort values by the raw name, so a custom x sort is no longer lost for dotted dimensions. - stacked-bar/normalized.ts: joinaggregate groupby and field are escaped. - funnel/spec.ts: window field and sort, multi-measure fold, color, value label and stage tooltip encodings are escaped. - multi-metric-chart.ts, comparison-builder.ts: fold inputs are escaped while fold.as keeps the raw name, which is what Vega emits as the key. - heatmap/spec.ts, circular/pie.ts: data label text encodings are escaped. - test-fixtures.ts: vegaFieldReferences helper collects every field reference in a spec; new tests assert dotted names only reach Vega escaped for the normalized bar, grouped bar sort lookup, multi-measure fold, comparison fold, funnel, heatmap and pie specs. * fix: pass raw x fields to the hover layer from the area and combo charts buildHoverRuleLayer escapes the x field itself, but the area and combo builders still passed a pre-escaped name, so any x field with punctuation was escaped twice and the hover rule referenced a field that does not exist. Both now pass config.x?.field. The combo fold inputs are escaped as well, matching the multi-measure and comparison builders. Adds regression tests for the area and combo hover x field and sort, and for the combo fold, filter and color domain. (cherry picked from commit f894b32)
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.
Dimension comparison on the explore page renders the shared Vega stacked bar, and nested Druid columns surface as dimensions whose names contain dots (for example
query.context.metaData.type). The hover layer'spivottransform received that name unescaped, so Vega read it as a nested field path, threw inside the dataflow, and every time series chart rendered blank.createVegaTransformPivotConfig(used by the stacked, normalized, grouped bar and line charts), in the area chart's inline pivot, and in the grouped barxOffsetencoding.joinaggregate, the funnelwindow,fold, color and label encodings, the multi-measure, comparison and combofoldinputs, and the heatmap and pie label text.fold.askeeps the raw name because Vega emits the raw name as the fold key.vegaFieldReferenceshelper that collects each field reference in a spec, plus a headless Vega render test that fails on the unescaped name.Steps to reproduce:
Closes APP-957
Checklist: