Skip to content

Pull in JSAnimation #4703

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

Closed
dopplershift opened this issue Jul 15, 2015 · 11 comments
Closed

Pull in JSAnimation #4703

dopplershift opened this issue Jul 15, 2015 · 11 comments
Assignees
Milestone

Comments

@dopplershift
Copy link
Contributor

Pulling in https://github.com/jakevdp/JSAnimation (which hasn't changed in over a year) would greatly enhance the experience of using animations in the notebook with stock matplotlib. Also, like trendvis, oceancm, and viscm, this would move an very useful matplotlib-based tool into our fold.

The core implementation of JSAnimation is just two parts:

  • A new writer, HTMLWriter, which also includes some icons for the HTML controls
  • IPython notebook display hook code

The HTMLWriter clearly makes sense in matplotlib (alongside FFMpegWriter, etc.). I'm not sure what to do with the IPython display code. Adding it as a _repr_html might not be too bad.

Thoughts?

@dopplershift dopplershift self-assigned this Jul 15, 2015
@dopplershift
Copy link
Contributor Author

Longer term, it would be nice to refactor animation code so that the HTMLWriter could write directly to a string (via StringIO) rather than the verbose code required to use a tempfile.

@jamespjh
Copy link

As one user, this would make me happy...

@gforsyth
Copy link

gforsyth commented Dec 2, 2015

JSAnimation no longer works with matplotlib 1.5 -- jakevdp suggested that the new display hooks in 8cc21db may be the culprit. It's a handy tool for notebooks, especially as the animations remain functional when rendered by nbviewer.

@dopplershift
Copy link
Contributor Author

I've got a PR that's waiting to pull JSAnimation into matplotlib #4821.

@gforsyth
Copy link

gforsyth commented Dec 2, 2015

Ahh. apologies! That's great news.

@jakevdp
Copy link
Contributor

jakevdp commented Dec 2, 2015

@gforsyth – I couldn't reproduce the issues that were reported on twitter: seems to work on 1.5 for me. Does anyone have an example that breaks?

@gforsyth
Copy link

gforsyth commented Dec 2, 2015

@jakevdp - The animation in this notebook isn't working for me on two separate machines (one running jupyterhub, the other local). https://github.com/numerical-mooc/numerical-mooc/blob/master/lessons/03_wave/03_02_convectionSchemes.ipynb

Everything loads (no errors thrown), but the buttons are unresponsive and no animation plays

@jakevdp
Copy link
Contributor

jakevdp commented Dec 2, 2015

Found the source of the problem: with matplotlib 1.5, the HTMLWriter only outputs a single frame. I'm still not sure what caused this change however...

@jakevdp
Copy link
Contributor

jakevdp commented Dec 2, 2015

It would be easier to debug with a minimal non-notebook example that fails.

I have to pivot to something else now — I would be much more likely to be able to debug this soon if someone were to tackle creating a minimal complete example that reproduces the bug.

@jenshnielsen
Copy link
Member

@jakevdp That bug sounds like a duplicate of #5471
The workaround is to add an empty init function to the animation

@gforsyth
Copy link

gforsyth commented Dec 2, 2015

@jenshnielsen @jakevdp Thanks! That fixed it on my end -- JSAnimation working as expected. Thanks for your help!

@QuLogic QuLogic added this to the 2.1 (next point release) milestone Sep 1, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants