Black Lives Matter. Please consider donating to Black Girls Code today.

Define transform in restyle

Is it possible to define a filter transform for the first time in Plotly.restyle?

Here is an attempt to do this: https://jsfiddle.net/3gfztdja/6

I can see that the transforms object gets added to the data object in the plot, but that filter does not seem to be applied. It works if I define a trivial filter in Plotly.newPlot and then just restyle the filter value. However I am curious why my example linked above doesn’t work.

You need to wrap the update value in another [] as in https://jsfiddle.net/3gfztdja/14/

More info in https://plot.ly/javascript/plotlyjs-function-reference/#plotlyrestyle

Thanks. I will try an extra set of []. Although I may be missing something as in your linked fiddle above, I don’t see any markers passing the filters after the slider update.