Hi
Here I have a 2d scatter model that transition duration works without any problem:
import plotly.graph_objects as go
fig = go.Figure(
data=[go.Scatter(x=[0, 1], y=[0, 1])],
layout=go.Layout(
xaxis=dict(range=[0, 5], autorange=False),
yaxis=dict(range=[0, 5], autorange=False),
title="Start Title",
updatemenus=[dict(
type="buttons",
buttons=[dict(label="Play",
method="animate",
args=[None, dict(frame=dict(redraw=True,fromcurrent=True,duration= 5000, mode='animate'),
transition=dict(duration= 4500))])])]
),
frames=[go.Frame(data=[go.Scatter(x=[1, 2], y=[1, 2])]),
go.Frame(data=[go.Scatter(x=[1, 4], y=[1, 4])]),
go.Frame(data=[go.Scatter(x=[3, 4], y=[3, 4])],
layout=go.Layout(title_text="End Title"))]
)
fig.show()
But when I use this structure for 3D model it doesnβt work?
import numpy as np
import plotly.graph_objects as go
def rndata():
x =np.random.randint(1,10,2)
y =np.random.randint(1,10,2)
z =np.random.randint(1,10,2)
return list(x),list(y),list(z)
fig = go.Figure(
data=[go.Scatter3d(x=rndata()[0],y=rndata()[1],z=rndata()[2])],
layout=go.Layout(
scene = dict(
xaxis=dict(range=[0, 10], autorange=False),
yaxis=dict(range=[0, 10], autorange=False),
zaxis=dict(range=[0, 10], autorange=False),),
title="Start Title",
updatemenus=[dict(
type="buttons",
buttons=[dict(label="Play",
method="animate",
args=[None, dict(frame=dict(redraw=True,fromcurrent=True,duration= 500, mode='animate'),
transition=dict(duration= 450))],
)])]
),
frames=[
go.Frame(data=[go.Scatter3d(x=rndata()[0],y=rndata()[1],z=rndata()[2])]) for k in range(10)]
)
fig.show()
Is problem from my code or β¦?