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

Offline Plotly - saving notebook causes JSON error #158

Closed
gregmoille opened this issue Sep 13, 2018 · 2 comments
Closed

Offline Plotly - saving notebook causes JSON error #158

gregmoille opened this issue Sep 13, 2018 · 2 comments

Comments

@gregmoille
Copy link

gregmoille commented Sep 13, 2018

Hi all,

Using the Plotly extension for Jupiter lab works fine but when I save the notebook, a JSON error happen stating that is invalid.

The example I ran in a Jupiter lab notebook:

from plotly.offline import download_plotlyjs, init_notebook_mode, plot, iplot
init_notebook_mode(connected=True)
iplot([{"x": [1, 2, 3], "y": [3, 1, 6]}])

Here is the error when saving the notebook

Notebook JSON is invalid: {'x': [1, 2, 3], 'y': [3, 1, 6], 'type': 'scatter', 'uid': '22e994e2-b776-11e8-800b-8c8590492a0e'} is not valid under any of the given schemas

Failed validating 'oneOf' in display_data['properties']['data']['additionalProperties']:

On instance['cells'][0]['outputs'][1]['data']['0']:
{'type': 'scatter',
     'uid': '22e994e2-b776-11e8-800b-8c8590492a0e',
     'x': [1, 2, 3],
     'y': [3, 1, 6]}

The saved notebook still works, but the Plotly plots are now still images (I guess some type of png).

This issue is not reproduced using a normal Jupyter notebook. Also opening a saved notebook with the normal Jupyter works (i.e. Plotly plots are interactive and not png), but saving this same notebook in the Jupyter lab env causes the issue.

Thanks !

@jonmmease
Copy link
Contributor

Fixed by #159 so this can be closed. cc @gregmoille @blink1073

@blink1073
Copy link
Contributor

Thanks for the heads up!

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

3 participants