From 53967d71b9d46cf8555644fb20a1c4e4cba4d335 Mon Sep 17 00:00:00 2001 From: Philipp Rudiger Date: Wed, 2 Sep 2020 02:36:18 +0200 Subject: [PATCH] Fixed color-ranging after box select on side histogram --- holoviews/plotting/bokeh/chart.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/holoviews/plotting/bokeh/chart.py b/holoviews/plotting/bokeh/chart.py index 6d9685638b..358b3ffe2c 100644 --- a/holoviews/plotting/bokeh/chart.py +++ b/holoviews/plotting/bokeh/chart.py @@ -463,8 +463,8 @@ class SideHistogramPlot(HistogramPlot): doc="A list of plugin tools to use on the plot.") _callback = """ - color_mapper.low = cb_data['geometry']['{axis}0']; - color_mapper.high = cb_data['geometry']['{axis}1']; + color_mapper.low = cb_obj['geometry']['{axis}0']; + color_mapper.high = cb_obj['geometry']['{axis}1']; source.change.emit() main_source.change.emit() """ @@ -510,14 +510,13 @@ def _init_glyph(self, plot, mapping, properties): if isinstance(t, BoxSelectTool)] if not tools or not sources: return - box_select, main_source = tools[0], sources[0] + main_source = sources[0] handles = {'color_mapper': self.handles['color_mapper'], 'source': self.handles['source'], 'cds': self.handles['source'], 'main_source': main_source} - axis = 'y' if self.invert_axes else 'x' - callback = self._callback.format(axis=axis) - box_select.js_on_event("selectiongeometry", CustomJS(args=handles, code=callback)) + callback = self._callback.format(axis='y' if self.invert_axes else 'x') + self.state.js_on_event("selectiongeometry", CustomJS(args=handles, code=callback)) return ret