How to access a JS variable from separate display_javascript calls in Deepnote?

52 views Asked by At

This simple code in a single cell works in Jupyter Notebook, but Deepnote seems to render the display_javascript calls into separate iframes. Is there any way to get this work in Deepnote?

from IPython.display import display_javascript

display_javascript("var a = 10", raw=True)
display_javascript("console.log(a)", raw=True)

Uncaught (in promise) ReferenceError: a is not defined

Example: https://deepnote.com/project/How-to-access-Javascript-variable-from-separate-displayjavascript-call-hvyWPhDWRGahj9NvgJtuGw/%2Fnotebook.ipynb

Background: I'm working on a JS charting library Jupyter integration (ipyvizzu), where I would like to access the JS chart object eventually from different cells in the notebook.

0

There are 0 answers