Plotly.py: GraphWidget doesn't show any plot in Jupyter

Created on 29 May 2016  路  9Comments  路  Source: plotly/plotly.py

Hi guys,

From this tutorial,

http://nbviewer.jupyter.org/gist/chriddyp/9827cb5086cfab8da092/Widgets%20-%20Contour%20Plotter.ipynb

I execute this code snippets in Jupyter

import plotly.plotly as py
from plotly.graph_objs import *
import plotly.tools as tls

import json
import numpy as np
import math
from IPython.display import display
from plotly.widgets import GraphWidget


contour_plot = GraphWidget('https://plot.ly/~bronsolo/63')
line_plot = GraphWidget('https://plot.ly/~chris/2150')

display(contour_plot)
display(line_plot)

But it doesn't show any plot in Jupyter. In fact, any graphwidget that I created also didn't show any plot in Jupyter. Please advice. Thanks!

Most helpful comment

I am still encountering this issue. Is there a solution that doesn't involve downgrading packages?

All 9 comments

@napjon

Try running the code in blocks:

import plotly.plotly as py
from plotly.graph_objs import *
import plotly.tools as tls
import json
import numpy as np
import math
from IPython.display import display
from plotly.widgets import GraphWidget
contour_plot = GraphWidget('https://plot.ly/~bronsolo/63')
line_plot = GraphWidget('https://plot.ly/~chris/2150')
display(contour_plot)
display(line_plot)

I get two visible plots in the two different outputs:
-first one looks fine
-second plot is has no data in it

If you actually visit 'https://plot.ly/~chris/2150', you'll notice the plot is empty, so I think that's the reason why no trace is visible

Let me know if you have any other questions. Someone at Plotly will be happy to help!

Hi @Kully,

Thank you for your help. I still don't have any plot showing from your advice. Maybe it's related to Jupyter version?

  • My Jupyter version is 4.0.6
  • My ipython/notebook version is at 4.2.0

Let me know if you have the same version as me. Thank you.

EDIT:

I'm able to reproduce the contour plot with notebook version 4.1.0. Could you please confirm this?

@napjon I've got it running on ipython version 4.1.1.

Hi,

I can confirm that notebook version 4.2.1 doesn't resolve this issue. Unfortunately, there is no way to debug this. I can't downgrade to 4.1.* . Please advice. Thanks.

Same problem here. Tried to downgrade packages. But no success.
Display is working and showing only widgets but no GraphWidget.
Anyway I can use GraphWidgets only running with jupyter.
If I try with python I get an error saying:

ShimWarning:
The `IPython.html` package has been deprecated. You should import from `notebook` instead. `IPython.html.widgets` has moved to `ipywidgets`.

Same issue, just updated jupyter, can no longer display GraphWidgets. Currently trying to downgrade. My GraphWidgets were displaying with iPython 4.2.0, jupyter-core-4.0.6, ipykernel-4.1.1, notebook 4.0.6. Currently attempting to downgrade to my previous versions, but unable to find the magic combo.

Here are the old packages, in which GraphWidgets were displaying, and the new packages that were installed with pip install -U jupyter, in which GraphWidget no longer displayed:

Upgraded:
Pygments 2.0.2 -> pygments-2.1.3
mistune 0.7.1 -> mistune-0.7.3
decorator 4.0.4 -> decorator-4.0.10
traitlets 4.0.0 -> traitlets-4.2.2
jupyter-core 4.0.6 -> jupyter-core-4.1.1
nbformat 4.0.1 -> nbformat-4.1.0
nbconvert 4.1.0 -> nbconvert-4.2.0
ptyprocess 0.5 -> ptyprocess-0.5.1
pexpect 4.0.1 -> pexpect-4.2.1
setuptools 20.9.0 -> setuptools-26.0.0
pickleshare 0.5 -> pickleshare-0.7.4
ipython 4.2.0 -> ipython-5.1.0
certifi 2015.9.6.2 -> certifi-2016.8.8
tornado 4.3 -> tornado-4.4.1
pyzmq 15.0.0 -> pyzmq-15.4.0
jupyter-client 4.1.1 -> jupyter-client-4.3.0
ipykernel 4.1.1 -> ipykernel-4.4.1
terminado 0.5 -> terminado-0.6
notebook 4.0.6 -> notebook-4.2.2
jupyter-console 4.0.3 -> jupyter-console-5.0.0
ipywidgets 4.1.1 -> ipywidgets-5.2.2
qtconsole 4.1.0 -> qtconsole-4.2.1

New:
configparser-3.5.0
entrypoints-0.2.2
pathlib2-2.1.0
prompt-toolkit-1.0.7
wcwidth-0.1.7
widgetsnbextension-1.2.6

After downgrading everything that was upgraded, I was able to regain the expected functionality. Hope this helps.

same problem

I am still encountering this issue. Is there a solution that doesn't involve downgrading packages?

Same issue in jupyter 4.4.0 ; ipython 6.2.1

There seem to be some issues, enclosing log:

utils.js:109 Error: Could not create view
    at promiseRejection (utils.js:109)
    at <anonymous>
promiseRejection @ utils.js:109
Promise rejected (async)
ManagerBase.display_model @ manager-base.js:71
(anonymous) @ extension.js:114
Async Call
render @ extension.js:113
append_mime @ extension.js:131
OutputArea.append_mime_type @ outputarea.js:689
OutputArea.append_display_data @ outputarea.js:654
OutputArea.append_output @ outputarea.js:346
OutputArea.handle_output @ outputarea.js:257
output @ codecell.js:376
Kernel._handle_output_message @ kernel.js:1196
i @ jquery.min.js:4
Kernel._handle_iopub_message @ kernel.js:1223
Kernel._finish_ws_message @ kernel.js:1015
(anonymous) @ kernel.js:1006
Promise resolved (async)
Kernel._handle_ws_message @ kernel.js:1006
i @ jquery.min.js:4
cve-spike-package-from-gh.ipynb:1 Uncaught (in promise) TypeError: Cannot read property 'GraphView' of undefined
    at manager.js:110
    at <anonymous>
Promise rejected (async)
ManagerBase.create_view @ manager-base.js:104
ManagerBase.display_model @ manager-base.js:71
(anonymous) @ extension.js:114
Async Call
render @ extension.js:113
append_mime @ extension.js:131
OutputArea.append_mime_type @ outputarea.js:689
OutputArea.append_display_data @ outputarea.js:654
OutputArea.append_output @ outputarea.js:346
OutputArea.handle_output @ outputarea.js:257
output @ codecell.js:376
Kernel._handle_output_message @ kernel.js:1196
i @ jquery.min.js:4
Kernel._handle_iopub_message @ kernel.js:1223
Kernel._finish_ws_message @ kernel.js:1015
(anonymous) @ kernel.js:1006
Promise resolved (async)
Kernel._handle_ws_message @ kernel.js:1006
i @ jquery.min.js:4
cve-spike-package-from-gh.ipynb:1 Uncaught (in promise) TypeError: Cannot read property 'GraphView' of undefined
    at manager.js:110
    at <anonymous>
Promise rejected (async)
render @ extension.js:115
append_mime @ extension.js:131
OutputArea.append_mime_type @ outputarea.js:689
OutputArea.append_display_data @ outputarea.js:654
OutputArea.append_output @ outputarea.js:346
OutputArea.handle_output @ outputarea.js:257
output @ codecell.js:376
Kernel._handle_output_message @ kernel.js:1196
i @ jquery.min.js:4
Kernel._handle_iopub_message @ kernel.js:1223
Kernel._finish_ws_message @ kernel.js:1015
(anonymous) @ kernel.js:1006
Promise resolved (async)
Kernel._handle_ws_message @ kernel.js:1006
i @ jquery.min.js:4
Was this page helpful?
0 / 5 - 0 ratings