From 1dc9c1e190966a62e28040eedaf1d974962bc37c Mon Sep 17 00:00:00 2001 From: "Brett M. Morris" Date: Mon, 13 Nov 2023 16:44:58 -0500 Subject: [PATCH] allow change in cmap_att on change in data components --- jdaviz/core/template_mixin.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/jdaviz/core/template_mixin.py b/jdaviz/core/template_mixin.py index e36d2d1951..6282c79eca 100644 --- a/jdaviz/core/template_mixin.py +++ b/jdaviz/core/template_mixin.py @@ -2899,16 +2899,19 @@ def _on_viewer_layer_changed(self, msg=None): if glue_name in ['contour_visible', 'bitmap_visible']: state.add_callback('visible', self._on_glue_layer_visible_changed) - if self.sync.get('choices') is None and \ - (hasattr(getattr(type(state), glue_name), 'get_display_func') - or glue_name == 'cmap'): + if ( + self.sync.get('choices') is None and + ( + hasattr(getattr(type(state), glue_name), 'get_display_func') or + glue_name == 'cmap' + ) + ) or glue_name == 'cmap_att': # then we can access and populate the choices. We are assuming here # that each state-instance with this same name will have the same # choices and that those will not change. If we ever hookup options # with changing choices, we'll need additional logic to sync to those # and handle mixed state in the choices... self.sync = {**self.sync, 'choices': self._get_glue_choices(state)} - self.sync = {**self.sync, 'in_subscribed_states': in_subscribed_states, 'icons': icons,