Skip to content

[DO NOT MERGE] Study View: the portal's grid layout, with react-grid-layout (STS-LY-1…3) - #501

Draft
alisman wants to merge 4 commits into
masterfrom
studyview-grid-layout
Draft

alisman wants to merge 4 commits into
masterfrom
studyview-grid-layout

Conversation

@alisman

@alisman alisman commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Do not merge. A draft for the user to look at. They asked that it not be merged.

Summary

Explore's Summary grid is laid out as the portal's, with the portal's own grid library, react-grid-layout (2.3.0; the portal uses 0.16):

  • cells of 195 × 170 px, 5 px apart;
  • floor((window − 40) / 200) columns, the grid centred at cols·195 + (cols+1)·5;
  • each card the portal's default size for its kind: a pie 1×1; a bar chart 2×1; a table, density or violin 2×2; a table of values 2×1 up to 4 rows, else 2×2;
  • placed by priority, then name, into the first free spot (findSpot), the reader's added charts last;
  • no drag or resize.

Code:

  • the rules: lib/study-view-layout.ts;
  • the grid: app/lab/explore-grid.tsx;
  • each section of explore-sections.tsx now returns its cards (clinicalCards, geneTableCards, …), so the grid can place each one;
  • cardOrders is replaced by orderCards.

Not yet as the portal's:

  • The survival card stays one card with an endpoint picker, at 2×2.
  • Categorical charts drawn as value lists take the portal's pie-as-table size, not 1×1 pies.
  • Cards' insides are not yet sized to their cells; they scroll within them.

Verification

  • Browser, dev server, coadread at 1440 px: every card at the portal's size, in its order, no page errors.
  • test/study-view-layout.test.ts: the cell, the columns, each kind's size, the order and findSpot.
  • npm test 7,197 pass, 0 fail; tsc --noEmit and eslint clean.

Preview

/lab?tab=explore&study=coadread_tcga_pan_can_atlas_2018

🤖 Generated with Claude Code

https://claude.ai/code/session_01Q3ezTaCo6wHFVsML6Qd4ht


Show it working
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

…t): 195 × 170 cells, each chart a whole number of them (STS-LY-1…3)

Every card on Explore's Summary is placed as the portal places it: cells of 195 × 170 px, 5 px
apart, floor((window − 40) / 200) columns, the grid centred at cols·195 + (cols+1)·5. Each card
takes the portal's default size for its kind (a pie 1×1, a bar chart 2×1, a table, density or
violin 2×2, a table of values 2×1 up to 4 rows), and goes in priority order into the first free
spot (findSpot), the reader's added charts last. No drag or resize.

The survival card stays one card with an endpoint picker, at 2×2. Categorical charts drawn as
value lists take the portal's pie-as-table size.

Draft: not to be merged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Q3ezTaCo6wHFVsML6Qd4ht
@vercel

vercel Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
cbiolab-genie Ready Ready Preview Nov 20, 2026 5:08pm UTC
cbiolab-new Ready Ready Preview Nov 20, 2026 5:08pm UTC
cohort-lab Ready Ready Preview Nov 20, 2026 5:08pm UTC

Request Review

…s text

Every card's title is drawn alike, as the portal's (STS-HD-1): its name only, bold and centred,
on one 20 px line, a long one cut with an ellipsis. Text the portal does not show in a card moves
into the title's tooltip (what a chart counts, its level, the selection a density drag holds) or
goes (the min · median · max line and its median chips, the gene tables' gene counts, a list's
'scroll for more'). The survival card's title is the portal's "KM Plot: Overall (months)"
(kmPlotTitle), drawn without the risk table; Data Types, Case Lists and the other tables no longer
use the upper-case section heading.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Q3ezTaCo6wHFVsML6Qd4ht
The Study View's survival chart draws the axes and curve only (survivalSvg's plotOnly), as the
portal's small KM chart: no risk table, legend, tests or caption under it. The curve's median,
patients and events are in the plot's tooltip, where the portal keeps its legend (STS-KM-3); the
downloaded figure keeps the full legend. The endpoint picker is compact, so the header stays one
20 px line. On coadread the figure is 376 × 259 inside the 393 × 343 card, with nothing to scroll.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Q3ezTaCo6wHFVsML6Qd4ht
…the slices, the values in a hover table

A pie chart fills its 1 × 1 card below its title, radius min(w, h)/2 − 20 drawn 12 px above the
centre (STS-PIE-2), with no legend beside it. Each slice carries its count (numeral 0.[0]a,
portalPieCount) past a quarter of the pie, or where |tan(π·ratio/2)|·(r/5)·2 holds the label
(pieLabelFits), in ink that contrasts with the slice (STS-PIE-3); a slice's tooltip is
'value:count' (STS-PIE-4). Hovering the pie shows its values as a table, # and Freq with the
checkboxes, search and Select all of a value list (STS-PIE-5). While the chart has a filter, the
values it leaves out are grey at half opacity and the selected ones outlined (STS-PIE-7).

Verified on coadread: Sex 312 / 280 on the slices (NA 2 too small), Overall Survival Status 471
only; the hover table Male 312 52.5%, Female 280 47.1%, NA 2 0.3%; a click on Male greys Female and
NA; the card fits 193 × 168 with nothing to scroll.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Q3ezTaCo6wHFVsML6Qd4ht

This branch was successfully deployed

1 active deployment
Preview – cohort-lab — aac54c4f Deployed Nov 20, 2026 by vercel[bot]
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