+
{{ description }}
-
-
- {$emit('update:api_hints_enabled', !api_hints_enabled)}"
- >
- mdi-code-tags
-
-
-
diff --git a/jdaviz/configs/default/plugins/data_menu/data_menu.py b/jdaviz/configs/default/plugins/data_menu/data_menu.py
index 2b062e4a2b..cfdd8591e6 100644
--- a/jdaviz/configs/default/plugins/data_menu/data_menu.py
+++ b/jdaviz/configs/default/plugins/data_menu/data_menu.py
@@ -42,6 +42,7 @@ class DataMenu(TemplateMixin, LayerSelectMixin, DatasetSelectMixin):
Only the following attributes and methods are available through the
:ref:`public API
`:
+ * :meth:`open_menu`
* ``layer`` (:class:`~jdaviz.core.template_mixin.LayerSelect`):
actively selected layer(s)
* ``orientation`` (:class:`~jdaviz.core.template_mixin.LayerSelect`):
@@ -57,6 +58,8 @@ class DataMenu(TemplateMixin, LayerSelectMixin, DatasetSelectMixin):
"""
template_file = __file__, "data_menu.vue"
+ force_open_menu = Bool(False).tag(sync=True)
+
viewer_id = Unicode().tag(sync=True)
viewer_reference = Unicode().tag(sync=True)
@@ -146,13 +149,19 @@ def data_not_in_viewer(data):
@property
def user_api(self):
- expose = ['layer', 'set_layer_visibility', 'toggle_layer_visibility',
+ expose = ['open_menu', 'layer', 'set_layer_visibility', 'toggle_layer_visibility',
'create_subset', 'modify_subset', 'add_data', 'view_info',
'remove_from_viewer', 'remove_from_app']
if self.app.config == 'imviz':
expose += ['orientation']
return UserApiWrapper(self, expose=expose)
+ def open_menu(self):
+ """
+ Open all instances of the data menu.
+ """
+ self.force_open_menu = True
+
@property
def existing_subset_labels(self):
return [sg.label for sg in self.app.data_collection.subset_groups]
diff --git a/jdaviz/configs/default/plugins/data_menu/data_menu.vue b/jdaviz/configs/default/plugins/data_menu/data_menu.vue
index 24f4aa8c61..0e8880592d 100644
--- a/jdaviz/configs/default/plugins/data_menu/data_menu.vue
+++ b/jdaviz/configs/default/plugins/data_menu/data_menu.vue
@@ -10,7 +10,7 @@
:close-on-content-click="false"
v-model="data_menu_open">
-
+
+
+
+
+ dm = {{ config }}.viewers['{{viewer_id}}'].data_menu
+
+
+
+
+
+ dm.layer = {{ layer_selected }}
+
+
-
+
-
+
{set_layer_visibility({layer: item.label, value: value})}"
- :api_hint='"dm.set_layer_visibility("+viewer_id+", "'
+ @mouseover = "() => {hover_api_hint = 'dm.set_layer_visibility(\'' + item.label + '\', '+boolToString(item.visible)+')'}"
+ @mouseleave = "() => {if (!lock_hover_api_hint) {hover_api_hint = ''}}"
:api_hints_enabled="false"
:use_eye_icon="true"
/>
@@ -178,6 +200,11 @@
+