Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed bokeh Callbacks #880

Merged
merged 1 commit into from
Sep 23, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 3 additions & 10 deletions holoviews/plotting/bokeh/callbacks.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,16 +165,9 @@ def serialize(self, models):
"""
Serializes any Bokeh plot objects passed to it as a list.
"""
documents = {plot.document for plot in self.plots}
for doc in documents:
if hasattr(doc, 'last_comms_handle'):
handle = doc.last_comms_handle
else:
handle = _CommsHandle(get_comms(doc.last_comms_target),
doc, None)
doc.last_comms_handle = handle
msg = compute_static_patch(doc, models)
handle.comms.send(serialize_json(msg))
for plot in self.plots:
msg = compute_static_patch(plot.document, models)
plot.comm.send(serialize_json(msg))
return 'Complete'


Expand Down
2 changes: 2 additions & 0 deletions holoviews/plotting/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -768,6 +768,7 @@ def __init__(self, overlay, ranges=None, batched=True, **params):
self.hmap = Compositor.collapse(self.hmap, None, mode='data')
self.hmap = self._apply_compositor(self.hmap, ranges, self.keys)
self.subplots = self._create_subplots(ranges)
self.traverse(lambda x: setattr(x, 'comm', self.comm))


def _apply_compositor(self, holomap, ranges=None, keys=None, dimensions=None):
Expand Down Expand Up @@ -924,6 +925,7 @@ def __init__(self, layout, keys=None, dimensions=None, **params):
**params)
if top_level:
self.comm = self.init_comm(layout)
self.traverse(lambda x: setattr(x, 'comm', self.comm))
self.streams = [s for streams in layout.traverse(lambda x: x.streams,
[DynamicMap])
for s in streams]
Expand Down