From 2e9233d6fe3201e40d7c0f5508215542f63134f8 Mon Sep 17 00:00:00 2001 From: Kyle Conroy Date: Mon, 25 Nov 2024 09:02:52 -0500 Subject: [PATCH] custom API icons Co-authored-by: Jennifer Kotler --- jdaviz/app.py | 4 +- jdaviz/app.vue | 2 +- jdaviz/components/data_menu_add.vue | 3 +- jdaviz/components/hover_api_hint.vue | 32 ++--- .../default/plugins/data_menu/data_menu.vue | 2 + jdaviz/data/icons/api.svg | 105 ++++++++++++++ jdaviz/data/icons/api_lock.svg | 136 ++++++++++++++++++ 7 files changed, 262 insertions(+), 22 deletions(-) create mode 100644 jdaviz/data/icons/api.svg create mode 100644 jdaviz/data/icons/api_lock.svg diff --git a/jdaviz/app.py b/jdaviz/app.py index 526a8e6a1f..7fd931a7f4 100644 --- a/jdaviz/app.py +++ b/jdaviz/app.py @@ -232,7 +232,9 @@ class ApplicationState(State): 'radialtocheck': read_icon(os.path.join(ICON_DIR, 'radialtocheck.svg'), 'svg+xml'), 'checktoradial': read_icon(os.path.join(ICON_DIR, 'checktoradial.svg'), 'svg+xml'), 'nuer': read_icon(os.path.join(ICON_DIR, 'right-east.svg'), 'svg+xml'), - 'nuel': read_icon(os.path.join(ICON_DIR, 'left-east.svg'), 'svg+xml') + 'nuel': read_icon(os.path.join(ICON_DIR, 'left-east.svg'), 'svg+xml'), + 'api': read_icon(os.path.join(ICON_DIR, 'api.svg'), 'svg+xml'), + 'api-lock': read_icon(os.path.join(ICON_DIR, 'api_lock.svg'), 'svg+xml'), }, docstring="Custom application icons") viewer_icons = DictCallbackProperty({}, docstring="Indexed icons (numbers) for viewers across the app") # noqa diff --git a/jdaviz/app.vue b/jdaviz/app.vue index 9c7152f65c..3a529d5123 100644 --- a/jdaviz/app.vue +++ b/jdaviz/app.vue @@ -57,7 +57,7 @@ - mdi-code-tags + diff --git a/jdaviz/components/data_menu_add.vue b/jdaviz/components/data_menu_add.vue index 2d41844281..21612b869e 100644 --- a/jdaviz/components/data_menu_add.vue +++ b/jdaviz/components/data_menu_add.vue @@ -66,6 +66,7 @@ v-if="api_hints_enabled" :hover_api_hint.sync="hover_api_hint" :lock_hover_api_hint.sync="lock_hover_api_hint" + :icons="icons" /> @@ -80,6 +81,6 @@ module.exports = { lock_hover_api_hint: false, } }, - props: ['dataset_items', 'subset_tools', 'loaded_n_data', 'api_hints_enabled'], + props: ['dataset_items', 'subset_tools', 'loaded_n_data', 'api_hints_enabled', 'icons'], }; \ No newline at end of file diff --git a/jdaviz/components/hover_api_hint.vue b/jdaviz/components/hover_api_hint.vue index 59fba111d8..5bf9e8a0a0 100644 --- a/jdaviz/components/hover_api_hint.vue +++ b/jdaviz/components/hover_api_hint.vue @@ -6,28 +6,22 @@ {{ hover_api_hint }} - + - - - - mdi-code-tags - - - + + @@ -35,6 +29,6 @@ \ No newline at end of file diff --git a/jdaviz/configs/default/plugins/data_menu/data_menu.vue b/jdaviz/configs/default/plugins/data_menu/data_menu.vue index 686e1164d5..762efce4b5 100644 --- a/jdaviz/configs/default/plugins/data_menu/data_menu.vue +++ b/jdaviz/configs/default/plugins/data_menu/data_menu.vue @@ -141,6 +141,7 @@ :subset_tools="subset_tools" :loaded_n_data="loaded_n_data" :api_hints_enabled="api_hints_enabled" + :icons="icons" @add-data="(data_label) => {add_data_to_viewer({data_label: data_label})}" @create-subset="(subset_type) => {create_subset({subset_type: subset_type}); data_menu_open = false}" > @@ -208,6 +209,7 @@ v-if="api_hints_enabled" :hover_api_hint.sync="hover_api_hint" :lock_hover_api_hint.sync="lock_hover_api_hint" + :icons="icons" /> diff --git a/jdaviz/data/icons/api.svg b/jdaviz/data/icons/api.svg new file mode 100644 index 0000000000..4955459540 --- /dev/null +++ b/jdaviz/data/icons/api.svg @@ -0,0 +1,105 @@ + + + + + + + + + + + + + + + <API> + <API> + API + <api> + api + + + + + + + + + api + api + api + + + api + + + + + + api + API + + + + + + api + api + API + + + api + + + + + \ No newline at end of file diff --git a/jdaviz/data/icons/api_lock.svg b/jdaviz/data/icons/api_lock.svg new file mode 100644 index 0000000000..da8fba4533 --- /dev/null +++ b/jdaviz/data/icons/api_lock.svg @@ -0,0 +1,136 @@ + + + + + + + + + + + + + + + <API> + <API> + API + <api> + api + + + + + + + + + api + api + api + + + api + + + + + + api + API + api + api + API + + + + + + + + + api + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file