I’m trying to animate a 3D surface plot with the slider. And I’m following the Gapminder exmple. In the example it says layout has two different key slider and sliders. However when I try to set figure['layout']['slider'] I get the following error:
plotly.exceptions.PlotlyDictKeyError: 'slider' is not allowed in 'layout'
Path To Error: ['layout']['slider']
So is the example wrong or am I missing something? If I remove the slider dictionary then the figure does have a slider but it doesn’t update the plot when the slider is moved.
Currently the animation plays all the frames when you load the page. I would like it to stay on the first frame and just update when slider value is changed. Is it possible to do that with plotly?
I can paste the code if that’ll help but it creates the slider in the exact same manner as the example does.
A follow up question, now I’m trying to have multiple subplots that I want to update with the slider. I got it to work work by adding the data for second scene in the each frame dict. However, I have to remove the traces key from that dict. So my question is where can I find more information on what that is? How would you find out what it does if you were in my place? I don’t want a straight answer, I want to know how to find it out myself. The reference documentation doesn’t have any info on that.
@lordlycastle For an animation you define data as a list of traces, frames and layout.
The traces in data represent the starting plot of the animation, while the frames define the updates of data.
The key traces in a frame points out the indices of traces in data updated by that frame.
Example:
traces=[0]#the first trace in data is updated
traces=[0,1]#the first two traces in data are updated