-
-
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
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. |
} else { | ||
if(helpers.isHierarchyRoot(pt)) { | ||
if(isRoot && fillColor === 'rgba(0,0,0,0)') { |
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.
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
// root gets no coloring by default | |
cdi.color = 'rgba(0,0,0,0)'; |
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.colors
numbers withcolorscale
.Also to mention the
marker.colorscale
would be defaulted ifmarker.colors
is not empty.Other changes within this PR also include:
marker.depthfade
and dropmarker.opacitybase
andmarker.opacitystep
.@etpinard
cc: @nicolaskruchten