Skip to content

Fix breaking changes from the color function API - #111

Draft
rokotyan wants to merge 2 commits into
mainfrom
fix/color-breaking-changes
Draft

Fix breaking changes from the color function API#111
rokotyan wants to merge 2 commits into
mainfrom
fix/color-breaking-changes

Conversation

@rokotyan

Copy link
Copy Markdown

f5#856

This PR addresses two breaking changes introduced by the recent custom color function work, before they ship in a release.

Rename color to colorFunction

The new custom color function config property on containers and BulletLegend was named color, which is both ambiguous (it holds a function, not a color value) and collides with the widely used color accessor naming on components. It is now colorFunction:

// Before
<VisXYContainer color={myColorScale}>
// After
<VisXYContainer colorFunction={myColorScale}>

Applied to ContainerConfigInterface (so both SingleContainer and XYContainer), BulletLegendConfigInterface, and the Angular wrappers — which also now actually expose the input on VisSingleContainerComponent and VisXYContainerComponent. Dev examples and website docs (Single_Container, XY_Container, theming guide) are updated to match.

Backward compatibility for getColor

The getColor utility's fourth positional argument used to be dontFallbackToCssVar: boolean and was repurposed as key: string, silently breaking existing callers. getColor now accepts string | boolean there: a string is treated as a color key, while true is interpreted as the legacy dontFallbackToCssVar flag (unless explicitly set via options). Marked with TODOs to drop the boolean form in Unovis 2.0.

@rokotyan rokotyan self-assigned this Jul 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant