fix(funnel/waterfall): respect textinfo token order#7752
fix(funnel/waterfall): respect textinfo token order#7752Abineshabee wants to merge 11 commits intoplotly:masterfrom
Conversation
|
Hi @Abineshabee ! Thanks for the PR. This looks like it's on the right track; I'll take a review pass through the code. Let us know if you would like assistance with the failing test. Could you please update the PR description to include screenshots or a codepen demonstrating the fix? |
emilykl
left a comment
There was a problem hiding this comment.
Left a few comments, I'll take another look once you're ready @Abineshabee !
|
@emilykl I've addressed both points:
|
|
Thanks @Abineshabee for the quick turnaround! Before I take another look, can you update the PR description to add screenshots of the fix in action, and also fix the failing test? I'm happy to assist with either, just let me know. |
|
@emilykl Updated the test with proper safety checks. Ready for another look! |
|
@emilykl The only remaining CI failure is All funnel and waterfall tests pass. Ready for review ! |
|
Great! Taking another look. |
|
@Abineshabee This looks great! See my comments for additional small changes. The new logic in There's one more chunk of work needed on this PR: Updating other trace types to respect token order in Luckily there's only two other functions which need to be updated:
Both of those functions should be refactored similarly to Thanks for working on this fix! |
|
Also: You're correct that the one failing test is unrelated to these changes. That test is sometimes flaky. If it's still failing after your next commits I'll look into it. |
|
Hi @emilykl — thanks for the detailed review and for guiding this fix in the right direction! Here's a summary of everything updated in this latest push:
All funnel, waterfall, pie and sunburst tests pass. The one remaining CI failure ( Ready for another look! |
|
Thanks @Abineshabee for the quick turnaround! I'll take another look. |
|
Thank for your review and suggestions , now I am working on updates |
|
@Abineshabee I've finished my review pass! Just a few remaining items:
for(var i in parts) {
var part = parts[i];
|
What this fixes
Fixes #7751
go.Funnelwithtextinfo="percent initial+value"was displayingvalue before percent (e.g. "700 70.0%") regardless of the order
specified by the user.
Root cause
In
src/traces/bar/plot.js, thecalcTextinfofunction pushedfunnel tokens (
value,percent initial/previous/total) andwaterfall tokens (
initial,delta,final) in a hardcodedsequence, ignoring the order of tokens in the
textinfostring.Fix
Replaced hardcoded
hasFlag()checks with a loop overparts[](the user-specified token order) for both funnel and waterfall traces.
Before
"percent initial+value" → "1000 100.0%" ❌

After
"percent initial+value" → "100.0% 1000" ✅

Notes
order was already correct
labelandtexttokens still use fixed ordering and arenot modified in this PR