jupyter-widgets / jupyterlab-sidecar

A sidecar output widget for JupyterLab
BSD 3-Clause "New" or "Revised" License
247 stars 39 forks source link

Using Sidecar in jupyterlab. Trying to show HTMl. Just shows in standard cell output instead of opening a sidecar. #36

Open kevinsneel opened 4 years ago

kevinsneel commented 4 years ago

Here's my code. What am I doing wrong:

sc = Sidecar(title='Trace') ht = widgets.HTML( value="Hello World", placeholder='Some HTML', description='Some HTML', ) with sc: display(ht)

I have also tried:

sc = Sidecar(title='Trace') with sc: display(HTML(functools.reduce(lambda x, y: x+y, c.htmlStream())

thomasaarholt commented 4 years ago

Both HTML implementations that I'm aware of (IPython and ipywidgets) appear to work fine. The latter seems to add some flexbox layout of its own.

from sidecar import Sidecar
sc = Sidecar(title='Sidecar Output')

from IPython.display import HTML
from ipywidgets import HTML as html

with sc:
    display(HTML('hello there'))
    display(html('<b>hello</b> there2'))

I believe this can be closed.