fix(funnel/waterfall/pie/sunburst): respect textinfo token order#7871
Closed
camdecoster wants to merge 2 commits into
Closed
fix(funnel/waterfall/pie/sunburst): respect textinfo token order#7871camdecoster wants to merge 2 commits into
camdecoster wants to merge 2 commits into
Conversation
Replaces hardcoded hasFlag() checks with a loop over user-specified parts[] so textinfo tokens render in the order the user requested. Applies to funnel/waterfall (bar/plot.js), pie, and sunburst traces. Fixes #7751 Co-authored-by: Abinesh N <abineshabee2@gmail.com>
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
Resurrects the work from #7752 (closed because it's a breaking change; targeting
v4.0here so it can ship in the next major release).Replaces hardcoded
hasFlag()checks incalcTextinfo/formatSliceLabelwith a loop over the user-specifiedtextinfotokens so they render in the requested order. Applies to funnel/waterfall (bar/plot.js), pie, sunburst, and indirectly treemap, icicle, and funnelarea (which reuseformatSliceLabel).Note: per @archmoj's comment on #7752, the
flaglistattribute type spec explicitly says token order should not affect output. Either the spec /coerce.jsflaglisthandling needs to be relaxed to permit ordered tokens, ortextinfoneeds a neworderedflaglist-style coerce type. Filing this PR againstv4.0to gate that decision behind a major-version bump.Before:
textinfo="percent initial+value"→"1000 100.0%"After:
textinfo="percent initial+value"→"100.0% 1000"Test plan
npm run lint)restyleand base assertions updated in sunburst/treemap to reflect new orderingCloses #7751. Supersedes #7752.
Co-authored-by: Abinesh N abineshabee2@gmail.com
🤖 Generated with Claude Code