Skip to content

Commit

Permalink
single pixel to reset subset selection
Browse files Browse the repository at this point in the history
without having to inherit from InteractCheckableTool or BqplotSelectionTool since those would require self.interact
  • Loading branch information
kecnry committed Oct 3, 2022
1 parent 761b7d1 commit aca911c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions jdaviz/core/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,12 @@ class SinglePixelRegion(CheckableTool):
tool_tip = 'Define a single-pixel spatial region of interest'

def activate(self):
# This is copied from glue-jupyter's BqplotSelectionTool (but we don't inherit
# from that because that in turn inherits from InteractCheckableTool which requires
# setting self.interact)
if self.viewer.session.application.get_setting('new_subset_on_selection_tool_change'):
self.viewer.session.edit_subset_mode.edit_subset = None

self.viewer.add_event_callback(self.on_mouse_event, events=['click'])

def deactivate(self):
Expand Down

0 comments on commit aca911c

Please sign in to comment.