You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is probably more to do with nbviewer than IPython, but I wanted to start the discussion here. Pinging @wrobstory@jakevdp@rgbkrk as well.
The issue is that nbviewer doesn't provide the same runtime environment as the live notebook. There are a couple of differences:
JS output is not run at all. This forces people to put JS code in <script> tags to get it to work with nbviewer.
jQuery is loaded at the bottom of the page, so any JS code that does get run in script tags doesn't have jQuery. This means that proejcts like mpld3 have to do wonky things like this because $.getScript doesn't exist:
require.js is not on the page. Libraries such as d3 exhibit different initialization logic if require is defined. Both vincent and mpld3 have to have special cases to cover nbviewer right now as it doesn't have require.js on the page.
Here is a notebook on nbviewer that shows these issues:
Sounds good to me, but I'm no javascript ninja (hopefully I'll get to work on that soon).
We probably need to do some javascript cleanup anyway. I noticed this 404 on all of our rendered pages while I was investigating network timings for @CamDavidsonPilon's notebook:
I'd add one more thing to this: it would also be nice if nbconvert html output could be set up to make this convenient as well. Currently when I blog with the IPython notebook using Javascript tricks, I have to worry about three different platforms: IPython notebook itself, nbviewer, and nbconvert html.
Probably we can put this things it in the head of nbconvert html output and then the issue will be solved in nbviewer too, because it is using nbconvert underlying...
This is probably more to do with nbviewer than IPython, but I wanted to start the discussion here. Pinging @wrobstory @jakevdp @rgbkrk as well.
The issue is that nbviewer doesn't provide the same runtime environment as the live notebook. There are a couple of differences:
<script>
tags to get it to work with nbviewer.$.getScript
doesn't exist:https://github.com/jakevdp/mpld3/blob/master/mpld3/_objects.py#L192
Here is a notebook on nbviewer that shows these issues:
http://nbviewer.ipython.org/gist/ellisonbg/8906675
Here is my proposal for 2.0:
require.js
at the top of the page (above the body).This should unify the live notebook and nbviewer for 2.0 at a reasonable level.
The text was updated successfully, but these errors were encountered: