Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

This is not really a sage question anymore, since the interact feature is now realized by jupyter widgets, which exists outside of sage as well. That's good, because there is a larger community that may be able to help you.

If you go to "widgets -> embed widgets" you are offered copy-pastable html code that produces exactly the image that you want. So you get html that does what you want.

I haven't been able to find a tool that automatically does the substitutions for you. In fact, this thread (or rather the lack of a satisfying response) suggests this might still be missing functionality.

This is not really a sage question anymore, since the interact feature is now realized by jupyter widgets, which exists outside of sage as well. That's good, because there is a larger community that may be able to help you.

If you go to "widgets -> embed widgets" you are offered copy-pastable html code that produces exactly the image that you want. So you get html that does what you want.

I haven't been able to find a tool that automatically does the substitutions for you. In fact, this thread (or rather the lack of a satisfying response) suggests this might still be missing functionality.

In general, the ipywidgets documentation is probably the way to go. It looks like ipywidgets.embed has the hooks to generate the HTML, so I suspect you can use that to generate an HTML output element to be embedded in the notebook that will make it into a static HTML export of your document.

This is not really a sage question anymore, since the interact feature is now realized by jupyter widgets, which exists outside of sage as well. That's good, because there is a larger community that may be able to help you.

If you go to "widgets -> embed widgets" you are offered copy-pastable html code that produces exactly the image that you want. So you get html that does what you want.

I haven't been able to find a tool that automatically does the substitutions for you. In fact, this thread (or rather the lack of a satisfying response) suggests this might still be missing functionality.

In general, the ipywidgets documentation is probably the way to go. It looks like ipywidgets.embedAs mentioned there jupyter-sphinx has or nbsphinx may offer the hooks to generate the HTML, so I suspect functionality you can use that to generate an HTML output element to be embedded in the notebook that will make it into a static HTML export of your document.are looking for.

This is not really a sage question anymore, since the interact feature is now realized by jupyter widgets, which exists outside of sage as well. That's good, because there is a larger community that may be able to help you.

If you go to "widgets -> embed widgets" you are offered copy-pastable html code that produces exactly the image that you want. So you get html that does what you want.

I haven't been able to find a tool that automatically does the substitutions for you. In fact, this thread (or rather the lack of a satisfying response) suggests this might still be missing functionality.

In general, the ipywidgets documentation is probably the way to go. As mentioned there jupyter-sphinx or nbsphinx may offer the functionality you are looking for.

EDIT: (elevating one of the comments below for better visibility)

The route "File -> Download As -> HTML", after one saves the widgets state, still fails. However, as suggested in the Plotly thread linked above, it can be successfully done through the command line:

$jupyter nbconvert --to html test.ipynb