jupyter-widgets / ipydatagrid

Fast Datagrid widget for the Jupyter Notebook and JupyterLab
BSD 3-Clause "New" or "Revised" License
579 stars 51 forks source link

Using ipydatagrid in JupyterLite/Pyodide? #321

Open deeplook opened 2 years ago

deeplook commented 2 years ago

Is there a way to use ipydatagrid in JupyterLite running on Pyodide? Just micropip-installing it won't work. I assume it might be doable when it gets pre-installed in the JupyterLite instance, but I'm looking for confirmation and maybe some clues of doing that.

martinRenou commented 2 years ago

It's possible, you need to micropip install and have the labextension installed.

deeplook commented 2 years ago

Looking at https://jupyterlite.readthedocs.io/en/latest/configuring.html#demo-extension-notes gives the impression that for now I have to spot and copy all dependencies of a labextension manually to JL, correct?

martinRenou commented 2 years ago

Correct, I think. Though the jupyter lite build command might automatically find the labextensions installed under your environment path.

deeplook commented 2 years ago

I'm running into this maybe related JupyterLite issue, https://github.com/jupyterlite/jupyterlite/issues/620, described there for ipywidgets.

jtpio commented 2 years ago

Last time we looked into adding ipydatagrid to the demo site there seemed to be some issues: https://github.com/jupyterlite/jupyterlite/pull/145#issuecomment-863221729

Maybe worth trying again now to see if that's still the case.

jtpio commented 2 years ago

Just tried with the jupyterlite-xeus-python kernel (https://github.com/jupyterlite/xeus-python-kernel) and it seems to be working well now with the basic example:

image

jtpio commented 2 years ago

Linking to an example notebook if you want to try it out: https://scipy-2022-jupyterlite-virtual-poster.readthedocs.io/en/latest/lite/lab?path=notebooks%2Fipydatagrid.ipynb