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
I would like to export a notebook to HTML that contains a plot using graphics_toolkit("plotly"), but the plot does not appear in the generated HMTL. If you use graphics_toolkit("notebook") it works fine. For a Julia notebook the interactive graph is exported normally to HTML.
What I Did
graphics_toolkit("plotly")
[X,Y] = meshgrid(1:0.5:10,1:20);
Z = sin(X) + cos(Y);
surf(X,Y,Z)
Then:
File > Save and Export Notebook As... > HTML
The text was updated successfully, but these errors were encountered:
I can reproduce what you're seeing, and I think the reason for this is that when plotly is active xeus-octave produces an output with mimetype application/vnd.plotly.v1+json, which is automatically rendered by jupyterlab without intervention from the kernel.
I don't know about Julia, but I tried Python, and I found out that when showing a graph it outputs a text/html mimetype (in addition to the application/vnd.plotly.v1+json) which contains a pre baked html representation (made by the kernel) of the plot (bundling the plotly.js library and other things, already minified).
Unfortunately, at the moment the same thing is quite complicated to do for xeus-octave, because it cannot easily handle all the plotly libraries and prepare an html representation inside the kernel, so we must rely on jupyterlab doing this work for us.
I have seen that when you export to HTML, the plot is saved as an image, so it is probable that the plotly extension that jupyterlab uses for rendering the plot also gets to decide what format to output when exporting the notebook, so it might be possible to achieve what you need by adding an html output at conversion, but this goes beyond my knowledge.
I'm trying to use embed notebooks running on the Xeus-Octave kernel in a Jupyter Book. As the OP suggests, the plotly figure renders well when running the notebook in Jupyter Lab and vscode, but it is completely omitted when the jupyter book is built (html).
First of all, you guys are doing an amazing job here.
xeus-octave version:
octave 7.3.0
xeus-octave 0.1.0
Operating System:
Debian
Description
I would like to export a notebook to HTML that contains a plot using
graphics_toolkit("plotly")
, but the plot does not appear in the generated HMTL. If you usegraphics_toolkit("notebook")
it works fine. For a Julia notebook the interactive graph is exported normally to HTML.What I Did
Then:
File > Save and Export Notebook As... > HTML
The text was updated successfully, but these errors were encountered: