Validate discrete chartProperties values; docs show accepted values not labels#52
Merged
Merged
Conversation
Copilot
AI
changed the title
[WIP] Fix Vega-Lite regression for invalid option values
Validate discrete chartProperties values; docs show accepted values not labels
Jul 11, 2026
Chenglong-MS
approved these changes
Jul 12, 2026
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.
Following the generated Vega-Lite reference docs for the Regression template rendered a blank chart: the docs' Domain column listed option labels (
Logarithmic) instead of accepted values (log), and the assembler copied the unrecognized value verbatim into the Vega-Literegressiontransform, which the renderer silently rejects.Changes
core/normalize-properties.ts(new) — validates discretechartPropertiesagainst the template's declaredoptionsbeforeinstantiate:infowarningwarning(preserves the "safe to pass" contract instead of emitting an invalid backend spec)scripts/gen-chart-reference.ts— discrete Domain/Default columns now render the acceptedvaluein code font with the label as secondary text (e.g.`log` (Logarithmic)); options with anundefinedvalue render asLabel _(default)_. Regenerateddocs/reference-*.md.tests/chart-properties-validation.test.tscovers valid value, label coercion, case-insensitivity, invalid-value drop, and default.Note for reviewers
An unrecognized value is dropped-to-default with a warning rather than throwing, matching the docs' "non-applicable parameters are safe to pass" wording. Switching to a hard error is a one-line change in
normalize-properties.tsif preferred.