Uh oh!
There was an error while loading. Please reload this page.
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
nicolaskruchten
commented
Dec 17, 2018
Oh wow that works great :) |
archmoj
left a comment
There was a problem hiding this comment.
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.
Uh oh!
There was an error while loading. Please reload this page.
... that don't use calcdata.mcc (that is: gl3d).
... during Lib.minExtend in Legend.style
etpinard
commented
Dec 17, 2018
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 |
nicolaskruchten
commented
Dec 17, 2018
Out of curiosity, what's the new logic for the legend marker? |
etpinard
commented
Dec 17, 2018
There's no new logic really. This PR fixed |
nicolaskruchten
commented
Dec 17, 2018
OK, but what's the one-liner english description of the logic? We grab a marker from the middle of the scale or... ? |
etpinard
commented
Dec 17, 2018
We grab the first plotly.js/src/components/legend/style.js Line 183 in 431fd51 and then apply the |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
archmoj
commented
Dec 17, 2018
Many thanks @etpinard |
etpinard
commented
Dec 17, 2018
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.crossTraceDefaultsto put_attributes (relinked inrelinkPrivateKeys) intofullData- instead of mutating values intogd.data.I also cleaned up a few things in
components/colorscale/:scales.jsandhelpers.jsreversescalelater 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!