Skip to content

Commit

Permalink
Fix regression rendering HoloViews plotly backend (#2961)
Browse files Browse the repository at this point in the history
* Fix regression rendering HoloViews plotly backend

* Fix flake
  • Loading branch information
philippjfr authored Nov 30, 2021
1 parent 2248dcd commit 1badb73
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions panel/pane/holoviews.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,10 +259,7 @@ def _get_model(self, doc, root=None, parent=None, comm=None):

kwargs = {p: v for p, v in self.param.values().items()
if p in Layoutable.param and p != 'name'}
pane_type = self._panes.get(backend, Pane)
if 'tight' in pane_type.param:
kwargs['tight'] = True
child_pane = pane_type(state, **kwargs)
child_pane = self._get_pane(backend, state, **kwargs)
self._update_plot(plot, child_pane)
model = child_pane._get_model(doc, root, parent, comm)
if ref in self._plots:
Expand All @@ -273,6 +270,12 @@ def _get_model(self, doc, root=None, parent=None, comm=None):
self._models[ref] = (model, parent)
return model

def _get_pane(self, backend, state, **kwargs):
pane_type = self._panes.get(backend, Pane)
if isinstance(pane_type, type) and issubclass(pane_type, Matplotlib):
kwargs['tight'] = True
return pane_type(state, **kwargs)

def _render(self, doc, comm, root):
import holoviews as hv
from holoviews import Store, renderer as load_renderer
Expand Down

0 comments on commit 1badb73

Please sign in to comment.