Skip to content

feat: SDA-810 Adds customizability to Chromatograms#79

Open
sdee-tetra wants to merge 28 commits into
mainfrom
chromatagram-enhancements
Open

feat: SDA-810 Adds customizability to Chromatograms#79
sdee-tetra wants to merge 28 commits into
mainfrom
chromatagram-enhancements

Conversation

@sdee-tetra
Copy link
Copy Markdown

@sdee-tetra sdee-tetra commented May 4, 2026

Summary

https://tetrascience.atlassian.net/browse/SDA-810

This is what using ChromatogramChart and StackedChromatogram chart instead of using Plotly directly would look like: https://github.com/tetrascience/ts-data-app-system-suitability-testing/compare/chromatogram-encapsulation

Type of Change

  • Feature (new functionality)
  • Bug fix
  • Refactor
  • Documentation
  • Chore (build, CI, dependencies)
  • Breaking change

Checklist

  • yarn lint passes
  • yarn build passes
  • yarn test:all passes
  • Storybook stories added/updated
  • Code coverage remains the same or increased

Testing

Verification

  • Deploys to preview environment for manual verification
  • All CI/E2E checks pass

Screenshots

@vercel
Copy link
Copy Markdown

vercel Bot commented May 4, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
ts-lib-ui-kit-storybook Ready Ready Preview, Comment May 28, 2026 2:24pm

Request Review

@sdee-tetra sdee-tetra temporarily deployed to artifactory-prod May 4, 2026 13:56 — with GitHub Actions Inactive
@sdee-tetra sdee-tetra temporarily deployed to artifactory-prod May 5, 2026 01:57 — with GitHub Actions Inactive
@sdee-tetra sdee-tetra changed the title Adds range annotations to ChromatogramChart Adds customizability to Chromatograms May 6, 2026
@sdee-tetra sdee-tetra changed the title Adds customizability to Chromatograms feat: SDA-810 Adds customizability to Chromatograms May 6, 2026
sdee-tetra and others added 3 commits May 12, 2026 09:38
Add \`color?: string\` to PeakAnnotation. When set it overrides the
series-derived color for the annotation label, arrow, border, and
boundary markers. Series-color remains the default when omitted, so
existing consumers are unaffected.

Motivated by the SST data app's pass/fail (green/red/grey) peak
coloring, which today is implemented as a custom Plotly overlay.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add PeakAnnotation.regionOverlay (with optional regionOverlayWidth) to
paint a thickened colored segment along the underlying trace between
the peak's startX and endX. Honors peak.color from the per-peak color
override; falls back to the series color.

This is the first-class equivalent of the ad-hoc Plotly overlay used
by the SST runner's ChromatogramPanel, which marks integrated regions
green/red/grey by pass/fail.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add stackingOrder ("first-on-bottom" | "first-on-top", default
"first-on-bottom") to control which end of the stack series[0] lands
on. Annotations and numeric-yAnchor range annotations follow the
chosen direction so they stay pinned to their trace.

The default preserves existing behavior. The new "first-on-top"
direction matches the convention used by the SST Injection-Viewer
panel and lets consumers keep annotations in source order.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copy link
Copy Markdown
Contributor

@54321jenn-ts 54321jenn-ts left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sdee-tetra LGTM.

Note: this will show up in the storybook under "StackedChromatogramChart" but the other version shows up under "ChromatogramChart", so there's a chance that a user may miss this enhancement if they are just browsing for it in the storybook without knowing to search for it. Maybe there's a way you can make it where it'll show up along with the other similar chart type. Not worth holding up this PR, but worth considering.

@github-actions
Copy link
Copy Markdown

Coverage Report

Status Category Percentage Covered / Total
🟢 Lines 92.82% (🎯 83%)
⬆️ +0.28%
16901 / 18208
🟢 Statements 92.82% (🎯 83%)
⬆️ +0.28%
16901 / 18208
🟢 Functions 92.24% (🎯 74%)
⬆️ +0.13%
726 / 787
🟢 Branches 87.36% (🎯 81%)
⬆️ +0.76%
2703 / 3094
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
src/components/charts/ChromatogramChart/ChromatogramChart.tsx 97.89%
⬆️ +0.43%
79.54%
⬆️ +2.88%
100%
🟰 ±0%
97.89%
⬆️ +0.43%
279-283
src/components/charts/ChromatogramChart/annotations.ts 100%
🟰 ±0%
100%
⬆️ +3.13%
100%
🟰 ±0%
100%
🟰 ±0%
src/components/charts/ChromatogramChart/boundaryMarkers.ts 100%
⬆️ +4.00%
100%
⬆️ +33.34%
100%
🟰 ±0%
100%
⬆️ +4.00%
src/components/charts/ChromatogramChart/constants.ts 100%
🟰 ±0%
100%
🟰 ±0%
100%
🟰 ±0%
100%
🟰 ±0%
src/components/charts/ChromatogramChart/plotBuilder.ts 100% 97.91% 100% 100%
src/components/charts/ChromatogramChart/regionOverlays.ts 100% 100% 100% 100%
src/components/charts/ChromatogramChart/types.ts 100%
🟰 ±0%
100%
🟰 ±0%
100%
🟰 ±0%
100%
🟰 ±0%
src/components/charts/StackedChromatogramChart/StackedChromatogramChart.tsx 100% 100% 100% 100%
src/components/charts/StackedChromatogramChart/transforms.ts 100% 100% 100% 100%
src/components/charts/StackedChromatogramChart/types.ts 100% 100% 100% 100%
Generated in workflow #692 for commit 36fd03e by the Vitest Coverage Report Action

Copy link
Copy Markdown
Collaborator

@blee-tetrascience blee-tetrascience left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Requesting changes for Zephyr metadata and lint policy. The diff adds concrete Zephyr IDs, and I do not see a sync action commit on this branch. Please clear the added IDs to empty strings and let the sync action fill them.

// fields don't change — consumers should memoize selectionAppearance if needed).
const resolvedAppearance = useMemo(
() => resolveSelectionAppearance(selectionAppearance),
// eslint-disable-next-line react-hooks/exhaustive-deps
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Repo guidance says not to add lint disable comments. Please make the memo dependency shape lint clean, for example by normalizing the selected appearance fields before the memo or by depending on the full object and requiring callers to memoize it.

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.

5 participants