clustergrammer-widget icon indicating copy to clipboard operation
clustergrammer-widget copied to clipboard

Jupyter Lab support

Open micdonato opened this issue 6 years ago • 9 comments

I was wondering if there will be support for Juptyter Lab.

The example graphs plot correctly in Jupyter, but not if I open the notebook in Jupyter Lab.

micdonato avatar Aug 29 '18 00:08 micdonato

The in-development Clustergrammer_Widget2 widget can be used in Jupyter Lab. We're re-building clustergrammer_widget using WebGL and we're using the latest cookie-cutter template (thanks to @jasongrout for the help). Installation information can be found here and let me know if you have any installation issues.

However, I am having trouble saving the clustergrammer_widget2 widget state to static HTML files or getting the widget to render on NBViewer, which I raised as an issue here. @maartenbreddels and @SylvainCorlay, do you have any ideas what could be causing the widget state issue?

Also, the Clustergrammer-Glidget widget is an alternative version of the new WebGL widget that was basically forked from this repo, but since it was built from an older cookie-cutter it might be difficult to add Jupyter support.

cornhundred avatar Aug 29 '18 01:08 cornhundred

You are missing a version, for instance see: https://github.com/maartenbreddels/ipyvolume/blob/f6a444502baa6b457e62ffdecf9696fa6d4021b8/ipyvolume/widgets.py#L31 and https://github.com/maartenbreddels/ipyvolume/blob/f6a444502baa6b457e62ffdecf9696fa6d4021b8/js/src/scatter.js#L395

Since you do not define them, it inherits it from DOMWidget, which is at version 1.0/1.1, and therefore it tries to fetch https://unpkg.com/[email protected]/dist/index.js while it should get 0.4 (your latest release). Hope that will get you further!

maartenbreddels avatar Aug 29 '18 02:08 maartenbreddels

Thanks @maartenbreddels, I tried changing the version of EXTENSION_SPEC_VERSION to 0.4.1 (my new latest version) in version.ts and _version.py, but I'm still getting errors on NBViewer and the static HTML. It looks like the unpkg link (https://unpkg.com/[email protected]/dist/index.js) is not working. However, I can see the package on NPM https://www.npmjs.com/package/clustergrammer_widget2

cornhundred avatar Aug 29 '18 04:08 cornhundred

Looking at https://unpkg.com/[email protected]/, it looks like the npm package includes the wrong files (lots of python files, but not the right dist/index.js file).

Looking at the cookie cutter, the widget-ts-cookiecutter should have another section in the webpack, like this: https://github.com/jupyter-widgets/widget-cookiecutter/blob/0aa620eaa2b4365ccfc755eb2a9262e2f6bed974/%7B%7Bcookiecutter.github_project_name%7D%7D/js/webpack.config.js#L45-L71 Also, the cookiecutter should have a files entry in the package.json like this: https://github.com/jupyter-widgets/widget-cookiecutter/blob/0aa620eaa2b4365ccfc755eb2a9262e2f6bed974/%7B%7Bcookiecutter.github_project_name%7D%7D/js/package.json#L18-L21

jasongrout avatar Aug 29 '18 08:08 jasongrout

Thanks all, I will try widget2!

micdonato avatar Aug 29 '18 17:08 micdonato

The widget also works on mybinder, see the launch binder badge in the https://github.com/ismms-himc/clustergrammer_widget2 README.

cornhundred avatar Aug 29 '18 17:08 cornhundred

I moved the discussion about getting embedding working to https://github.com/jupyter-widgets/widget-ts-cookiecutter/issues/29

cornhundred avatar Aug 29 '18 19:08 cornhundred

I tried widget2 and it does work on Jupyter lab. The only issue is that clustering is not shown in the heatmap, but I guess it will come later as the widget is developed.

micdonato avatar Aug 29 '18 21:08 micdonato

Thats great @micdonato. We're working on adding the interactive dendrogram and fixing widget embedding. We'll keep you posted

cornhundred avatar Aug 29 '18 23:08 cornhundred