Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backport PR #3373 on branch v4.1.x (data-menu: exclude subset on orientation layer in visibility logic) #3378

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,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 @@ -1614,7 +1614,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 @@ -1768,7 +1770,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
Loading