nestedProperty results in modal Plotly.restyle
See original GitHub issueSee: 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 now value
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- restyle
'value[0]'
⟶ fails because you can’t set property[0]
of a number - restyle
'value': [0, 0]
⟶ succeeds - restyle
'value[0]'
⟶ succeeds
So 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.)
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
[WIP] Crossfilter discussion · Issue #1316 · plotly/plotly.js
Each action is mapped into a transform of a (current) state to a next state; the state object itself is modeled as a...
Read more >Plotly.js: Why do I have to use a nested array when updating a ...
I found the solution in the doc to Plotly.restyle: In restyle, arrays are assumed to be used in conjunction with the trace indices...
Read more >dashCoreComponents.pdf
A core set of com- ponents, written and maintained by the 'Dash' team, is available in the 'dashCoreComponents' package. The source for this ......
Read more >Docstrings · DashCoreComponents.jl - JuliaHub
The values and labels of the checklist are specified in the options property and the checked items are specified with the value property....
Read more >Untitled
Nz maths curriculum books, Shallwecraft, Leh ratree ep 12 eng sub, Fallout 3 fort ... Kara para ask 25 bolum 1 kisim, Auction...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Agreed. My takeaways:
My concern about this is that in general (including most
arrayOk
cases),5
and[5]
are not equivalent. When used for alongside a data array,5
applies to all points whereas[5]
applies to the first point and the rest receive some sort of default value. Even in this case, you wouldn’t just change from5
to[5, 6]
, would you? You’d changeoperation
as well, to[]
or something, and you also can’t use5
with[]
so they necessarily need to happen together.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
5
depends on which operation you’re coming from and going to… eg'<'
to'[]'
the5
would naturally belong in index 1, but going to']['
it would belong in0
. And if you’re unwrapping, what would you do with the extra value? Which one is extra?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.