Skip to content

Commit 1b87c91

Browse files
committed
Fixed bokeh live plotting
1 parent c0d5ff5 commit 1b87c91

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

holoviews/plotting/bokeh/renderer.py

+1
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ def figure_data(self, plot, fmt='html', **kwargs):
7575
comms_target = str(uuid.uuid4())
7676
doc.last_comms_target = comms_target
7777
div = notebook_div(plot.state, comms_target)
78+
plot.document = doc
7879
return div
7980
else:
8081
return notebook_div(plot.state)

holoviews/plotting/bokeh/widgets.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,12 @@ def _plot_figure(self, idx, fig_format='json'):
4646
if self.embed or fig_format == 'html' or bokeh_lt_011:
4747
return self.renderer.html(self.plot, fig_format)
4848
else:
49-
doc = state.document
49+
doc = self.plot.document
5050

5151
if hasattr(doc, 'last_comms_handle'):
5252
handle = doc.last_comms_handle
5353
else:
54+
doc.add_root(self.plot.state)
5455
handle = _CommsHandle(get_comms(doc.last_comms_target),
5556
doc, doc.to_json())
5657
doc.last_comms_handle = handle
@@ -61,6 +62,7 @@ def _plot_figure(self, idx, fig_format='json'):
6162
else:
6263
msg = Document._compute_patch_between_json(handle.json, to_json)
6364
handle._json = to_json
65+
print msg
6466
handle.comms.send(json.dumps(msg))
6567

6668

0 commit comments

Comments
 (0)