Skip to content

Commit

Permalink
Added comments to clarify Comms protocol and callback message sanitiz…
Browse files Browse the repository at this point in the history
…ation
  • Loading branch information
philippjfr committed Jan 5, 2017
1 parent 6556637 commit e447324
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions holoviews/plotting/bokeh/callbacks.py
Expand Up @@ -188,6 +188,10 @@ def initialize(self):


def on_msg(self, msg):
# For each stream check whether plot state is meant for it
# by checking that the IDs match the IDs of the stream's plot
# handles, dispatch only the part of the message meant for
# a particular stream
for stream in self.streams:
ids = self.stream_handles[stream]
sanitized_msg = {}
Expand Down Expand Up @@ -230,6 +234,9 @@ def set_customjs(self, handle):
attributes = attributes_js(self.attributes, handles)
code = 'var data = {};\n' + attributes + self.code + self_callback

# Gather the ids of the plotting handles attached to this callback
# This allows checking that a stream is not given the state
# of a plotting handle it wasn't attached to
stream_handle_ids = defaultdict(list)
for stream in self.streams:
for h in self.handles:
Expand Down

0 comments on commit e447324

Please sign in to comment.