Skip to content

Commit

Permalink
update plot options to use is_active
Browse files Browse the repository at this point in the history
  • Loading branch information
kecnry committed Jul 26, 2023
1 parent 2158220 commit 39f5b4b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 3 additions & 2 deletions jdaviz/configs/default/plugins/plot_options/plot_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ class PlotOptions(PluginTemplateMixin):
not exposed for Specviz. This only applies when ``contour_mode`` is "Custom".
"""
template_file = __file__, "plot_options.vue"
uses_active_status = Bool(True).tag(sync=True)

# multiselect is shared between viewer and layer
multiselect = Bool(False).tag(sync=True)
Expand Down Expand Up @@ -479,7 +480,7 @@ def vue_set_value(self, data):
value = data.get('value')
setattr(self, attr_name, value)

@observe('plugin_opened', 'layer_selected', 'viewer_selected',
@observe('is_active', 'layer_selected', 'viewer_selected',
'stretch_hist_zoom_limits')
def _update_stretch_histogram(self, msg={}):
if not self.stretch_function_sync.get('in_subscribed_states'): # pragma: no cover
Expand All @@ -488,7 +489,7 @@ def _update_stretch_histogram(self, msg={}):
if not hasattr(self, 'viewer'): # pragma: no cover
# plugin hasn't been fully initialized yet
return
if (not self.plugin_opened
if (not self.is_active
or not self.viewer.selected
or not self.layer.selected): # pragma: no cover
# no need to make updates, updates will be redrawn when plugin is opened
Expand Down
2 changes: 2 additions & 0 deletions jdaviz/configs/default/plugins/plot_options/plot_options.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
<j-tray-plugin
description='Viewer and data/layer options.'
:link="'https://jdaviz.readthedocs.io/en/'+vdocs+'/'+config+'/plugins.html#plot-options'"
:uses_active_status="uses_active_status"
@plugin-ping="plugin_ping($event)"
:popout_button="popout_button">

<v-row>
Expand Down

0 comments on commit 39f5b4b

Please sign in to comment.