Plotly.py: Merge plotlywidget and @jupyterlab/plotly-extension extensions

Created on 21 Mar 2019  路  13Comments  路  Source: plotly/plotly.py

It would be helpful to merge these and keep them in sync under a single authority. Beakerx has a good example of exposing both widget and mimerender extensions, we can work from that - package.json and code.

V4

Most helpful comment

@gnestor that would also be fine, the main concern is they should all update plotlyjs version and plotly/plotlywidget semver in sync.

All 13 comments

@jonmmease and @gnestor

I'm ok with that if @jonmmease wants to merge plotly-extension into plotlywidget (and move the code into https://github.com/plotly/plotly.py/tree/master/js)

Thanks for the suggest @timkpaine, I totally agree. And I think this is in scope for v4. Thanks for digging up the BeakerX example as a reference.

I'm wondering how far to take this, should we also consider merging in the JupyterLab chart editor? Should all of the extensions we manage that have a dependency on plotly.js become a single extension?

I don't have a good sense on the bundle size considerations of this yet. Regardless, we should also look into loading the plotly.js bundle lazily so as not to weigh down JupyterLab when plotly stuff isn't in use.

@jonmmease yeah I think that all makes sense

I don't think we should combine them all into the same extension but we could move them all into the same monorepo.

@gnestor that would also be fine, the main concern is they should all update plotlyjs version and plotly/plotlywidget semver in sync.

Fun idea from the forums on providing ploty.py with information about the current JupyterLab theme. https://community.plot.ly/t/make-plotly-graphs-automatically-adadpt-to-jupyterlab-theme/21800.

This could be communicated using a simple comm message, and I think it would make sense to include this with this merged extension.

Ya I like this idea. Would it make more sense to out this theme logic in plotly.js?

Hi @jonmmease, any news on this topic ?

Also it would be nice if this features also integrates with voil脿 apps.

Hi @jonmmease, any news on this topic ?

Also it would be nice if this features also integrates with voil脿 apps.

still.. nothing new?

No news yet. We will update this topic when there is some!

That said, we would welcome any assistance in doing this, either in the form of a pull request, or via sponsorship :)

I did get as far as a prototype that merged the extensions a while back. It worked fine in JupyterLab, but I didn't see how to do it in a way that wouldn't break the display of FigureWidget in nbviewer and Voil脿. As I recall, for these there needs to be an npm package named plotlywidget that contains appropriate metadata.

If we merged them, then we would need to merge the Jupyterlab-specific mimetype renderer (jupyterlab-plotly) into the plotlywidget package without breaking how nbviewer/Voil脿 automatically load the widget code outside of a JupyterLab context.

Or, maybe we work out a publication workflow to keep publishing a plotlywidget package, but also includes the widget code in jupyterlab-plotly. But, then we'd need to work through a way to prevent the installation of both jupyterlab-plotly and plotlywidget as JupyterLab extensions so that they don't clobber each other.

In any case, I'm sure there's a ways to get everything working, but several points are a bit subtle.

Was this page helpful?
0 / 5 - 0 ratings