Skip to content

1671: Custom Heatmaps#1729

Open
glstott wants to merge 6 commits into
CDCgov:devfrom
glstott:1671-custom_heatmap
Open

1671: Custom Heatmaps#1729
glstott wants to merge 6 commits into
CDCgov:devfrom
glstott:1671-custom_heatmap

Conversation

@glstott

@glstott glstott commented Jul 13, 2026

Copy link
Copy Markdown
Collaborator

This addresses GH Issue 1671: #1671, adding the ability for a user to build customizable heatmaps in MicrobeTrace in lieu of being limited to heatmaps of distance alone. This is especially helpful for things like hemagglutination assays which may be relevant for users.

Summary

  • Expanded Heatmap beyond distance matrices to visualize custom node and link attributes.
  • Added configurable X axis, Y axis, value field, and sort field.
  • Reworked Heatmap rendering, formatting, export, and session persistence.
  • Added Cypress coverage and fixtures for numeric, categorical, missing, duplicate, and session-restored data.

Changes

  • Added a new Configuration tab to Heatmap Settings with:

    • X-variable selection from node fields.
    • Y-variable selection from node fields.
    • Grouped value selection from distance, node, or link fields.
    • Optional sorting using node metadata.
  • Moved existing inversion, color, and label controls into an Appearance tab.

  • Added a configurable missing-data color.

  • Changed the heading from “Current Distance Metric” to the currently selected Heatmap value.

  • Added three matrix-generation modes:

    • Distance matrices with configurable labels and sorting.
    • Node-backed matrices pivoted from visible node records.
    • Link-backed matrices using source and target nodes as axes.
  • Added automatic numeric versus categorical value detection.

  • Added categorical colorbar labels and formatted numeric colorbar ticks.

  • Added explicit category ordering to prevent Plotly from dropping or reordering values.

  • Added explicit missing-value handling for empty, null, undefined, and NaN values.

  • Added a separate “No Data” trace and legend entry.

  • Fixed hover text so cells show their actual formatted values and axis labels.

  • Fixed disappearing colorbars and missing values caused by Plotly defaults.

  • Added duplicate-cell detection:

    • Counts duplicate X/Y combinations.
    • Uses the first available non-missing value.
    • Records a session warning describing the affected configuration.
  • Preserved axis inversion across rendered values, hover data, missing-data overlays, and exports.

  • Updated redraw behavior for resizing, style-file application, filtering, data changes, and distance-format changes.

  • Updated image export to use Plotly for PNG, JPEG, and SVG.

  • Updated CSV export to reflect the active labels, sorting, inversion, missing values, and TN93 display format.

  • Preserved upstream CSV formula sanitization and escaping while resolving the dev merge conflict.

  • Added default session settings for all new Heatmap options so configurations survive session save/restore.

Test coverage

  • Added node-backed numeric and categorical Heatmap scenarios.
  • Added link-backed custom-value coverage.
  • Added missing-data color, duplicate warning, CSV export, and session round-trip coverage.
  • Added two custom CSV fixtures.
  • Updated existing Heatmap specs to navigate through the new Appearance tab.
  • Updated shared assertions to allow the optional missing-data trace.

glstott added 6 commits July 9, 2026 13:06
It allows users to use any field as the value, X, or Y axes. In the case of a link field, X is source and Y is target. When a field is non-unique, it warns the user with a banner below the main toolbar.
# Conflicts:
#	src/app/visualizationComponents/HeatmapComponent/heatmap.component.ts
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