Skip to content

Commit

Permalink
Merge pull request #419 from dhomeier/selected-once
Browse files Browse the repository at this point in the history
Set Bqplot*Modes to observe only one `selected` state in BrushSelector
  • Loading branch information
astrofrog authored Feb 27, 2024
2 parents 090f214 + 493fada commit c108da0
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions glue_jupyter/bqplot/common/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,7 @@ def __init__(self, viewer, roi=None, finalize_callback=None, **kwargs):
self.update_from_roi(roi)

self.interact.observe(self.update_selection, "brushing")
self.interact.observe(self.on_selection_change, "selected_x")
self.interact.observe(self.on_selection_change, "selected_y")
self.interact.observe(self.on_selection_change, "selected")
self.finalize_callback = finalize_callback

def update_selection(self, *args):
Expand Down Expand Up @@ -221,8 +220,7 @@ def __init__(self, viewer, roi=None, finalize_callback=None, **kwargs):

self._lasso = False
self.interact.observe(self.update_selection, "brushing")
self.interact.observe(self.on_selection_change, "selected_x")
self.interact.observe(self.on_selection_change, "selected_y")
self.interact.observe(self.on_selection_change, "selected")
self.finalize_callback = finalize_callback

def update_selection(self, *args):
Expand Down Expand Up @@ -380,8 +378,7 @@ def __init__(self, viewer, roi=None, finalize_callback=None, **kwargs):
self.update_from_roi(roi)

self.interact.observe(self.update_selection, "brushing")
self.interact.observe(self.on_selection_change, "selected_x")
self.interact.observe(self.on_selection_change, "selected_y")
self.interact.observe(self.on_selection_change, "selected")
self.finalize_callback = finalize_callback

def update_selection(self, *args):
Expand Down Expand Up @@ -483,8 +480,7 @@ def __init__(self, viewer, roi=None, finalize_callback=None, **kwargs):
self.update_from_roi(roi)

self.interact.observe(self.update_selection, "brushing")
self.interact.observe(self.on_selection_change, "selected_x")
self.interact.observe(self.on_selection_change, "selected_y")
self.interact.observe(self.on_selection_change, "selected")
self.finalize_callback = finalize_callback


Expand Down

0 comments on commit c108da0

Please sign in to comment.