Repository navigation
Add interactive 3D views: evidence helix, genome map and locus - #13
Merged
Merged
Conversation
The home hero's helix is now a three.js B-form double helix built in code. Each monitored finding is a nucleotide coloured by what its evidence did (vermilion reclassified, amber conflict or regional, slate unchanged), in genome order and labelled as not to scale. Drag turns it, hover or the arrow keys bring up what changed, and a ring scans along it during an evidence sync. The SVG helix stays as the fallback. The variants page stands all 24 GRCh38 chromosomes to scale, each variant pinned at its ClinVar position, linked both ways to the filters and the list; phones keep only the chromosomes that carry a variant. Each variant page shows its own chromosome with the band and position. Chromosome lengths and centromeres are fixed GRCh38 values, and a test checks every variant's arm against ClinVar's own band. three.js loads only when a 3D view is on screen, so no page's first load grows, and nothing is fetched beyond the code: no model, texture or image files. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- A lost WebGL context stops the loop at once and the view is disposed, falling back to the illustration, instead of rendering behind it. - Press, drag and hover are shared by both scenes. A press released outside the view is dropped when the pointer returns with no button held, so it can no longer drag on its own; lost capture ends a drag; and letting go after holding still no longer flings the helix. - Only keyboard focus turns the helix to a finding, so a drag that starts on one no longer snaps back to it. - The genome map's image role sits on the drawing, not on the figure holding its links (WCAG 4.1.2). - A marker's front/back test uses the chromosome axis at its own locus, so markers on a turned arm stay clickable. - Variants sharing a locus fan out in coordinate order. - The map's description counts only what it can place on GRCh38. - A resize keeps the reader's turn and redraws at once, with no blank frame. Adds tests for the pointer rules. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Summary
Adds three interactive three.js views. Every shape is generated in code: no model, texture or image files are shipped or fetched. The earlier GLB was licensed CC BY-NC, which is why it was removed.
/variants: genome map. All 24 GRCh38 chromosomes to scale, centromeres aligned. Each variant is a lollipop at the position its ClinVar record gives./variants/[key]: "Where it sits". The variant's own chromosome laid on its side, with the band and exact position.Colour meanings live in
src/lib/signal.ts, and the variant filters now derive from them, so a filter and its colour always agree.Data and honesty
tests/genome.test.tschecks every monitored variant's arm against ClinVar's own cytogenetic band.Cost
/stays at 154 kB.Independent review
A separate review of the first commit found real defects, and the second commit fixes all of them:
role="img"around links (WCAG 4.1.2).Press, drag and hover are now shared by both scenes (
attachPointerinstage.ts), andtests/pointer.test.tscovers those rules.Already in production
Awaiz asked for this to be live before review, so the branch is deployed to variantpulse.kanbanstudios.ae (Worker version
90fcf007).mainis behind production, and a deploy frommainwould remove these views.5c1deee8.Test plan
npm run verify: tree, type-check, lint, data, history and contrast all passnpm test: 179 pass, including the new genome and pointer testsnpm run cf:build, then awrangler deploy --dry-runsize check🤖 Generated with Claude Code