From 91028648d436d6c4b3b9d51858d8be6dfc9bf513 Mon Sep 17 00:00:00 2001 From: Kyle Conroy Date: Tue, 2 Jan 2024 16:29:05 -0500 Subject: [PATCH 1/2] show spinner while stretch histogram data updating --- CHANGES.rst | 2 ++ .../plugins/plot_options/plot_options.py | 2 ++ .../plugins/plot_options/plot_options.vue | 36 ++++++++++++++----- 3 files changed, 31 insertions(+), 9 deletions(-) diff --git a/CHANGES.rst b/CHANGES.rst index e81b162f67..6cd1ca6416 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -5,6 +5,8 @@ New Features ------------ - Stretch bounds tool now enables dynamic adjustment of spline knots. [#2545, #2623] +- Stretch histogram shows a spinner when the histogram data is updating. [#2644] + Cubeviz ^^^^^^^ - Calculated moments can now be output in velocity units. [#2584, #2588] diff --git a/jdaviz/configs/default/plugins/plot_options/plot_options.py b/jdaviz/configs/default/plugins/plot_options/plot_options.py index 9b88881259..d387e832ce 100644 --- a/jdaviz/configs/default/plugins/plot_options/plot_options.py +++ b/jdaviz/configs/default/plugins/plot_options/plot_options.py @@ -334,6 +334,7 @@ class PlotOptions(PluginTemplateMixin): cmap_samples = Dict().tag(sync=True) swatches_palette = List().tag(sync=True) apply_RGB_presets_spinner = Bool(False).tag(sync=True) + stretch_hist_spinner = Bool(False).tag(sync=True) def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) @@ -713,6 +714,7 @@ def _update_stretch_hist_sync(self, msg={}): @observe('is_active', 'layer_selected', 'viewer_selected', 'stretch_hist_zoom_limits') + @with_spinner('stretch_hist_spinner') @skip_if_no_updates_since_last_active() def _update_stretch_histogram(self, msg={}): if not hasattr(self, 'viewer'): # pragma: no cover diff --git a/jdaviz/configs/default/plugins/plot_options/plot_options.vue b/jdaviz/configs/default/plugins/plot_options/plot_options.vue index d03d3d3ac1..a94d73d1b4 100644 --- a/jdaviz/configs/default/plugins/plot_options/plot_options.vue +++ b/jdaviz/configs/default/plugins/plot_options/plot_options.vue @@ -465,15 +465,33 @@
- - - +
+
+ + + +
+
+ +
From 4362f113767647e81232b718955543380b5e54d1 Mon Sep 17 00:00:00 2001 From: Kyle Conroy Date: Wed, 3 Jan 2024 15:56:13 -0500 Subject: [PATCH 2/2] don't do spinner when method skipped --- jdaviz/configs/default/plugins/plot_options/plot_options.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jdaviz/configs/default/plugins/plot_options/plot_options.py b/jdaviz/configs/default/plugins/plot_options/plot_options.py index d387e832ce..75bf5c9c9c 100644 --- a/jdaviz/configs/default/plugins/plot_options/plot_options.py +++ b/jdaviz/configs/default/plugins/plot_options/plot_options.py @@ -714,8 +714,8 @@ def _update_stretch_hist_sync(self, msg={}): @observe('is_active', 'layer_selected', 'viewer_selected', 'stretch_hist_zoom_limits') - @with_spinner('stretch_hist_spinner') @skip_if_no_updates_since_last_active() + @with_spinner('stretch_hist_spinner') def _update_stretch_histogram(self, msg={}): if not hasattr(self, 'viewer'): # pragma: no cover # plugin hasn't been fully initialized yet