Newcomer here and a little lost: Has anyone managed to embed dtale in a panel app? I thought it might be possible as an ipywidget. But I am apparently too naive to make that work.
Could you post a minimum, reproducible example of what you have been trying?
My first attempt was this
import panel as pn
import pandas as pd
# import ipywidgets_bokeh
# import ipywidgets as ipw
import dtale
pn.extension('ipywidgets')
df = pd.DataFrame({"A": [1, 2, 3], "B": [4, 5, 6]})
dt = dtale.show(df)
pn.panel(dt).servable()
and that shows the data-frame with no further option to interact with it. My second attempt is this:
import panel as pn
import pandas as pd
import dtale
df = pd.DataFrame({"A": [1, 2, 3], "B": [4, 5, 6]})
dt = dtale.show(df)
html = f""" <iframe src="{dt._url}" width="800" height="800"></iframe> """
html_pane = pn.pane.HTML(html)
html_pane.servable()
and that works. But I suspect it isn’t quite the way that something that works in Jupyter is supposed to be used.
As far as I can see from their docs, this is a Flask app that, when run in Jupyter, wraps an iframe around itself for display in the notebook. Might as well keep using Panel’s HTML Pane and put the iframe into it and point it to their URL. I suppose this will have to be good enough.