fix: use Math.max for pyramid chart right-bar palette fallback - #77
Merged
Chenglong-MS merged 5 commits intoJul 27, 2026
Merged
Conversation
0.2.2 fixes and adding dodge options for grouped charts
Dev: new dynamic widget for mcp app & Chinese website
Excel and Plotly backend, and enhanced dynamic widgets
Chenglong-MS
approved these changes
Jul 27, 2026
Contributor
|
Very cool observation! This seems to be a special consideration for echarts? For example, discrete schema |
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.
Summary
Fixed incorrect palette color selection for the pyramid chart's right bar when the palette has 3 colors.
Changes
packages/flint-js/src/echarts/instantiate-spec.ts(line 1101)Math.min(1, pal.length - 1)→Math.max(0, pal.length - 1)When the palette has fewer than 4 colors, the fallback should select the last color.
Math.mincaps the index at 1, so a 3-color palette always pickspal[1](the second color) instead ofpal[2](the last color):Math.min(1, len-1)(before)Math.max(0, len-1)(after)pal[1](wrong)pal[2](last — correct)pal[1](last — ok)pal[1](last — ok)pal[0](only — ok)pal[0](only — ok)Test plan
pal[3]branch handles those)