Hi
here is a reproducible example for Scatter3d animation, where easing
property doesn’t seem to be respected.
Q1. Is smoothness of animation supported for Scatter3d as well?
Q2. if supported, how could one get this animation smooth?
Here is the copy-paste of the code from the link above:
import plotly.graph_objects as go
import numpy as np
n_frames = 10
t = np.linspace(0, 10, n_frames)
x, y, z = np.cos(t), np.sin(t), t
frames = [
go.Frame(
dict(
name = f'{k+1}',
data = [
go.Scatter3d(x=x[k:k+1], y=y[k:k+1], z=z[k:k+1], mode='markers')
],
traces=[0])
) for k in range(n_frames)]
updatemenus = [
dict(
type='buttons',
buttons=[dict(label="Play",
method="animate",
args=[[f'{k+1}' for k in range(n_frames-2)],
dict(frame=dict(duration=1000, redraw=True),
transition=dict(
duration=100,
easing="linear" # <<=====
),
easing="linear", # <<=====
fromcurrent=True,
mode="immediate")])],
direction="left",
pad=dict(r=10, t=85),
showactive=True, x=0.1, y=0, xanchor="right", yanchor="top")]
fig = go.Figure(
data=[
go.Scatter3d(x=x[0:1], y=y[0:1], z=z[0:1], mode='markers')
],
frames=frames
)
fig.update_layout(width=900, height=550,
scene_xaxis=dict(range=[x.min(), x.max()], autorange=False),
scene_yaxis=dict(range=[y.min(), y.max()], autorange=False),
scene_zaxis=dict(range=[z.min(), z.max()], autorange=False)
)
fig.update_layout(
updatemenus=updatemenus,
# sliders=sliders
)
fig.show()