Skip to content

Commit

Permalink
Ensure PolyDraw data has consistent keys on initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
philippjfr committed May 7, 2018
1 parent 9cdad85 commit c5a64db
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions holoviews/plotting/bokeh/callbacks.py
Expand Up @@ -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):
Expand Down

0 comments on commit c5a64db

Please sign in to comment.