Skip to content

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

Merged
merged 3 commits into from
Sep 26, 2021
Merged

Improve docs for to_jshtml() #21081

merged 3 commits into from
Sep 26, 2021

Conversation

dstansby
Copy link
Member

PR Summary

I noticed that to_jshtml() didn't have a docstring, so have attempted to add one. I'm not too sure what 'embed_frames' does, so haven't added a description there.

PR Checklist

  • Has pytest style unit tests (and pytest passes).
  • Is Flake 8 compliant (run flake8 on changed files to check).
  • New features are documented, with examples if plot related.
  • Documentation is sphinx and numpydoc compliant (the docs should build without error).
  • Conforms to Matplotlib style conventions (install flake8-docstrings and run flake8 --docstring-convention=all).
  • New features have an entry in doc/users/next_whats_new/ (follow instructions in README.rst there).
  • API changes documented in doc/api/next_api_changes/ (follow instructions in README.rst there).

fps : int, optional
Movie frame rate (per second). If not set, the frame rate from
the animation's frame interval.
embed_frames : bool, optional
Copy link
Member

@timhoffm timhoffm Sep 15, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From a quick look: If embed_frames is True, the frame image data are inlined into the HTML. Otherwise they are written to separate files. Given that the data is read back in, I'm wondering if that option does make any sense (or works if set to false at all), becuase that would imply we still need access to the temporary directory. - This should probably be checked.

Copy link
Member Author

Choose a reason for hiding this comment

The 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.

"""Generate HTML representation of the animation"""
"""
Generate HTML representation of the animation.

Copy link
Member

Choose a reason for hiding this comment

The 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

Co-authored-by: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com>
Co-authored-by: Thomas A Caswell <tcaswell@gmail.com>
@timhoffm timhoffm added this to the v3.5.0 milestone Sep 26, 2021
@timhoffm
Copy link
Member

Merging as an improvement.

@timhoffm timhoffm merged commit db67ced into matplotlib:master Sep 26, 2021
meeseeksmachine pushed a commit to meeseeksmachine/matplotlib that referenced this pull request Sep 26, 2021
timhoffm added a commit that referenced this pull request Sep 26, 2021
…081-on-v3.5.x

Backport PR #21081 on branch v3.5.x (Improve docs for to_jshtml())
@dstansby dstansby deleted the jshtml-doc branch September 27, 2021 08:31
tacaswell pushed a commit to tacaswell/matplotlib that referenced this pull request Oct 12, 2021
tacaswell pushed a commit that referenced this pull request Oct 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants