Working Javascript in HTML rendered notebooks

Visto 48 veces
Saltar al primer mensaje no leído

Jason

no leída,
13 ene 2019, 23:35:3213/1/19
a Project Jupyter
Is there a way to ensure the javascript components work as per the actual notebooks when the ipynb file has been converted to html?

This seems to be possible from this GitHub directory: https://github.com/jupyter-widgets/ipywidgets/tree/master/examples/web3

How can I replicate this onto my own notebooks?


Roland Weber

no leída,
15 ene 2019, 3:08:0315/1/19
a Project Jupyter
Hello Jason,


Is there a way to ensure the javascript components work as per the actual notebooks when the ipynb file has been converted to html?

In general? No. JavaScript that relies on data stored in the notebook might work. JavaScript that tries to interact with the running kernel will fail, because there is no running kernel when you browse the html of a converted ipynb file.
 
This seems to be possible from this GitHub directory: https://github.com/jupyter-widgets/ipywidgets/tree/master/examples/web3

Instructions there explicitly mention that a notebook server must be running. This is not the case when you look at the html of a converted notebook. Iirc, ipywidgets/widgetsnbextensions have special logic that allows to render captured output even after conversion of the notebook to html. But you cannot expect the widgets to interact with the code in the kernel, as they do when you are running a notebook.

cheers,
  Roland

Chris Holdgraf

no leída,
15 ene 2019, 11:07:5015/1/19
a jup...@googlegroups.com
Though note that projects like thebelab (https://github.com/minrk/thebelab) are playing around with ways to back a static page with a kernel. 

Sent from my phone, apologies for the curtness and type-os

--
You received this message because you are subscribed to the Google Groups "Project Jupyter" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jupyter+u...@googlegroups.com.
To post to this group, send email to jup...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jupyter/18bfabee-f208-478d-88dc-344989fa4d8f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Se ha eliminado el mensaje

Jason

no leída,
15 ene 2019, 18:53:1315/1/19
a Project Jupyter
Thanks for the fast replies!

Is is possible to hook the html to a live kernel so that the interactivity is maintained?

If so, how would I go about that?

Regards,

Jason

Jason Grout

no leída,
16 ene 2019, 3:32:2916/1/19
a Project Jupyter
Hooking an html page to a live kernel is exactly the sort of thing that ThebeLab, the project Chris mentioned, does: https://github.com/minrk/thebelab

Jason


--
You received this message because you are subscribed to the Google Groups "Project Jupyter" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jupyter+u...@googlegroups.com.
To post to this group, send email to jup...@googlegroups.com.
Responder a todos
Responder al autor
Reenviar
0 mensajes nuevos