jupyter / nbconvert

Jupyter Notebook Conversion
https://nbconvert.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
1.73k stars 565 forks source link

Widgets not rendered when notebook is output/printed, garbled when widget state is saved #1562

Closed rabejens closed 2 years ago

rabejens commented 3 years ago

I am running Jupyter with Jupyterlab and Sparkmagic to use Apache Spark through Livy. When I output results as a table or plot, the widgets are either not shown at all or the output is garbled.

If "Save widget state automatically" is enabled, the output is garbled, if not, it is missing

Run the attached notebook and open the print preview

Widget.ipynb.txt

Without saving widget state Without saving widget state

With saving widget state With saving widget state

Nbconvert version: 6.0.7

maartenbreddels commented 3 years ago

cc @SylvainCorlay This is similar to https://github.com/voila-dashboards/voila/pull/804 where we could simply not embed the json, but the solution should be to base64 encode it to avoid the HTML inside the json to be interpreted by the browser I think.

maartenbreddels commented 2 years ago

Related https://github.com/jupyter/nbconvert/issues/802