Closed ubuntuslave closed 6 years ago
On a similar note:
I'm really loving this library but I'm struggling to see how I can use it outside of a notebook. I would love to export a widget into a web page, perhaps within a Flask web app. Does anyone know how this can be done?
I tried using from ipywidgets.embed import embed_minimal_html
, as documented here, but it seems that is only for basic widgets.
The jupyter widgets user guide has a section on embedding custom widget libraries, but I don't really understand it. It says:
The widget embedder attempts to fetch the model and view implementation of the custom widget from the npm CDN https://unpkg.com. The URL that is requested for, e.g. the bqplot module name, with the semver range ^2.0.0 is
https://unpkg.com/bqplot@^2.0.0/dist/index.js
which holds the webpack bundle for the bqplot library.
Any insights into rendering pythreejs widgets outside a notebook would be much appreciated!
This should work with the latest release of pythreejs once https://github.com/jupyter-widgets/ipywidgets/pull/2026 (or another solution to the same problem) gets merged and released.
This now works, see e.g. https://nbviewer.jupyter.org/github/jupyter-widgets/pythreejs/blob/master/examples/Textures.ipynb
The displayed output doesn't get rendered on Jupyter .ipynb notebooks on nbviewer
Has anyone achieved this with
pythreejs
?. The iPython notebook is supposed to be cached and showed as run last.