diff --git a/panel/pane/plot.py b/panel/pane/plot.py index 91d43df3f0..5e4b5015b5 100644 --- a/panel/pane/plot.py +++ b/panel/pane/plot.py @@ -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 @@ -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 @@ -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