-
-
Notifications
You must be signed in to change notification settings - Fork 8k
Improve docs for to_jshtml() #21081
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
Improve docs for to_jshtml() #21081
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1299,7 +1299,20 @@ def to_html5_video(self, embed_limit=None): | |
return 'Video too large to embed.' | ||
|
||
def to_jshtml(self, fps=None, embed_frames=True, default_mode=None): | ||
"""Generate HTML representation of the animation""" | ||
""" | ||
Generate HTML representation of the animation. | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. One major usecase is to embed the animation into a jupyter notebook. Maybe that should be mentioned. See here for an example: https://github.com/timhoffm/euroscipy2019-using-matplotlib/blob/master/06_Animations.ipynb |
||
Parameters | ||
---------- | ||
fps : int, optional | ||
Movie frame rate (per second). If not set, the frame rate from | ||
the animation's frame interval. | ||
embed_frames : bool, optional | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. From a quick look: If There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't have bandwidth to check at the moment - if someone else wants to feel free, otherwise I'd advocate merging this as an improvement over what was there before. |
||
default_mode : str, optional | ||
What to do when the animation ends. Must be one of ``{'loop', | ||
'once', 'reflect'}``. Defaults to ``'loop'`` if ``self.repeat`` | ||
is True, otherwise ``'once'``. | ||
""" | ||
if fps is None and hasattr(self, '_interval'): | ||
# Convert interval in ms to frames per second | ||
fps = 1000 / self._interval | ||
|
Uh oh!
There was an error while loading. Please reload this page.