Cannot add Lumen dashboards dynamically to Panel layouts
Closed this issue · 4 comments
ahuang11 commented
Not sure if this should reside in Panel or Lumen.
I've tried as a ChatMessage:
import panel as pn
import lumen as lm
import yaml
pn.extension()
def callback(contents, user, instance):
with open("test.yaml", "r") as f:
spec = yaml.safe_load(f)
dashboard = lm.Dashboard(spec)
return
tabs = pn.Tabs(("Chat", pn.chat.ChatInterface(callback=callback)))
tabs.servable()
Tabs:
import panel as pn
import lumen as lm
import yaml
pn.extension()
def callback(contents, user, instance):
with open("test.yaml", "r") as f:
spec = yaml.safe_load(f)
dashboard = lm.Dashboard(spec)
tabs.append(("Dashboard", dashboard))
tabs = pn.Tabs(("Chat", pn.chat.ChatInterface(callback=callback)))
tabs.servable()
It just displays an empty dashboard
I suspect it might be lazily loading and not trigger because I tried to extract the layout, but it crashes with list index out of range.
import panel as pn
import lumen as lm
import yaml
pn.extension()
def callback(contents, user, instance):
with open("test.yaml", "r") as f:
spec = yaml.safe_load(f)
dashboard = lm.Dashboard(spec).layouts[0]
return dashboard
tabs = pn.Tabs(("Chat", pn.chat.ChatInterface(callback=callback)))
tabs.servable()
test.yaml
sources:
penguin_source:
type: file
tables:
penguin_table: https://datasets.holoviz.org/penguins/v1/penguins.csv
layouts:
- title: Penguins
source: penguin_source
views:
- type: table
table: penguin_table
ahuang11 commented
Actually this doesn't work:
import panel as pn
import lumen as lm
import yaml
pn.extension()
dashboard = lm.Dashboard("test.yaml")
dashboard.servable()
ahuang11 commented
The fix was adding these extensions:
pn.extension("tabulator", notifications=True)
ahuang11 commented
Closed by holoviz/panel#6005
github-actions commented
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.