Skip to content

mesh coloring: intensity doesn't clear #654

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

Closed
VeraZab opened this issue Jun 16, 2016 · 3 comments
Closed

mesh coloring: intensity doesn't clear #654

VeraZab opened this issue Jun 16, 2016 · 3 comments

Comments

@VeraZab
Copy link

VeraZab commented Jun 16, 2016

intensity persists even if set to null and not present in _fullData.
http://codepen.io/veraz/pen/LZZJjv

@mdtusz
Copy link
Contributor

mdtusz commented Jun 16, 2016

You just need to wrap the [null] in another set of square brackets to clear the values.

If my suspicion is correct, the null is ignored as if there is no restyle for that trace index - this allows for multiple traces to be updated at once, while still leaving some untouched. E.g.

Plotly.restyle('chart', {intensity: [null, [0, 1, 2, 3], [null]]} , 0 );

@VeraZab
Copy link
Author

VeraZab commented Jun 16, 2016

You're right, it works with [[null]]
But many of the other restyle properties are clearable with just null, should we be using [[null]] everywhere?

@etpinard
Copy link
Contributor

@VeraZab that's because intensity is itself an array attribute.

Very confusingly, the outer arrays in restyle correspond to the traces to update, while the inner arrays correspond to the update values.

In more details: see #167 (comment)

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

No branches or pull requests

3 participants