Skip to content

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

Open
alisman wants to merge 17 commits into
masterfrom
studyview-grid-layout
Open

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

Conversation

@alisman

@alisman alisman commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Explore's Summary tab laid out as the portal's grid, with the portal's own grid library, react-grid-layout (2.3.0), and the cards restyled to fit it.

The grid (lib/study-view-layout.ts, app/lab/explore-grid.tsx)

  • Cells of about 195 × 170 px, 7 px apart (the portal's 5 and 2 more, by the user's choice).
  • The grid fills the content width and is flush with both edges. The column count is the one whose stretched or squeezed cells come closest to 195 px, never under 175 (7 columns of ~193 px at a 1440 px window).
  • Each card the portal's default size for its kind: pie and survival 1×1; bar 2×1; table, density and 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 (decided against, 2026-11-13).
  • Each section of explore-sections.tsx returns its cards (clinicalCards, geneTableCards, …); cardOrders is replaced by orderCards.

The cards

  • One title treatment: centred, one line, ellipsized, on a white 29 px title bar with a rule under it.
  • The header buttons (☰ …) show only on hover or keyboard focus, on devices that hover.
  • Charts fill their card's height: histograms, the KM plot (the curve alone, sized to the card) and the density scatter.
  • Pies as the portal draws them: the full square, counts on the slices, the values in a hover table.
  • The density scatter's ticks are condensed (2K, 1.5M…, fmtCompactTick) with 5 ticks per axis, so the plot gets the width.
  • Value lists and tables: no bar per row; striped rows as legacy (#f9f9f9); the scroll box ruled top and bottom; search in the footer.
  • The loading skeleton uses the same grid, so nothing jumps when the charts arrive.

Verification

  • Browser, dev server, coadread: both grid edges flush at 1280, 1440, 1600 and 1920 px; no card scrolls; no horizontal page scroll; no page errors.
  • Unit tests: test/study-view-layout.test.ts (the cell, the columns, each kind's size, the order, findSpot), test/compact-tick-format.test.ts, and a plot-only KM drawn at a height in test/study-view-chart-files.test.ts.
  • npm test: 7,204 pass, 0 fail. tsc --noEmit and eslint are clean.
  • e2e: test/e2e/explore.cjs checks that the value lists draw no per-row bar. I didn't run the local gate; CI runs the suite.

Tracker

Add under the Study View layout items:

Preview

/lab?tab=explore&study=coadread_tcga_pan_can_atlas_2018

🤖 Generated with Claude Code

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 25, 2026 1:48am UTC
cbiolab-new Ready Ready Preview Nov 25, 2026 1:48am UTC
cohort-lab Ready Ready Preview Nov 25, 2026 1:48am UTC

Request Review

@alisman alisman changed the title [DO NOT MERGE] Study View: the portal's grid layout, with react-grid-layout (STS-LY-1…3) Study View: the portal's grid layout, with react-grid-layout (STS-LY-1…3) Nov 24, 2026
@alisman
alisman marked this pull request as ready for review November 24, 2026 19:07
alisman and others added 10 commits November 24, 2026 20:47
…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
…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
…trols on one line

Every card's header is one 20 px line 4 px from its top. The title is centred over the card's whole
width, keeping as clear of the top-right controls on its left as on its right; the ☰ menu sits in
the corner at 20 × 20 px and any other control (the frequency table's filter, a density chart's
reset, a generic-assay chart's ✕) just left of it, on the same line. The gene tables' search box
moves to the card's footer, as every value list's already is (STS-TBL-3); the survival chart's
endpoint picker moves into its ☰ menu (Endpoint ▸ OS, PFS, …), so its title is centred too.

Measured on coadread at 1440 px: every card's title within 0 px of its card's centre, and title,
☰ and other controls all 20 px tall at 5 px from the card's top.

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

The value lists, Data Types, Cancer Studies and the derived lists drop their
proportion bar column. A card's ☰ and other header buttons show while the
pointer is over the card, a button in it has focus, or its menu is open;
on a screen without hover they always show.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Q3ezTaCo6wHFVsML6Qd4ht
The histograms, the KM plot and the density scatter take the room under the
title instead of a height of their own: the histogram's bars stretch above a
fixed tick row; the KM plot is drawn at its box's width and height
(survivalSvg plot-only takes a height; DrawAtSize measures both); the density
draws at its box's height. Outside a grid card each keeps its old size.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Q3ezTaCo6wHFVsML6Qd4ht
About five ticks an axis instead of eight, and thousands as K/M/B (10,000 →
10K, fmtCompactTick in lib/chart/format.ts), so the labels take less of the
card from the plot.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Q3ezTaCo6wHFVsML6Qd4ht
As the portal's study-view tables (FixedHeaderTable: #f9f9f9 every other row):
each list row striped by its index, so the stripes stay with their rows as the
virtual list scrolls; the header shaded; the scrolling box ruled above and
below. Tokens --row-stripe and --table-head carry a dark-mode value.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Q3ezTaCo6wHFVsML6Qd4ht
alisman and others added 7 commits November 24, 2026 20:47
A grid card's header is a shaded bar edge to edge, ruled underneath, its title
and buttons centred in it; the tables' column headers go back to the card's
own background.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Q3ezTaCo6wHFVsML6Qd4ht
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Q3ezTaCo6wHFVsML6Qd4ht
A page showing the grid takes the card colour for its background, in place of
the panel the grid sat on.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Q3ezTaCo6wHFVsML6Qd4ht
The page keeps its usual background behind the grid, and a card's header
takes the card's white, ruled underneath.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Q3ezTaCo6wHFVsML6Qd4ht
The gap between cards and around the grid is 7 px, the portal's 5 and 2 more;
the columns are counted with it, floor((window − 40) / 202), so a 1440 px
window holds 6 columns where it held 7.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Q3ezTaCo6wHFVsML6Qd4ht
The grid fills its box's width with no padding at its sides: the columns are
the count whose cells, stretched or squeezed to fill it, come closest to the
portal's 195 px, never under 175 (gridCols, cellWidth). A 1440 px window holds
7 columns of 193 px. The loading placeholders fill the width too, and a card's
title keeps 26 px clear for its menu.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Q3ezTaCo6wHFVsML6Qd4ht
The table's title no longer shows "OncoKB drivers" (only the portal's text), so the
check waits on a data-drivers attribute the table carries while counting drivers.

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 — 5204bb6c Deployed Nov 25, 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