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

V4 merge plotly jupyterlab extensions #1623

Merged
merged 9 commits into from
Jun 18, 2019

Conversation

jonmmease
Copy link
Contributor

Overview

This PR merges the current plotlywidget JupyterLab extension and the @jupyterlab/plotly-extension JupyterLab extension into a single JupyterLab extension simply named jupyterlab-plotly.

This one extension will handle displaying FigureWidget objects, and it will handle displaying Figure objects by their mimetype (the current plotly.offline.iplot approach).

Other changes

I made two changes to the mimetype rendering with respect to the @jupyterlab/plotly-extension extension.

Static image preview on load

The current @jupyterlab/plotly-extension extension automatically saves a PNG rendering of each figure back to the notebook as soon as it is displayed. This makes it possible to export the notebook to static output formats like PDF and get a static image rendering of each plot. The jupyterlab-plotly extension will display this static image rendering of each figure (if it is available) when the notebook is first loaded. This static image will then be replaced with a Plotly.js figure when the user mouses over the image.

This workflow makes a significant improvement in notebook load time for notebooks that contain lots of plotly figures. For the intensive notebook I've been experimenting on (20+ figures), this gives a load time improvement of 40s down to 7s.

Remove auto-animate behavior

The @jupyterlab/plotly-extension extension automatically animates any figures that have frames. Now that we've started making notebooks with plotly express with lots of figures involving frames, it's become apparent that this is not a great default. So this PR just removes the auto-animate behavior. In the future, we could add support for the auto_play argument to plotly.offline.plot if folks find that they need this auto play behavior back.

cc @timkpaine @gnestor

@jonmmease jonmmease added the V4 label Jun 17, 2019
@timkpaine
Copy link

"This makes it possible to export the notebook to static output formats like PDF and get a static image rendering of each plot"

Fantastic!

@jonmmease jonmmease merged commit 2b54b67 into v4_integration Jun 18, 2019
@jonmmease jonmmease deleted the v4_merge_jupyterlab_extensions branch June 18, 2019 12:59
@gnestor
Copy link
Contributor

gnestor commented Jun 19, 2019

This looks great, @jonmmease! Should I unpublish @jupyterlab/plotly and add a deprecation notice to npm and the jupyter-renderers repo?

@jonmmease
Copy link
Contributor Author

Thanks @gnestor! yeah let's do those things once we ship plotly.py v4. I'll ping you when we get to that point.

@saulshanabrook
Copy link

@jonmmease Do you think that will line up with our 1.0 release? Here is our timeline: jupyterlab/jupyterlab#6504 (comment) The plotly jupyterlab extension is one of the most popular downloaded extensions, so it would be nice if there there was a 1.0 compatible one that is out by SciPy

@jonmmease
Copy link
Contributor Author

Hi @saulshanabrook, pre-SciPy is our goal too, so that should line up well. Though I'd estimate that we'll probably slip into the first week of July. I haven't tested this against the JupyterLab 1.0 API yet, any Mimetype renderer or ipywidgets compatibility issues to watch out for? Thanks for reaching out!

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

Successfully merging this pull request may close these issues.

4 participants