Skip to content

273: continuous color ramps - #1775

Open
glstott wants to merge 10 commits into
CDCgov:devfrom
glstott:273-continuous_color
Open

glstott wants to merge 10 commits into
CDCgov:devfrom
glstott:273-continuous_color

Conversation

@glstott

@glstott glstott commented Sep 4, 2026

Copy link
Copy Markdown
Collaborator

This addresses #273, adding support for continuous color palettes in node and link colors.

Summary

  • Add continuous color-ramp support to node and link color assignment files.
  • Allow CSV and TSV assignment files to specify either categorical or continuous mode.
  • Validate continuous assignments to ensure:
    • Ramp values are finite numbers.
    • At least two distinct color stops are provided.
    • A file does not mix assignment modes.
  • Preserve independent custom color assignments for nodes and links.
  • Apply imported continuous domains and colors across supported visualizations.
  • Add node and link assignment controls to Global Settings.
  • Add descriptive continuous legend labels, such as:
    • Node Color: Degree
    • Link Color: Distance
  • Include continuous legend labels and accessible titles in SVG exports.
  • Position exported continuous legends beside the visualization so they do not cover the view.
  • Prevent continuous legends and endpoint labels from being clipped in PNG exports.
  • Add documented example node and link continuous-ramp assignment files.

@glstott

glstott commented Sep 11, 2026

Copy link
Copy Markdown
Collaborator Author

Added in support for color assignment files and better style-file schema validation.

# Conflicts:
#	src/app/filesComponent/files-plugin.component.ts
#	src/app/microbe-trace-next-plugin.component.ts
@dacowan404

Copy link
Copy Markdown
Collaborator

It looks good but I do have a couple of notes.
1.) For the input color boxes for continuous color values, those boxes are set to update the color while the user is still selecting a color. So, if you are dragging the color selector around the network (and other views are updating) which can slow the application. Most of the color selectors update after colors are selected. You are using (ngModelChange)=... try just (change)=... We want the views to just update once after the color has been selected.
2. When using link color by distance as a continuous variable, so epi only links show up as distance 0, other show as another distance. Essentially if the link has the potential to be a duolink but the threshold is set higher than its genetic distance causing the link to be an epi only link, this links color is based on its genetic distance. If the link is just epionly (ie. default dataset has place nodes P1... without sequence or genetic distance so those links are purely epi only), then the links are colored based on distance of zero. I think either case where the link just has epi link visible, they should be colored based on the null/na value. See if this can be resolved and if not we can add an alert to the user (like we did for nearest neighbor with networks with both epi and genetic links).
3. I think we have reached the point in global settings styling tab that we need to start using some p-accordion tabs (like we do for others settings menus). Maybe just have one for each node color, node shape, and link color.

Let me know if you have any questions.

# Conflicts:
#	cypress/e2e/journeys/flows/twod-timeline-controls-uploaded.cy.ts
#	cypress/e2e/view-state/bubble-view.cy.ts
#	cypress/support/commands.ts
#	src/app/contactTraceCommonServices/color-mapping.service.spec.ts
#	src/app/contactTraceCommonServices/color-mapping.service.ts
#	src/app/contactTraceCommonServices/common.service.ts
#	src/app/microbe-trace-next-plugin.component.html
#	src/app/microbe-trace-next-plugin.component.ts
#	src/app/visualizationComponents/KeyTablesComponent/key-tables.component.html
#	src/app/visualizationComponents/KeyTablesComponent/key-tables.component.ts
#	src/app/visualizationComponents/TimelineComponent/timeline-component.component.ts

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants