Skip to content
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

changing autocolorscale via Plotly.restyle only works on first try #3273

Closed
antoinerg opened this issue Nov 20, 2018 · 1 comment
Closed

Comments

@antoinerg
Copy link
Contributor

As shown in the following Codepen: https://codepen.io/anon/pen/VVybMO?editors=1000

@etpinard
Copy link
Contributor

This one is a side effect from mutating gd.data[0].colorscale

In the codepen above, the graph starts out with gd.data[0].colorscale: 'Viridis', after the first restyle(gd, 'autocolorscale', false), line

doUpdate('colorscale', scl, container.reversescale ? flipScale(scl) : scl);

sets gd.data[0].colorscale: [[0,"rgb(220,220,220)"],[0.2,"rgb(245,195,157)"],[0.4,"rgb(245,160,105)"],[1,"rgb(178,10,28)"]] and the original Viridis is gone.

I wonder if there's a way to make colorscale attributes behave like autobin attributes post #3044 ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants