diff --git a/CHANGES.rst b/CHANGES.rst index eb9291783f..f29a341bdd 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -4,7 +4,7 @@ New Features ------------ -* New design for viewer legend and data-menu. [#3220, #3254, #3263, #3264, #3271, #3272] +* New design for viewer legend and data-menu. [#3220, #3254, #3263, #3264, #3271, #3272, #3274] Cubeviz ^^^^^^^ diff --git a/jdaviz/app.py b/jdaviz/app.py index 4f82b93b69..4e5776f4b9 100644 --- a/jdaviz/app.py +++ b/jdaviz/app.py @@ -156,7 +156,8 @@ def to_unit(self, data, cid, values, original_units, target_units): 'glue-state-sync-wrapper': 'components/glue_state_sync_wrapper.vue', 'data-menu-add': 'components/data_menu_add.vue', 'data-menu-remove': 'components/data_menu_remove.vue', - 'data-menu-subset-edit': 'components/data_menu_subset_edit.vue'} + 'data-menu-subset-edit': 'components/data_menu_subset_edit.vue', + 'hover-api-hint': 'components/hover_api_hint.vue'} _verbosity_levels = ('debug', 'info', 'warning', 'error') @@ -186,6 +187,8 @@ class ApplicationState(State): True, docstring="State of the plugins drawer.") show_toolbar_buttons = CallbackProperty( True, docstring="Whether to show app-level toolbar buttons (left of sidebar menu button).") + show_api_hints = CallbackProperty( + False, docstring="Whether to show API hints.") logger_overlay = CallbackProperty( False, docstring="State of the logger history overlay.") diff --git a/jdaviz/app.vue b/jdaviz/app.vue index 5f67b89839..0d465badcc 100644 --- a/jdaviz/app.vue +++ b/jdaviz/app.vue @@ -55,6 +55,11 @@ mdi-help-box + + + mdi-code-tags + + mdi-message-reply-text diff --git a/jdaviz/components/data_menu_add.vue b/jdaviz/components/data_menu_add.vue index 7e5af8b157..2d41844281 100644 --- a/jdaviz/components/data_menu_add.vue +++ b/jdaviz/components/data_menu_add.vue @@ -20,7 +20,7 @@ - + Load Data - {{ data.label }} + {{ api_hints_enabled ? + 'dm.add_data(\''+data.label+'\')' + : + data.label + }} @@ -44,10 +49,12 @@ @@ -55,6 +62,11 @@ + @@ -62,6 +74,12 @@ \ No newline at end of file diff --git a/jdaviz/components/data_menu_remove.vue b/jdaviz/components/data_menu_remove.vue index 8a8e4d24b6..2690a1e2ee 100644 --- a/jdaviz/components/data_menu_remove.vue +++ b/jdaviz/components/data_menu_remove.vue @@ -27,9 +27,14 @@ > - Remove from viewer + {{ api_hints_enabled ? + 'dm.remove_from_viewer()' + : + 'Remove from viewer' + }} @@ -42,10 +47,15 @@ > - Remove from app + {{ api_hints_enabled ? + 'dm.remove_from_app()' + : + 'Remove from app' + }} @@ -56,6 +66,6 @@ \ No newline at end of file diff --git a/jdaviz/components/data_menu_subset_edit.vue b/jdaviz/components/data_menu_subset_edit.vue index f93d05aa25..58e6cd5ed2 100644 --- a/jdaviz/components/data_menu_subset_edit.vue +++ b/jdaviz/components/data_menu_subset_edit.vue @@ -58,12 +58,14 @@ @@ -71,7 +73,11 @@ - + @@ -81,9 +87,11 @@ module.exports = { data: function () { return { hover_mode: '', + hover_api_hint: '', + lock_hover_api_hint: false, } }, - props: ['subset_selected', 'subset_edit_enabled', 'subset_edit_tooltip', 'selected_n_subsets', 'subset_edit_modes', 'subset_tools'], + props: ['subset_selected', 'subset_edit_enabled', 'subset_edit_tooltip', 'selected_n_subsets', 'subset_edit_modes', 'subset_tools', 'api_hints_enabled'], }; diff --git a/jdaviz/components/hover_api_hint.vue b/jdaviz/components/hover_api_hint.vue new file mode 100644 index 0000000000..59fba111d8 --- /dev/null +++ b/jdaviz/components/hover_api_hint.vue @@ -0,0 +1,40 @@ + + + \ No newline at end of file diff --git a/jdaviz/components/plugin_switch.vue b/jdaviz/components/plugin_switch.vue index bd2d180509..a23ed9fb7e 100644 --- a/jdaviz/components/plugin_switch.vue +++ b/jdaviz/components/plugin_switch.vue @@ -1,6 +1,11 @@