How to create displays using javascript within a Jupyter Cell

45 views
Skip to first unread message

Parami De Silva

unread,
Mar 8, 2017, 1:28:50 PM3/8/17
to Project Jupyter

What is the recommended method to embed javascript within a python cell so that customized html output is displayed from the cell?This html output needs to display dynamic data read off from  a python function dynamically.

Jason Grout

unread,
Mar 8, 2017, 4:44:16 PM3/8/17
to Project Jupyter
How complicated is the display? Can you give us an idea of what you're trying to do? The recommended answer will likely depend on how complicated your usecase is, and how dynamic you need the output to be.

One way to do it is to create an HTML ipywidget and set the HTML in python. As you change the HTML, the rendered display will be updated for you. Another way to do it is to use the new display/update functionality in notebook 5.0 (again, that would be basically constructing the HTML in python and updating the display when needed, or it could use your own renderer plugin you provide and use your preferred data format). Another way is to make your own javascript widget plugin that takes the data in whatever form you'd like, and display/update it as needed.

Again, if you can give us a better idea of exactly what you want to do, I could be more specific with a recommendation.

Thanks,

Jason


On Wed, Mar 8, 2017 at 1:28 PM Parami De Silva <pcpde...@gmail.com> wrote:

What is the recommended method to embed javascript within a python cell so that customized html output is displayed from the cell?This html output needs to display dynamic data read off from  a python function dynamically.

--
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/74f76a55-1c78-47f8-b1e6-104a4c4f6708%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages