Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

spinner while stretch histogram data updating #2644

Merged
merged 2 commits into from
Jan 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
2 changes: 2 additions & 0 deletions jdaviz/configs/default/plugins/plot_options/plot_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -714,6 +715,7 @@ def _update_stretch_hist_sync(self, msg={}):
@observe('is_active', 'layer_selected', 'viewer_selected',
'stretch_hist_zoom_limits')
@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
Expand Down
36 changes: 27 additions & 9 deletions jdaviz/configs/default/plugins/plot_options/plot_options.vue
Original file line number Diff line number Diff line change
Expand Up @@ -465,15 +465,33 @@
</glue-state-sync-wrapper>

<div v-if="stretch_function_sync.in_subscribed_states && (!layer_multiselect || layer_selected.length <= 1)">
<glue-state-sync-wrapper
:sync="stretch_hist_sync"
:multiselect="layer_multiselect"
@unmix-state="unmix_state(['stretch_function', 'stretch_params',
'stretch_vmin', 'stretch_vmax',
'image_color_mode', 'image_color', 'image_colormap'])"
>
<jupyter-widget :widget="stretch_histogram_widget"/>
</glue-state-sync-wrapper>
<div style="display: grid"> <!-- overlay container -->
<div style="grid-area: 1/1">
<glue-state-sync-wrapper
:sync="stretch_hist_sync"
:multiselect="layer_multiselect"
@unmix-state="unmix_state(['stretch_function', 'stretch_params',
'stretch_vmin', 'stretch_vmax',
'image_color_mode', 'image_color', 'image_colormap'])"
>
<jupyter-widget :widget="stretch_histogram_widget"/>
</glue-state-sync-wrapper>
</div>
<div v-if="stretch_hist_spinner"
class="text-center"
style="grid-area: 1/1;
z-index:2;
margin-left: -24px;
margin-right: -24px;
padding-top: 240px;
background-color: rgb(0 0 0 / 20%)">
<v-progress-circular
indeterminate
color="spinner"
size="50"
width="6"
></v-progress-circular>
</div>

<v-row>
<v-expansion-panels accordion>
Expand Down
Loading