Skip to content

Commit

Permalink
Reuse PlotSize stream if it exists (#3688)
Browse files Browse the repository at this point in the history
  • Loading branch information
philippjfr authored and jlstevens committed May 3, 2019
1 parent 5cfcb1c commit 9a81a60
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions holoviews/plotting/bokeh/element.py
Original file line number Diff line number Diff line change
Expand Up @@ -488,8 +488,13 @@ def _plot_properties(self, key, element):
if self.dynamic and aspect_props['match_aspect']:
# Sync the plot size on dynamic plots to support accurate
# scaling of dimension ranges
stream = PlotSize(subscribers=[self._update_size])
self.callbacks.append(PlotSizeCallback(self, [stream], None))
plot_size = [s for s in self.streams if isinstance(s, PlotSize)]
if plot_size:
stream = plot_size[0]
stream.add_subscriber(self._update_size)
else:
stream = PlotSize(subscribers=[self._update_size])
self.callbacks.append(PlotSizeCallback(self, [stream], None))

plot_props = {
'margin': self.margin,
Expand Down

0 comments on commit 9a81a60

Please sign in to comment.