Skip to content

Commit

Permalink
data-menu: exclude subset on orientation layer in visibility logic (s…
Browse files Browse the repository at this point in the history
…pacetelescope#3373)

* stylized label: exclude subset on wcs-only layer
* fallback when zorder is None
  • Loading branch information
kecnry authored and rosteen committed Jan 6, 2025
1 parent 1f0ef6c commit 25f6e97
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ Cubeviz
Imviz
^^^^^

- Spatial subsets no longer show as having mixed visibility (in the legend and plot options tab) when aligned by WCS. [#3373]

Mosviz
^^^^^^

Expand Down
9 changes: 7 additions & 2 deletions jdaviz/core/template_mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -1625,7 +1625,9 @@ def _layer_to_dict(self, layer_label):
linewidths = []
for viewer in self.viewer_objs:
for layer in viewer.layers:
if layer.layer.label == layer_label and is_not_wcs_only(layer.layer):
if (layer.layer.label == layer_label
and is_not_wcs_only(layer.layer)
and is_not_wcs_only(layer.layer.data)):
if is_subset is None:
is_subset = ((hasattr(layer, 'state') and hasattr(layer.state, 'subset_state')) or # noqa
(hasattr(layer, 'layer') and hasattr(layer.layer, 'subset_state'))) # noqa
Expand Down Expand Up @@ -1787,7 +1789,10 @@ def _sort_by_icon(items_dict):

def _sort_by_zorder(items_dict):
# NOTE: this works best if subscribed to a single viewer
return -1 * items_dict.get('zorder', 0)
zorder = items_dict.get('zorder', 0)
if zorder is None:
zorder = 0
return -1 * zorder

if self.sort_by == 'zorder':
layer_items.sort(key=_sort_by_zorder)
Expand Down

0 comments on commit 25f6e97

Please sign in to comment.