From de00973629a0b38c33576aa51dd40d773e1e675c Mon Sep 17 00:00:00 2001 From: Kyle Conroy Date: Thu, 31 Oct 2024 07:59:59 -0400 Subject: [PATCH] Framework for legend data menu (#3254) * API access to set/toggle layer visibility * basic list of togglable layers in data menu UI * remove plot options setting for toggling legend * hide data menu behind developer flag * wireframe for upcoming follow-ups * transition when opening menu * show subset icon in menu * temporary icon labeling of sublayers * add to existing changelog entry * add test coverage --- CHANGES.rst | 2 +- jdaviz/app.py | 2 +- .../components/layer_viewer_icon_stylized.vue | 7 +- jdaviz/components/plugin_switch.vue | 4 +- jdaviz/components/subset_icon.vue | 23 ++ jdaviz/components/tooltip.vue | 2 +- .../default/plugins/data_menu/data_menu.py | 106 ++++++- .../default/plugins/data_menu/data_menu.vue | 300 +++++++++++++++--- .../plugins/plot_options/plot_options.py | 13 - .../plugins/plot_options/plot_options.vue | 21 -- .../configs/default/tests/test_data_menu.py | 68 ++++ jdaviz/container.vue | 2 +- 12 files changed, 454 insertions(+), 96 deletions(-) create mode 100644 jdaviz/components/subset_icon.vue create mode 100644 jdaviz/configs/default/tests/test_data_menu.py diff --git a/CHANGES.rst b/CHANGES.rst index a07f2bd8f3..2f14f9666a 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -4,7 +4,7 @@ New Features ------------ -* New design for viewer legend. [#3220] +* New design for viewer legend. [#3220, #3254] Cubeviz ^^^^^^^ diff --git a/jdaviz/app.py b/jdaviz/app.py index cc1bbe7b57..5576d84202 100644 --- a/jdaviz/app.py +++ b/jdaviz/app.py @@ -132,6 +132,7 @@ def to_unit(self, data, cid, values, original_units, target_units): 'j-number-uncertainty': 'components/number_uncertainty.vue', 'j-plugin-popout': 'components/plugin_popout.vue', 'j-multiselect-toggle': 'components/multiselect_toggle.vue', + 'j-subset-icon': 'components/subset_icon.vue', 'plugin-previews-temp-disabled': 'components/plugin_previews_temp_disabled.vue', # noqa 'plugin-table': 'components/plugin_table.vue', 'plugin-dataset-select': 'components/plugin_dataset_select.vue', @@ -206,7 +207,6 @@ class ApplicationState(State): 'tray': True, 'tab_headers': True, }, - 'viewer_labels': True, 'dense_toolbar': True, 'server_is_remote': False, # sets some defaults, should be set before loading the config 'context': { diff --git a/jdaviz/components/layer_viewer_icon_stylized.vue b/jdaviz/components/layer_viewer_icon_stylized.vue index fddef4e149..cfc4123ad1 100644 --- a/jdaviz/components/layer_viewer_icon_stylized.vue +++ b/jdaviz/components/layer_viewer_icon_stylized.vue @@ -1,5 +1,5 @@