Skip to content

Commit

Permalink
re-introduce subset-type icons
Browse files Browse the repository at this point in the history
* still assigned late or incorrectly at times - but using same detection logic as previously
  • Loading branch information
kecnry committed Oct 16, 2024
1 parent 5b77543 commit 876449f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
10 changes: 8 additions & 2 deletions jdaviz/configs/default/plugins/data_menu/data_menu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,14 @@
/>
</span>
<span class="invert-if-dark" style="margin-left: 30px; margin-right: 36px; line-height: 28px">
<v-icon v-if="item.prefix_icon" dense>
{{item.prefix_icon}}
<v-icon v-if="item.subset_type == 'spatial'" dense>
mdi-chart-scatter-plot
</v-icon>
<v-icon v-else-if="item.subset_type == 'spectral'" dense>
mdi-chart-bell-curve
</v-icon>
<v-icon v-else-if="item.subset_type == 'temporal'" dense>
mdi-chart-line
</v-icon>
{{item.label}}
</span>
Expand Down
4 changes: 4 additions & 0 deletions jdaviz/core/template_mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = []
Expand All @@ -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')):
Expand All @@ -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',
Expand Down

0 comments on commit 876449f

Please sign in to comment.