Skip to content

754: Color Assignment Files for Nodes#1730

Open
glstott wants to merge 5 commits into
CDCgov:devfrom
glstott:754-color_assignment_file
Open

754: Color Assignment Files for Nodes#1730
glstott wants to merge 5 commits into
CDCgov:devfrom
glstott:754-color_assignment_file

Conversation

@glstott

@glstott glstott commented Jul 15, 2026

Copy link
Copy Markdown
Collaborator

This addresses the feature request #754, adding a way for users to use a color assignment file for node coloring. The accepted formats are CSV, TSV, and iTOL files. In addition, this adds a MLST option to the distance dropdown, mapped to SNP distance calculation. This is to help users who are not familiar with SNP distance. Upon selection, a little info box appears to inform the user what is happening under the hood.

Summary

  • Added reusable node color-assignment file imports under Global Settings → Styling.
  • Supports:
    • iTOL DATASET_COLORSTRIP files with space, tab, or comma separators.
    • CSV/TSV tables using the first column as the matching value and a required color column.
  • Added atomic validation for malformed rows, invalid hex colors, unsupported delimiters, and conflicting duplicate assignments.
  • Stores assignments per node field, merges partial imports, retains mappings for future data, and persists them in saved sessions.
  • Immediately refreshes rendered node colors and color tables after import while preserving unmapped colors.
  • Prevents imported colors from leaking between fields with identical values.
  • Added success/error import feedback with matched, unmapped, and retained assignment counts.
  • Added unit coverage and Cypress fixtures/journeys for parsing, mapping precedence, session persistence, ID matching, partial imports, and invalid files.
  • Added MLST to the File Settings and Global Settings distance dropdowns.
  • Routes MLST through the existing SNP distance calculation, including SNP thresholds and step sizes.
  • Displays an unobtrusive MLST/SNP equivalence note only while MLST is selected.
  • Updated the documentation map with color-assignment example entries.

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.

1 participant