Skip to content

Commit

Permalink
fix plot options multi->single select (spacetelescope#2505)
Browse files Browse the repository at this point in the history
* previously the traitlets could get updated out of order - its more reliable here to just check the type rather than the switch itself
  • Loading branch information
kecnry authored Oct 11, 2023
1 parent 30685d0 commit 14b61e5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@ Bug Fixes
- Deleting a subset while actively editing it now deselects the subset tool,
preventing the appearance of "ghost" subsets. [#2497]

- Fixes a bug in plot options where switching from multi to single-select mode
failed to properly update the selection. [#2505]

Cubeviz
^^^^^^^

Expand Down
4 changes: 3 additions & 1 deletion jdaviz/configs/default/plugins/plot_options/plot_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -571,7 +571,9 @@ def _update_stretch_histogram(self, msg={}):
for attr in ('x_min', 'x_max', 'y_min', 'y_max'):
vs.add_callback(attr, self._update_stretch_histogram)
if isinstance(msg, dict) and msg.get('name') == 'viewer_selected':
viewer_label_old = msg.get('old')[0] if self.multiselect else msg.get('old')
viewer_label_old = msg.get('old')
if isinstance(viewer_label_old, list):
viewer_label_old = viewer_label_old[0]
if len(viewer_label_old):
vs_old = self.app.get_viewer(viewer_label_old).state
for attr in ('x_min', 'x_max', 'y_min', 'y_max'):
Expand Down

0 comments on commit 14b61e5

Please sign in to comment.