Uh oh!
There was an error while loading. Please reload this page.
feat(types): type object-chart colors as palette or value→color map - #1936
Merged
Conversation
ObjectChartSchema.colors now accepts a positional palette (string[]) OR an explicit value→color map (Record<value,color>, kanban-style), matching the renderer that resolves select/lookup option colors per category and lets them win over the positional palette. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
✅ Console Performance Budget
📦 Bundle Size Report
Size Limits
|
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 freeto 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.
What
Types
ObjectChartSchema.colorsas a discriminated union: either a positional palette (string[]) or an explicit value→color map (Record<value, color>, kanban-style).Why
Completes the
object-chartsemantic-color work whose renderer already shipped in #1932. The renderer resolves a select/lookup dimension's option colors per category and lets them — and any explicit author map — win over the positional palette (health green/red/yellow paints semantically). Before this,ObjectChartSchemahad nocolorsfield at all, so the explicit-map authoring path was untyped/undocumented.This is additive and backward-compatible: the field is optional, the array form is unchanged, and the runtime already handles both shapes.
Test
{ value: color }map, and rejects invalid shapes.AdvancedChartImpl.colors.test.tsx(shipped in fix(studio): record-page preview binds a real record + charts use field option colors #1932).🤖 Generated with Claude Code