Skip to content

Commit

Permalink
Fixed initialization of scrubber widget (#3225)
Browse files Browse the repository at this point in the history
  • Loading branch information
philippjfr committed Nov 29, 2018
1 parent bea0f54 commit f27deb2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
10 changes: 5 additions & 5 deletions holoviews/plotting/bokeh/widgets.py
Expand Up @@ -274,10 +274,6 @@ class BokehWidget(NdWidget):
Optional javascript extension file for a particular backend.""")

def _get_data(self):
# Get initial frame to draw immediately
if not self.plot.dynamic:
_, _, init_dim_vals = self.get_widgets()
self.plot.update(tuple(init_dim_vals))
msg, metadata = self.renderer.components(self.plot, comm=False)
data = super(BokehWidget, self)._get_data()
return dict(data, init_html=msg['text/html'],
Expand Down Expand Up @@ -316,8 +312,12 @@ def _plot_figure(self, idx, fig_format='json'):


class BokehSelectionWidget(BokehWidget, SelectionWidget):
pass

def _get_data(self):
if not self.plot.dynamic:
_, _, init_dim_vals = self.get_widgets()
self.plot.update(tuple(init_dim_vals))
return super(BokehSelectionWidget, self)._get_data()

class BokehScrubberWidget(BokehWidget, ScrubberWidget):
pass
11 changes: 6 additions & 5 deletions holoviews/plotting/plotly/widgets.py
Expand Up @@ -9,10 +9,6 @@ class PlotlyWidget(NdWidget):
Optional javascript extension file for a particular backend.""")

def _get_data(self):
# Get initial frame to draw immediately
if not self.plot.dynamic:
_, _, init_dim_vals = self.get_widgets()
self.plot.update(tuple(init_dim_vals))
msg, metadata = self.renderer.components(self.plot, divuuid=self.id, comm=False)
data = super(PlotlyWidget, self)._get_data()
return dict(data, init_html=msg['text/html'],
Expand All @@ -33,7 +29,12 @@ def _plot_figure(self, idx, fig_format='json'):


class PlotlySelectionWidget(PlotlyWidget, SelectionWidget):
pass

def _get_data(self):
if not self.plot.dynamic:
_, _, init_dim_vals = self.get_widgets()
self.plot.update(tuple(init_dim_vals))
return super(PlotlySelectionWidget, self)._get_data()

class PlotlyScrubberWidget(PlotlyWidget, ScrubberWidget):
pass

0 comments on commit f27deb2

Please sign in to comment.