use marker.colors with colorscale in treemap and sunburst plots#4242
use marker.colors with colorscale in treemap and sunburst plots#4242
Conversation
- default marker.colorscale when having marker.colors
…rs numbers without defined colorscale
- also update the treemap baseline which now fails both locally and on the CI
- drop opacitybase - drop opacitystep - combine colors with the background color according with their depth from the top
|
Awesome job @archmoj !! As for the failing tests: plotly.js/test/jasmine/tests/treemap_test.js Lines 119 to 129 in 429324d
plotly.js/test/jasmine/tests/treemap_test.js Lines 1193 to 1235 in 429324d
plotly.js/test/jasmine/tests/treemap_test.js Lines 1237 to 1280 in 429324d
|
... in `marker.depthfade` implementation.
|
One more thing:
|
It is |
I don't have a strong opinion about it, but looks like @nicolaskruchten would prefer
|
OK. Let's go with that. Actually it would work better for text transitions. |
|
@archmoj I'm not sure I understand this mock: Why do the |
When |
To display coloured root cases the root should be drawn. |
| opacity = trace._hovered.marker.opacity; | ||
| } else { | ||
| if(helpers.isHierarchyRoot(pt)) { | ||
| if(isRoot && fillColor === 'rgba(0,0,0,0)') { |
There was a problem hiding this comment.
This solution correctly handle the default root case that sets cdi.color to rgba(0,0,0,0) here:
plotly.js/src/traces/sunburst/calc.js
Lines 269 to 270 in 1dff468
but, we'll probably need to extend it all other rgba colors with a 0 alpha channel - as the current depthfade algorithm gives a white fillColor.
|
All right. Time to merge this thing 💃 @archmoj please keep in mind #4242 (review) for future treemap work. |
|
@etpinard Thanks very much for allocating enough time for this PR. |


This PR adds ways to use
marker.colorsnumbers withcolorscale.Also to mention the
marker.colorscalewould be defaulted ifmarker.colorsis not empty.Other changes within this PR also include:
marker.depthfadeand dropmarker.opacitybaseandmarker.opacitystep.@etpinard
cc: @nicolaskruchten