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

Callback fixes #898

Merged
merged 2 commits into from
Oct 5, 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
3 changes: 3 additions & 0 deletions holoviews/plotting/bokeh/callbacks.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,9 @@ class Selection1DCallback(Callback):

handles = ['source']

def _process_msg(self, msg):
return {'index': [int(v) for v in msg['index']]}


callbacks = Stream._callbacks['bokeh']

Expand Down
5 changes: 3 additions & 2 deletions holoviews/plotting/bokeh/element.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,8 @@ def _construct_callbacks(self):
callbacks = {(registry[type(stream)], stream) for stream in streams
if type(stream) in registry and streams}
cbs = []
for cb, group in groupby(sorted(callbacks), lambda x: x[0]):
sorted_cbs = sorted(callbacks, key=lambda x: id(x[0]))
for cb, group in groupby(sorted_cbs, lambda x: x[0]):
cb_streams = [s for _, s in group]
cbs.append(cb(self, cb_streams, source))
return cbs
Expand Down Expand Up @@ -978,7 +979,7 @@ def _process_legend(self):
plot.add_layout(plot.legend[0], leg_opts['pos'])


def _init_tools(self, element):
def _init_tools(self, element, callbacks=[]):
"""
Processes the list of tools to be supplied to the plot.
"""
Expand Down