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

Integration with JupyterLite? #88

Closed
deeplook opened this issue Feb 20, 2022 · 6 comments
Closed

Integration with JupyterLite? #88

deeplook opened this issue Feb 20, 2022 · 6 comments

Comments

@deeplook
Copy link

I think it would be nice to run ipylab in JupyterLite, so I gave it a try, although I see no claim that ipylab should support JupyterLite. So while ipylab does install fine, it does not appear to have any effect on the (JupyterLab) interface, like in this code:

import micropip
await micropip.install('ipylab')
from ipylab import JupyterFrontEnd

app = JupyterFrontEnd()
app.commands.execute('apputils:change-theme', {'theme': 'JupyterLab Dark'})

When using widgets in a panel like this (from a standard example snippet) I get a "Loding widget..." message:

import micropip
await micropip.install("ipylab")
await micropip.install("ipywidgets")
from ipylab import Panel
from ipywidgets import IntSlider

panel = Panel()
slider = IntSlider()
panel.children = [slider]
panel

I'd appreciate any statement if this should work and I'm doing something wrong, or if JupyterLite support is considered enough of a nice to have feature in the future?

@jtpio
Copy link
Owner

jtpio commented Feb 21, 2022

Thanks @deeplook.

Yes ipylab (latest versions) should work with JupyterLite now.

This is for example the case with this custom deployment: https://github.com/jtpio/lit

image

You might need to separate the following two statements in different cells:

app = JupyterFrontEnd()
app.commands.execute('apputils:change-theme', {'theme': 'JupyterLab Dark'})

@deeplook
Copy link
Author

Ok, great! Will this be deployed to https://jupyterlite.readthedocs.io, too, and when? ;)

@jtpio
Copy link
Owner

jtpio commented Feb 21, 2022

Ah I think it's unlikely to be added to https://jupyterlite.readthedocs.io.

But you can easily make your own JupyterLite deployment and add ipylab to it (like https://github.com/jtpio/lit does).

@deeplook
Copy link
Author

Sorry, I didn't mean "deployed" in the sense of pre-install ipylab on https://jupyterlite.readthedocs.io, but in the sense of being able to micropip-install it there.

@jtpio
Copy link
Owner

jtpio commented Feb 22, 2022

Right, it can be micropip installed. But the frontend extension also needs to be available, which requires adding it to the deployed website.

For example here on the demo site:

https://github.com/jupyterlite/jupyterlite/blob/21949bb8203cb4b18cc6c63cc25dd0a9cc2a45f0/examples/jupyter_lite_config.json#L4-L22

@deeplook
Copy link
Author

Got it, thanks!

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

2 participants