This example states that a plot is updated using
var newArray = []
...
newArray.splice(0, 1)
...
var data_update = {
y: [newArray]
};
Plotly.update('graph', data_update)
But why do I have to wrap the array of numbers into another array to make it work?
I read the docs and examples for plotly.restyle and plotly.update but could not find an explanation.
In the beginning when initializing the array it is just an array of numbers. Why are the square brackets needed to make it work when updating?
Any ideas?
(You can earn some points on SOF as the question is also there.)