-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
nestedProperty results in modal Plotly.restyle #1580
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
Comments
Interesting. Thanks for bringing this up @rreusser 🍻 What does |
That case seems to work as expected. It seems like a bare number |
One proposed fix: Sanitization is generally (always? by definition?) done at the supplydefaults level. So if nestedProperty complied and expanded values into an array when requested to set a particular index, perhaps that would resolve this, but then maybe it would cause problems elsewhere. cc @alexcjohnson for ever-insightful API input. That is, say Either that or modal number-array attributes should be disallowed and it would require |
My concern about this is that in general (including most You could say then that we should automatically wrap or unwrap the value... but I don't think that works either: depending on which operation you changed to, the "natural" place to put the So it seems to me safer to leave it as is, that the user must provide the whole object if she wishes to change its type between bare value, array, and hash. |
Agreed. My takeaways:
|
See: http://codepen.io/rsreusser/pen/NjKXqJ?editors=0010
It seems to me that
Plotly.restyle
is modal in an undesirable way. That is, the same command succeeds or fails depending on the value of current data. Right nowvalue
of the filter transform is the only property which I'm aware exhibits this since either a number or an array is valid, but there may be others.Consider:
value
is a number'value[0]'
⟶ fails because you can't set property[0]
of a number'value': [0, 0]
⟶ succeeds'value[0]'
⟶ succeedsSo the same command both fails and succeeds. You're welcome to close this, but it seems undesirable and uncommon, so I'd love to answer it definitively before it becomes a common usage that can't be undone. (Which is to say, carpet adds another usage of this and I'm currently struggling with the fallout.)
The text was updated successfully, but these errors were encountered: