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

Cannot add Lumen dashboards dynamically to Panel layouts #513

Closed
ahuang11 opened this issue Dec 6, 2023 · 4 comments
Closed

Cannot add Lumen dashboards dynamically to Panel layouts #513

ahuang11 opened this issue Dec 6, 2023 · 4 comments
Labels
bug Something isn't working

Comments

@ahuang11
Copy link
Contributor

ahuang11 commented Dec 6, 2023

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

image

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 ahuang11 added the bug Something isn't working label Dec 6, 2023
@ahuang11
Copy link
Contributor Author

ahuang11 commented Dec 6, 2023

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
Copy link
Contributor Author

ahuang11 commented Dec 6, 2023

The fix was adding these extensions:
pn.extension("tabulator", notifications=True)

@ahuang11 ahuang11 closed this as completed Dec 6, 2023
@ahuang11 ahuang11 reopened this Dec 6, 2023
@ahuang11
Copy link
Contributor Author

ahuang11 commented Dec 6, 2023

Closed by holoviz/panel#6005

Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 26, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant