-
-
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
Don't mutate colorscale, cmin/cmax and zmin/zmax into user traces #3341
Conversation
- that we don't mutate fullData[i].colorscale in defaults and or calc.
- to 'relink' zmin/zmax, cmin/cmax and auto colorscale, these values are computed in 'calc' in need to be relinked in 'supply-defaults' in order to work properly after edits that don't go through 'calc'.
... trace that have `autocolorscale:true` by default
Oh wow that works great :) |
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.
Great PR! It may likely hit the record of the number of source files changed in one PR in 2018?
@etpinard After a quick first pass & concerning the change in this baseline; I was wondering which version is correct, old or new? The background color in the hover popup does not display the new color.
... that don't use calcdata.mcc (that is: gl3d).
... during Lib.minExtend in Legend.style
Thanks very much @archmoj ! It turns out both versions were wrong! The version from commit 0a686dd looked worse than the one on master, as now we no longer flip |
Out of curiosity, what's the new logic for the legend marker? |
There's no new logic really. This PR fixed |
OK, but what's the one-liner english description of the logic? We grab a marker from the middle of the scale or... ? |
We grab the first plotly.js/src/components/legend/style.js Line 183 in 431fd51
and then apply the |
Many thanks @etpinard |
Thanks very much for the thorough review! |
This PR fixes two bugs (#3273 and #3100) using a similar technique to #3044.
In brief, we use
Colorscale.crossTraceDefaults
to put_
attributes (relinked inrelinkPrivateKeys
) intofullData
- instead of mutating values intogd.data
.I also cleaned up a few things in
components/colorscale/
:scales.js
andhelpers.js
reversescale
later in the pipeline (just before plotting) instead of mutating the colorscale value ingd._fullData
(saving us some headaches incrossTraceDefaults
).asking @plotly/plotly_js for a review 😏
@nicolaskruchten would mind testing out 6a47d66 in the RCE? Thank you!