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

Fix subset mixed color bug #2579

Merged
merged 5 commits into from
Nov 29, 2023
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
Original file line number Diff line number Diff line change
Expand Up @@ -259,8 +259,8 @@ def test_apply_presets(imviz_helper):
arr = np.arange(36).reshape(6, 6)
po = imviz_helper.plugins['Plot Options']

preset_colors_4 = ["#0000FF", "#00FF00", po._obj.swatches_palette[1][0],
po._obj.swatches_palette[0][0]]
preset_colors_4 = ["#0000ff", "#00ff00", po._obj.swatches_palette[1][0].lower(),
po._obj.swatches_palette[0][0].lower()]

# Test applying presets with < 6 layers

Expand Down
4 changes: 4 additions & 0 deletions jdaviz/core/template_mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -2982,6 +2982,10 @@ def _get_glue_value(self, state):
return getattr(state, glue_name).name
if glue_name in GLUE_STATES_WITH_HELPERS:
return str(getattr(state, glue_name))
if glue_name == 'color':
# Set to lower() so that all linked states of a subset
# (data in viewer with this subset applied) have matching color values
return str(getattr(state, glue_name)).lower()
if glue_name in ('contour_visible', 'bitmap_visible'):
# return False if the layer itself is not visible. Setting this object
# to True will then set both glue_name and visible to True.
Expand Down
Loading