Skip to content

Commit

Permalink
Fixed bokeh live plotting
Browse files Browse the repository at this point in the history
  • Loading branch information
philippjfr committed Feb 8, 2016
1 parent c0d5ff5 commit 1b87c91
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions holoviews/plotting/bokeh/renderer.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ def figure_data(self, plot, fmt='html', **kwargs):
comms_target = str(uuid.uuid4())
doc.last_comms_target = comms_target
div = notebook_div(plot.state, comms_target)
plot.document = doc
return div
else:
return notebook_div(plot.state)
Expand Down
4 changes: 3 additions & 1 deletion holoviews/plotting/bokeh/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,12 @@ def _plot_figure(self, idx, fig_format='json'):
if self.embed or fig_format == 'html' or bokeh_lt_011:
return self.renderer.html(self.plot, fig_format)
else:
doc = state.document
doc = self.plot.document

if hasattr(doc, 'last_comms_handle'):
handle = doc.last_comms_handle
else:
doc.add_root(self.plot.state)
handle = _CommsHandle(get_comms(doc.last_comms_target),
doc, doc.to_json())
doc.last_comms_handle = handle
Expand All @@ -61,6 +62,7 @@ def _plot_figure(self, idx, fig_format='json'):
else:
msg = Document._compute_patch_between_json(handle.json, to_json)
handle._json = to_json
print msg
handle.comms.send(json.dumps(msg))


Expand Down

0 comments on commit 1b87c91

Please sign in to comment.