-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implementation of textinfo for waterfall traces #3790
Conversation
src/traces/bar/plot.js
Outdated
if(tx) thisText.push(tx); | ||
} | ||
|
||
return thisText.join('<br>'); // TODO: ' | ' may be a better dividor for bar |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, it might be better to have .join(' | ')
for horizontal waterfalls. But since I think most users will set only one textinfo
flag, I doubt it's worth adding magic here.
src/traces/waterfall/attributes.js
Outdated
// labels (legend is handled by plots.attributes.showlegend and layout.hiddenlabels) | ||
textinfo: extendFlat({}, pieAtts.textinfo, { | ||
editType: 'plot', | ||
flags: ['text', 'delta', 'initial', 'final'], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think these flags are 👌
We could maybe add label
, but it might awkward as for waterfall
it doesn't match a labels
data array like for pie and sunburst traces. Maybe adding plain 'x'
and 'y'
flags would be best.
src/traces/bar/plot.js
Outdated
var final = cdi.v; | ||
var initial = final - delta; | ||
|
||
if(hasFlag('initial')) text.push(pieHelpers.formatPieValue(initial, separators)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Try using Axes.tickText
cc fix3777-textinfo-waterfall-fin...funnel-new-proto#commitcomment-33323818
…for funnel traces
…o coerce prefix and suffix for invisible axes - as required in funnel and waterfall textinfo
…el textinfo attr on pie
…bar_attrs_relative to original
Should we skip a line if |
What does |
Good question. No new lines when there is empty text. |
💃 nice job! |
Addressing #3777 for
waterfall
.A similar code could be useful for bar-like
funnel
traces.codepen.
@plotly/plotly_js
cc: @nicolaskruchten