From 876449f93115129cbb97bef81f33dbbd0284468a Mon Sep 17 00:00:00 2001 From: Kyle Conroy Date: Wed, 16 Oct 2024 13:24:49 -0400 Subject: [PATCH] re-introduce subset-type icons * still assigned late or incorrectly at times - but using same detection logic as previously --- jdaviz/configs/default/plugins/data_menu/data_menu.vue | 10 ++++++++-- jdaviz/core/template_mixin.py | 4 ++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/jdaviz/configs/default/plugins/data_menu/data_menu.vue b/jdaviz/configs/default/plugins/data_menu/data_menu.vue index ddbc06c077..6d751b2f6d 100644 --- a/jdaviz/configs/default/plugins/data_menu/data_menu.vue +++ b/jdaviz/configs/default/plugins/data_menu/data_menu.vue @@ -33,8 +33,14 @@ /> - - {{item.prefix_icon}} + + mdi-chart-scatter-plot + + + mdi-chart-bell-curve + + + mdi-chart-line {{item.label}} diff --git a/jdaviz/core/template_mixin.py b/jdaviz/core/template_mixin.py index 3d97945672..3e22589e8e 100644 --- a/jdaviz/core/template_mixin.py +++ b/jdaviz/core/template_mixin.py @@ -1531,6 +1531,7 @@ def not_spatial_subset_in_profile_viewer(lyr): def _layer_to_dict(self, layer_label): is_subset = None + subset_type = None colors = [] visibilities = [] linewidths = [] @@ -1540,6 +1541,8 @@ def _layer_to_dict(self, layer_label): 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 + if is_subset: + subset_type = get_subset_type(layer.layer) if (getattr(viewer.state, 'color_mode', None) == 'Colormaps' and hasattr(layer.state, 'cmap')): @@ -1553,6 +1556,7 @@ def _layer_to_dict(self, layer_label): return {"label": layer_label, "is_subset": is_subset, + "subset_type": subset_type, "icon": self.app.state.layer_icons.get(layer_label), "visible": visibilities[0] if len(list(set(visibilities))) == 1 else 'mixed', "linewidth": linewidths[0] if len(list(set(linewidths))) == 1 else 'mixed',