Conversation
…ng modes (#181) The app colorway was keyed by Plotly legendgroup, which cellpy sets to the cell name when group_legend_muting is off, so turning Mute by group off recoloured every cell individually and lost the group identity. Pass a trace-name -> group map (collect.cell_groups) into _apply_colorway and paint each group with one hue - the scheme colour at (group - 1), matching the sidebar swatches, or cellpy's own group colour for the cellpy scheme - fanned into lightness shades per member so cells of a group stay distinguishable. Group averages and per_cell cycle facets are unchanged. Co-authored-by: Jan Petter Maehlen <jepe@ife.no>
Co-authored-by: Jan Petter Maehlen <jepe@ife.no>
…oup-colours-713a Co-authored-by: Jan Petter Maehlen <jepe@ife.no>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #181.
Problem
Turning Mute by group off recoloured the figure. The app colorway (
collect._apply_colorway, used by thesafe/mutedschemes) was keyed by Plotlylegendgroup, which cellpy sets to the group id when muting is on but to the cell name when it is off — so every cell got its own colour and the group identity was lost. With muting on, the opposite problem: cells of one group were painted in identical colours and could not be told apart.Change
collect.cell_groups(records)maps trace names (batch keys and group names) to group ids;plotting.summary_figureandplotting.cycles_figure(per_cyclelayout) pass it tofigure_json(cell_groups=…)._apply_colorwaybuckets per-cell traces by group and paints each group with one hue — the scheme colour at(group − 1) % len, so thesafescheme matches the sidebar swatches, or for thecellpyscheme the colour cellpy already gave the group — fanned into lightness shades per member (_shade_series, HLS). Singletons keep the base colour exactly.per_cellcycle facets (coloured by cycle) keep the previous order-of-appearance behaviour._restyleso truncated names cannot collide.01-current-issues(left behind by Name groups: library labels, legend captions, manifest + journal persistence (#187) #191).Tests
New section in
tests/test_core.py:cell_groupsmap,_shade_series, summary colours follow groups for every scheme × both muting modes, both muting modes give identical colours, Cycles pane follows groups whileper_cellstays coloured by cycle, group averages keep their swatch colours. Full suite green locally.Walkthrough
Demo cells, two cells put in group 1 and one in group 2,
Safescheme: the group-1 cells are two shades of the swatch blue, group 2 is orange; unticking and re-ticking Mute by group leaves the colours unchanged; the Cycles tab follows the same grouping.issue181_group_colours_muting_walkthrough.mp4
Docs
plot-appearance.md,group-legend-muting.md, README feature line,llms-full.txtregenerated.To show artifacts inline, enable in settings.