Closed
Description
Currently there is no option to access the animation options of Plotly.js from python. This makes it extremely difficult to make proper animations since the default time between frames in 500ms. I have added an extra keyword argument to offline.plot and offline.iplot called animation opts which allows the user to pass a python dictionary through and thus customize animations.
animation_opts (default=None) -- Custom animation parameters to be passed
to the function Plotly.animate in Plotly.js in the form str(dict)
Example:
from plotly.offline import plot
figure = {'data': [{'x': [0, 1], 'y': [0, 1]}],
'layout': {'xaxis': {'range': [0, 5], 'autorange': False},
'yaxis': {'range': [0, 5], 'autorange': False},
'title': 'Start Title'},
'frames': [{'data': [{'x': [1, 2], 'y': [1, 2]}]},
{'data': [{'x': [1, 4], 'y': [1, 4]}]},
{'data': [{'x': [3, 4], 'y': [3, 4]}],
'layout': {'title': 'End Title'}}]}
plot(figure,animation_opts="{frame: {duration: 1}}")
Metadata
Metadata
Assignees
Labels
No labels