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

Merge plotlywidget and @jupyterlab/plotly-extension extensions #1473

Closed
timkpaine opened this issue Mar 21, 2019 · 14 comments
Closed

Merge plotlywidget and @jupyterlab/plotly-extension extensions #1473

timkpaine opened this issue Mar 21, 2019 · 14 comments

Comments

@timkpaine
Copy link

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.

@timkpaine
Copy link
Author

@jonmmease and @gnestor

@gnestor
Copy link
Contributor

gnestor commented Mar 22, 2019

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)

@jonmmease jonmmease added the V4 label Mar 23, 2019
@jonmmease
Copy link
Contributor

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.

@timkpaine
Copy link
Author

timkpaine commented Mar 23, 2019

@jonmmease yeah I think that all makes sense

@gnestor
Copy link
Contributor

gnestor commented Mar 23, 2019

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

@timkpaine
Copy link
Author

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

@jonmmease
Copy link
Contributor

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.

@gnestor
Copy link
Contributor

gnestor commented Apr 4, 2019

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

@Alexboiboi
Copy link

Hi @jonmmease, any news on this topic ?

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

@icoert
Copy link

icoert commented Mar 31, 2020

Hi @jonmmease, any news on this topic ?

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

still.. nothing new?

@nicolaskruchten
Copy link
Contributor

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

@jonmmease
Copy link
Contributor

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.

@timkpaine
Copy link
Author

Perspective exports both an ipywidget and a mime renderer with no issues in voila:
https://github.com/finos/perspective/blob/master/packages/perspective-jupyterlab/src/ts/index.ts#L29

It requires:
voila-dashboards/voila#481

@nicolaskruchten
Copy link
Contributor

Closed in #3142

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

6 participants