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

Unpack panes correctly on Views #128

Merged
merged 1 commit into from
Apr 14, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions examples/precip/dashboard.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,6 @@ targets:
x: time
y: precip
by: [model, emissions]
min_height: 200
responsive: true
sizing_mode: stretch_width
6 changes: 6 additions & 0 deletions lumen/views/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import panel as pn

from bokeh.models import NumeralTickFormatter
from panel.pane.base import PaneBase
from panel.pane.perspective import (
THEMES as _PERSPECTIVE_THEMES, Plugin as _PerspectivePlugin
)
Expand Down Expand Up @@ -276,6 +277,11 @@ def _get_params(self):

@property
def panel(self):
if isinstance(self._panel, PaneBase):
pane = self._panel
if len(pane.layout) == 1 and pane._unpack:
return pane.layout[0]
return pane._layout
return self._panel


Expand Down