Uh oh!
There was an error while loading. Please reload this page.
Fix uniformtext and enable coloraxis for sunburst and treemap as well as pathbar.textfont - #4444
Conversation
- fix clear previous uniformtext scale before each plot - fix uniformtext after switch level when has no transition for sunburst and treemap - fix tests and add new tests
| }; | ||
| // don't clear bar when this is called from waterfall or funnel | ||
| clearMinTextSize('bar', fullLayout); |
There was a problem hiding this comment.
Wait. Here you're clearing the min-text-size stash during the plot step. So what's happens when a style-only edit (e.g. Plotly.restyle(gd, 'marker.color', 'red')) gets called?
To me, this logic should probably be somewhere in the calc step.
There was a problem hiding this comment.
Restyle works. Considering interactions (e.g. zoom and selection) this should be cleared after calc and at the stat of plot.
There was a problem hiding this comment.
Considering interactions (e.g. zoom and selection) this should be cleared after calc and at the stat of plot.
Can you explain a bit more here? To me, sounds like we should not clear minTextSize during zoom interactions.
There was a problem hiding this comment.
Or let me rephrase my question: if you do move clearMinTextSize to the calc step, do any of the tests fail?
There was a problem hiding this comment.
Yes. In that case the react tests would fail.
There was a problem hiding this comment.
Can you share the branch you used to test that?
There was a problem hiding this comment.
Summing up a private convo:
- I was under the impression that the
uniformtextattributes wereeditType: 'calc', so that's why I thought it would be best to clear the min-text-size during the calc step, but they're not. Theuniformtextattributes areeditType: 'plot'. - @archmoj says that making the
uniformtextattributeseditType: 'calc'would have an impact on the way graph with set uniformtext would behave on zoom - Since we'll need to refactor the trace text pipeline at some point (more info in Consistent text mode for bar-like & pie-like traces and feature to control text orientation inside pie/sunburst slices #4420 (comment)), let's keep the clear-min-text logic in the plot step for now.
- The most important of this PR are the newly added tests.
| function transition(selection, opts, makeOnCompleteCallback) { | ||
| if(hasTransition(opts)) { | ||
| function transition(selection, fullLayout, opts, makeOnCompleteCallback) { | ||
| if(!fullLayout.uniformtext.mode && hasTransition(opts)) { |
There was a problem hiding this comment.
Why? I thought you said this transitions looked fine
There was a problem hiding this comment.
They did not apply a uniform text size during and after smooth transition.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
| var font = Lib.ensureUniformFontSize(gd, helpers.determineTextFont(trace, pt, fullLayout.font, trace.pathdir)); | ||
| var font = Lib.ensureUniformFontSize(gd, helpers.determineTextFont(trace, pt, fullLayout.font, { | ||
| onPathbar: true |
There was a problem hiding this comment.
Can you explain why this commit made three existing mocks change (treemap_level-depth, treemap_packings and treemap_textposition) ?
There was a problem hiding this comment.
Good question.
And a bad mistake here.
There is no such a thing as pathdir!
It should have been written pathbar.
…r positions - also revise code related to autorotate
archmoj
commented
Jan 5, 2020
After a9c9589 this PR is now ready to go. |
Uh oh!
There was an error while loading. Please reload this page.
archmoj
commented
Jan 6, 2020
Here is info related to new/modified baselines:
treemap trace custom fonts bug fix (#4451)
treemap coloraxis with values as well as custom fonts and uniformtext (#4443):
uniform start/end anchor positions in respect to (#4247):
modified mock: middle anchors is not used now that the text positions properly by default
|
etpinard
commented
Jan 6, 2020
💃 💃 |
Resolves#4443 by adding
coloraxistosunburstandtreemapand fixes
uniformtextscale issues with react (follow up of #4420):sunburstandtreemapuniformtextas well as newcoloraxisfeature.Also:
pathbar.textfontbug in 6a4b451textanglebug in 2a7721cdemo treemap
demo sunburst
demo bar
@plotly/plotly_js