Ipywidgets: Nbviewer not showing ipywidgets, bqplot or plotly plots

Created on 30 Apr 2018  路  23Comments  路  Source: jupyter-widgets/ipywidgets

Hi everyone!
I've uploaded an ipython notebook in a public repository which I'm trying to view through nbviewer. Please note that this notebook contains loads of interactive widgets (ipywidgets) and plots using bqplot and plotly. Neither these plots nor the ipywidgets show up in the nbviewer.
Any solutions to this issue?

All 23 comments

You need to save the widget notebook state to embed that state in the notebook: http://ipywidgets.readthedocs.io/en/latest/embedding.html#save-notebook-widget-state

@jasongrout
Sir could you help me with this error. I reach out to the gitter room but no one seems to help there.
https://github.com/jupyter-widgets/ipywidgets/issues/2439

I checked the page that @jasongrout linked, but it doesn't seem to provide instructions for Jupyter Lab, it mostly mentions the Jupyter Notebook interface, and mentions a menu item "Save widget state" that I don't believe exists in Jupyter Lab. Are there more up-to-date instructions for how to embed the widget state with notebooks so that nbviewer can see them?

@choldgraf the corresponding menu was added in ipywidgets master. I will be pushing out a release candidate for ipywidgets 7.5 including that.

Note that ipywidgets 7.5-rc0 will target jupyterlab 1.0.0-rc0

jlab has a setting in the settings menu to save widget state when saving

sounds good - we should make sure to document this new setting once it's there :-)

After the new release can i be able to see the plot in nb-viewer ??
because i am still figuring out this.
https://stackoverflow.com/questions/56526567/error-while-embedding-jupyter-widgets-in-other-contexts-than-the-notebook

sounds good - we should make sure to document this new setting once it's there :-)

It's already there if you install the appropriate version of jlab alpha and the widgets extension.

It's already there if you install the appropriate version of jlab alpha and the widgets extension.

my thinking there is that it's OK to have an alpha feature not documented, but a >= beta feature should be documented somewhere

my thinking there is that it's OK to have an alpha feature not documented, but a >= beta feature should be documented somewhere

Definitely +1 to documenting it.

It's already there if you install the appropriate version of jlab alpha and the widgets extension.

So is this now released? Or is there a particular release we should be waiting for?

In JLab 1.0, ipywidgets 7.5 (both released), go to the settings menu and you should see the saving widgets state option.

Screen Shot 2019-07-02 at 8 16 02 AM

That worked great! Thanks @jasongrout.

Was initially expecting it to add the sidecar .json file like it does in the notebook, but it seems to work fine without it.

Hey everyone, I followed the above procedure to save the widget state, but after saving it, when I reopen the notebook in jlab, I get the following error:
Error displaying widget: model not found
And if I go to the cell and run it again, the widget shows up. But, for some reason, the state is not persistent across sessions.
Does anyone know what may be going on? Thanks :)

Hi everyone!
I've uploaded an ipython notebook in a public repository which I'm trying to view through nbviewer. Please note that this notebook contains loads of interactive widgets (ipywidgets) and plots using bqplot and plotly. Neither these plots nor the ipywidgets show up in the nbviewer.
Any solutions to this issue?

Did you find the solution? I am making plots with Plotly. It worked fine in the local Jupyter notebook but when I used https://nbviewer.jupyter.org/ it did not show plots.
Link to my nbviewer jupter notebook.
This notebook's cells 16, 17, 18, 24, 27, and 36 have code that should show interactive plots.
Any advice on how to solve this issue?

nbviewer does not render any of my plotly plots and widgets.
I have 'Saved Notebook Widget State' and it still did not render. I installed JupyterLab but could not find the 'Save Widget State Automatically' setting.

I installed JupyterLab but could not find the 'Save Widget State Automatically' setting.

In JupyterLab, it's under the Settings menu.

I installed JupyterLab but could not find the 'Save Widget State Automatically' setting.

In JupyterLab, it's under the Settings menu.

I'm not seeing it. Is it Enable Extension Manager?

image

And is there a reason when I upload my ipynb file it shows this?

image

What version of JupyterLab do you have, and what version of the @jupyter-widgets/jupyterlab-manager lab extension do you have installed? jupyter labextension list for that info.

JupyterLab v1.2.6
Known labextensions:
app dir: C:\Users\Will\Anaconda3\share\jupyter\lab
jupyterlab-plotly v4.7.1 enabled ok

I believe it should be the latest version. I just installed them today to address the interactive/plotting issue.

It looks like you don't have the jupyter widgets extension installed: https://ipywidgets.readthedocs.io/en/stable/user_install.html#installing-the-jupyterlab-extension

It looks like you don't have the jupyter widgets extension installed: https://ipywidgets.readthedocs.io/en/stable/user_install.html#installing-the-jupyterlab-extension

Thank you! I now have the option. What exactly is this option supposed to accomplish? The rendering is still the same.

I've noticed that the rendering is hit or miss (sometimes a plot gets rendered and other times it does not). How does nbviewer determine what to render?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

nickpollari picture nickpollari  路  5Comments

pbugnion picture pbugnion  路  4Comments

hangyao picture hangyao  路  6Comments

SimonEnsemble picture SimonEnsemble  路  5Comments

kennethjmyers picture kennethjmyers  路  3Comments