Skip to content

Commit

Permalink
Fix issues with linked selections on tables (#4758)
Browse files Browse the repository at this point in the history
  • Loading branch information
philippjfr committed Dec 15, 2020
1 parent 8ca2817 commit 4f4c1c2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion holoviews/plotting/bokeh/selection.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def _build_selection(self, el, exprs, **kwargs):
opts['selected'] = list(np.where(mask)[0])
return el.opts(clone=True, backend='bokeh', **opts)

def build_selection(self, selection_streams, hvobj, operations, region_stream=None):
def build_selection(self, selection_streams, hvobj, operations, region_stream=None, cache={}):
sel_streams = [selection_streams.exprs_stream]
hvobj = hvobj.apply(self._build_selection, streams=sel_streams, per_element=True)
for op in operations:
Expand Down
7 changes: 5 additions & 2 deletions holoviews/selection.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ def _register(self, hvobj):
Register an Element or DynamicMap that may be capable of generating
selection expressions in response to user interaction events
"""
from .element import Table

# Create stream that produces element that displays region of selection
selection_expr_seq = SelectionExprSequence(
hvobj, mode=self.selection_mode, include_region=self.show_regions,
Expand All @@ -122,8 +124,9 @@ def clear_stream_history(resetting, stream=selection_expr_seq.history_stream):
stream.clear_history()
stream.event()

mode_stream = SelectMode(source=hvobj)
mode_stream.param.watch(self._update_mode, 'mode')
if not isinstance(hvobj, Table):
mode_stream = SelectMode(source=hvobj)
mode_stream.param.watch(self._update_mode, 'mode')

self._plot_reset_streams[hvobj].param.watch(
clear_stream_history, ['resetting']
Expand Down

0 comments on commit 4f4c1c2

Please sign in to comment.