Skip to content

Bug fix - animation_opts docstring example #1590

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 31, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 13 additions & 11 deletions plotly/offline/offline.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,12 +316,13 @@ def iplot(figure_or_data, show_link=False, link_text='Export to plot.ly',
`show_link` and `link_text` set the associated options in this
dictionary if it doesn't contain them already.
auto_play (default=True) -- Whether to automatically start the animation
sequence if the figure contains frames. Has no effect if the figure
does not contain frames.
animation_opts (default=None) -- dict of custom animation parameters to be
passed to the function Plotly.animate in Plotly.js. See
sequence on page load, if the figure contains frames. Has no effect if
the figure does not contain frames.
animation_opts (default=None) -- Dict of custom animation parameters that
are used for the automatically started animation on page load. This
dict is passed to the function Plotly.animate in Plotly.js. See
https://github.com/plotly/plotly.js/blob/master/src/plots/animation_attributes.js
for available options. Has no effect if the figure
for available options. Has no effect if the figure
does not contain frames, or auto_play is False.

Example:
Expand All @@ -345,7 +346,7 @@ def iplot(figure_or_data, show_link=False, link_text='Export to plot.ly',
{'data': [{'x': [1, 4], 'y': [1, 4]}]},
{'data': [{'x': [3, 4], 'y': [3, 4]}],
'layout': {'title': 'End Title'}}]}
iplot(figure,animation_opts="{frame: {duration: 1}}")
iplot(figure, animation_opts={'frame': {'duration': 1}})
```
"""
import plotly.io as pio
Expand Down Expand Up @@ -492,11 +493,12 @@ def plot(figure_or_data, show_link=False, link_text='Export to plot.ly',
auto_play (default=True) -- Whether to automatically start the animation
sequence on page load if the figure contains frames. Has no effect if
the figure does not contain frames.
animation_opts (default=None) -- dict of custom animation parameters to be
passed to the function Plotly.animate in Plotly.js. See
animation_opts (default=None) -- Dict of custom animation parameters that
are used for the automatically started animation on page load. This
dict is passed to the function Plotly.animate in Plotly.js. See
https://github.com/plotly/plotly.js/blob/master/src/plots/animation_attributes.js
for available options. Has no effect if the figure does not contain
frames, or auto_play is False.
for available options. Has no effect if the figure
does not contain frames, or auto_play is False.

Example:
```
Expand All @@ -509,7 +511,7 @@ def plot(figure_or_data, show_link=False, link_text='Export to plot.ly',
{'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}}")
plot(figure, animation_opts={'frame': {'duration': 1}})
```
"""
import plotly.io as pio
Expand Down