Skip to content

Commit

Permalink
Add support for bokeh theme (#2164)
Browse files Browse the repository at this point in the history
* Add support for bokeh theme

* Update panel/pane/plot.py

Co-authored-by: Philipp Rudiger <prudiger@anaconda.com>
  • Loading branch information
brl0 and philippjfr authored Apr 13, 2021
1 parent fb73018 commit 173885b
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions panel/pane/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import param

from bokeh.models import CustomJS, LayoutDOM, Model, Spacer as BkSpacer
from bokeh.themes import Theme

from ..io import remove_root
from ..io.notebook import push
Expand Down Expand Up @@ -46,6 +47,9 @@ class Bokeh(PaneBase):
Bokeh panes allow including any Bokeh model in a panel.
"""

theme = param.ClassSelector(default=None, class_=(Theme, str), doc="""
Bokeh theme to apply to the plot.""")

priority = 0.8

@classmethod
Expand Down Expand Up @@ -109,6 +113,10 @@ def _get_model(self, doc, root=None, parent=None, comm=None):
remove_root(model, doc)

self._models[ref] = (model, parent)

if self.theme:
doc.theme = self.theme

return model


Expand Down

0 comments on commit 173885b

Please sign in to comment.