Kitware / trame

Trame lets you weave various components and technologies into a Web Application solely written in Python.
https://kitware.github.io/trame/
Other
423 stars 56 forks source link

Jupyter Lab: Compatibility with Sidecar #572

Open ax3l opened 2 months ago

ax3l commented 2 months ago

We like to use Trame a lot from Project Jupyter, especially Jupyter lab. I recently gave this binder demo a try and co-installed the Sidecar extension and it did not seem to work yet. Can support for this be added? We have often complex widgets and like to move them around in separate windows like this.

Describe the solution you'd like

I would like this to work together and open a new Jupyter lab window:

import trame.app.demo
from sidecar import Sidecar

app = trame.app.demo.Cone()
await app.ui.ready

sc = Sidecar(title='Sidecar Output')
with sc:
    display(app.ui)

Describe alternatives you've considered

I am not aware of other extensions that allow to create and control Jupyter windows, but as an alternative this could also become an intrinsic feature of Trame's Jupyter support (?)

Additional context

We are interested to develop dashboards and interfaces to BLAST codes WarpX and ImpactX, among other applications.

jourdain commented 2 months ago

While not as nice as the sidecar extension, if you have the trame-jupyter-extension installed, you should be able to make the cell output its own tab (draggable) while using the available space very much like the sidecar. Except, that you need to right click on the side of the output and ask to detach the view rather than having it built-in into the code (which is really nice).

In other words, I'm giving you a workaround until we get a chance to look at sidecar. Thanks for the pointers!

ax3l commented 2 months ago

Thanks for the pointer!

Cool, that is a nice feature!

Yes I think tab/window integration to either have programatically the whole output widget in a jupyter tab as you describe with trame-jupyter-extension and/or even open a new jupyter tab from a trame application, e.g., for selected submenus and analysis plots, would be awesome.