From c5a64dbd3fbaa72d82a406c8c049a035e230c33a Mon Sep 17 00:00:00 2001 From: Philipp Rudiger Date: Mon, 7 May 2018 13:39:30 +0100 Subject: [PATCH] Ensure PolyDraw data has consistent keys on initialization --- holoviews/plotting/bokeh/callbacks.py | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/holoviews/plotting/bokeh/callbacks.py b/holoviews/plotting/bokeh/callbacks.py index d0b9025f0e..b1f6178fc5 100644 --- a/holoviews/plotting/bokeh/callbacks.py +++ b/holoviews/plotting/bokeh/callbacks.py @@ -922,17 +922,12 @@ def initialize(self): empty_value=self.streams[0].empty_value, renderers=[plot.handles['glyph_renderer']]) plot.state.tools.append(poly_tool) - super(PolyDrawCallback, self).initialize() - def _process_msg(self, msg): - data = super(PolyDrawCallback, self)._process_msg(msg)['data'] - element = self.plot.current_frame + element = plot.current_frame x, y = element.dimensions('key', label=True) - if 'xs' in data and 'xs' != x: - data[x] = data.pop('xs', []) - if 'ys' in data and 'ys' != y: - data[y] = data.pop('ys', []) - return dict(data=data) + data = dict(plot.handles['source'].data) + for stream in self.streams: + stream.update(data=data) class BoxEditCallback(CDSCallback):