Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nbviewer not showing ipywidgets, bqplot or plotly plots #2063

Open
rishabhmulani opened this issue Apr 30, 2018 · 23 comments
Open

Nbviewer not showing ipywidgets, bqplot or plotly plots #2063

rishabhmulani opened this issue Apr 30, 2018 · 23 comments
Milestone

Comments

@rishabhmulani
Copy link

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?

@jasongrout
Copy link
Member

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

@Pabla007

This comment has been minimized.

@choldgraf
Copy link

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?

@SylvainCorlay
Copy link
Member

@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

@jasongrout
Copy link
Member

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

@choldgraf
Copy link

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

@Pabla007
Copy link

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

@jasongrout
Copy link
Member

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.

@choldgraf
Copy link

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

@jasongrout
Copy link
Member

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.

@jakirkham
Copy link

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?

@jasongrout
Copy link
Member

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

@jasongrout
Copy link
Member

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

@jakirkham
Copy link

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.

@kanavsetia
Copy link

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 :)

@Unbalanced-Tree
Copy link

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?

@SimplyLucKey
Copy link

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.

@jasongrout
Copy link
Member

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

In JupyterLab, it's under the Settings menu.

@SimplyLucKey
Copy link

SimplyLucKey commented May 11, 2020

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

@jasongrout
Copy link
Member

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.

@SimplyLucKey
Copy link

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.

@jasongrout
Copy link
Member

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

@SimplyLucKey
Copy link

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?

bpw1009 added a commit to bpw1009/Hiking_Mobile_Coverage that referenced this issue Jun 29, 2023
Trying to save widgets state to get plotly to show up as suggested here: jupyter-widgets/ipywidgets#2063
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants