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

data-menu: fix updating linewidth and colormap styling #3341

Merged
merged 3 commits into from
Dec 6, 2024
Merged
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
8 changes: 5 additions & 3 deletions jdaviz/core/template_mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -1496,9 +1496,8 @@ def __init__(self, plugin, items, selected, viewer,
handler=lambda _: self._update_layer_items())
self.hub.subscribe(self, SubsetCreateMessage,
handler=lambda _: self._on_subset_created())
# will need SubsetUpdateMessage for name only (style shouldn't force a full refresh)
# self.hub.subscribe(self, SubsetUpdateMessage,
# handler=lambda _: self._update_layer_items())
self.hub.subscribe(self, SubsetUpdateMessage,
handler=lambda _: self._update_layer_items())
self.hub.subscribe(self, SubsetDeleteMessage,
handler=lambda _: self._update_layer_items())

Expand Down Expand Up @@ -1714,6 +1713,8 @@ def _on_data_added(self, msg=None):
@observe('filters', 'sort_by')
def _update_layer_items(self, msg={}):
# NOTE: _on_layers_changed is passed without a msg object during init
# TODO: if the message is a SubsetUpdateMessage, only act on those that require
# an update
# TODO: Handle changes to just one item without recompiling the whole thing
manual_items = [{'label': label} for label in self.manual_options]
# use getattr so the super() call above doesn't try to access the attr before
Expand Down Expand Up @@ -4484,6 +4485,7 @@ def _on_glue_value_changed(self, value):
# currently in subscribed states will be ignored.
for viewer in self.subscribed_viewers:
viewer._update_layer_icons()
viewer.data_menu.layer._update_layer_items()
# callbacks from the viewer state also do not trigger an update to the
# layer items (tabs), so we'll force those to update from here as well.
self.plugin.layer._update_layer_items()
Expand Down
Loading