Skip to content

Study View: a chart carries every value in practice (FACET_VALUE_LIMIT 20,000), so Summary Data is whole - #465

Merged
alisman merged 1 commit into
masterfrom
studyview-facet-values
Nov 19, 2026
Merged

alisman merged 1 commit into
masterfrom
studyview-facet-values

Conversation

@alisman

@alisman alisman commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Summary

A Study View chart now carries every value in practice, as the portal's does, so its Summary Data is whole (STS-STM-1, STS-DL-1). This follows the user's answer of 2026-11-19: raise the bound to about 20,000 and keep one against something enormous.

  • FACET_VALUE_LIMIT goes from 200 to 20,000 (lib/explore.ts).
    • The warehouse's largest categorical list is 5,033 values (pancan_mimsi_msk_2024 SAMPLE_DISPLAY_NAME). 218 lists ran past 200, and none past 20,000.
    • The bound stays a safety bound. A chart past it still says so, and its Summary Data is still refused with the reason (SD13), but no chart in the warehouse reaches it.
  • Generic-assay categorical charts keep the same bound (ASSAY_VALUE_LIMIT, was 30; SD16).
  • Cost, on the largest list: the Explore answer grows from 320 KB to 450 KB, about 0.2 s. Lists are virtualised, so the page draws only what is on screen.
  • Unchanged: Comparison's ATTR_VALUE_CAP, as the user decided on 2026-11-17.

Spec IDs

  • Covered: STS-STM-1 (a chart's values, all of them), STS-DL-1 (Summary Data on every categorical chart); download-cases SD13, SD15, SD16.

Verification

  • Dev server, pancan_mimsi_msk_2024:

    • Sample Display Name lists all 5,032 values (was 200 of 5,032).
    • Its ☰ › Download › Summary Data is enabled; the file Sample_Display_Name.summary.txt has 5,033 rows (5,032 values and NA), "Category · Number of samples · Percentage of samples" as the portal writes it.
    • No page errors.
  • Answer size and time: 320,832 B / 1.4–2.2 s at 200; 450,298 B / 1.6–2.5 s at 20,000.

  • Unit tests (test/explore-facets.test.ts):

    • the SD15 merge cases now run at the real bound (a union past it keeps that many, distinct at least the union's size, a study's own larger distinct kept, a union within it not cut);
    • SD16 at the same bound;
    • a test pins the bound at about 20,000.

    npm test 6,899 pass, 0 fail; tsc --noEmit and eslint clean.

  • Coverage: passes.

  • Planted bug: 1 in scripts/mutants/study-view.ts (facet-values-cut-at-200, guard unit).

Tracker

Under "Study View → summary charts", these lines (docs/PORTAL-PARITY.md:432–433):

become:

This line (docs/PORTAL-PARITY.md:444):

becomes:

Scorecard 30-study-summary.md, row STS-STM-1 (was | STS-STM-1 | 🟡 | BC | Count by folded value at the attribute's level, NA row; all 40 categorical charts identical to the portal API on Q1, Q2, Q4; the kept spelling the greatest and values merged across studies by their fold, as the portal (keptSpelling). A chart lists at most 200 values (FACET_VALUE_LIMIT; OTHER_PATIENT_ID "showing 200 of 592 values") |):

| STS-STM-1 | ✅ | BC | Count by folded value at the attribute's level, NA row; all 40 categorical charts identical to the portal API on Q1, Q2, Q4; the kept spelling the greatest and values merged across studies by their fold, as the portal (keptSpelling). Every value listed (FACET_VALUE_LIMIT 20,000, above the warehouse's largest list, 5,033) |

download-cases.md, rows SD13, SD15, SD16:

| SD13 | ⚠ Values cut | The page holds a categorical chart's values up to 20,000, more than any list in the warehouse (the largest is 5,033), so Summary Data is whole in practice. A chart past the bound offers Summary Data disabled, saying how many it holds of how many: a file that silently left values out would read as complete. The portal has no cap | cBioLab (FACET_VALUE_LIMIT, lib/explore.ts) |
| SD15 | ⚠ Values cut across studies | Each study sends its values up to the bound. When their union holds more, the merged chart keeps the bound's worth of the most frequent, and its count of values (distinct) is at least the union's size, so the cut shows, both in "showing N of M values" and in SD13 | cBioLab (mergeExplore, lib/explore.ts) |
| SD16 | ⚠ Generic-assay values cut | A categorical generic-assay chart keeps its values up to the same bound and reports how many it has, so SD13 applies to it too | cBioLab (ASSAY_VALUE_LIMIT, lib/explore.ts) |

Preview

/lab?tab=explore&study=pancan_mimsi_msk_2024: Add chart → Sample Display Name; ☰ › Download › Summary Data.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Q3ezTaCo6wHFVsML6Qd4ht

…T 20,000), so Summary Data is whole

The user's answer (2026-11-19): raise the bound on a chart's values from 200 to about 20,000,
keeping a bound against something enormous. The warehouse's largest categorical list is 5,033
values (pancan_mimsi_msk_2024 SAMPLE_DISPLAY_NAME; 218 lists ran past 200), so every chart now
lists every value and its Summary Data is offered whole. Its answer grows from 320KB to 450KB,
about 0.2s. Generic-assay categorical charts keep the same bound (they kept 30).

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

vercel Bot commented Nov 19, 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 19, 2026 5:16pm UTC
cbiolab-new Ready Ready Preview Nov 19, 2026 5:16pm UTC
cohort-lab Ready Ready Preview Nov 19, 2026 5:16pm UTC

Request Review

@alisman

alisman commented Nov 19, 2026

Copy link
Copy Markdown
Contributor Author

Review: pass. This applies the user's answer of 2026-11-19 (Study View 200-value cap). FACET_VALUE_LIMIT goes to 20,000, above the warehouse's largest list (5,033), so a chart carries every value in practice and its Summary Data is whole. A bound is kept against a pathological attribute, and a facet that hits it still says so. Categorical generic-assay entities share the bound, where before they were cut at 30. Hitting the bound is still covered by SD15, rewritten relative to the constant, and the new planted bug facet-values-cut-at-200 is caught by SD13. Select all on these longer lists is already refused past the clause limits (#412 / #416).

nit: the test comment "the user's answer (2026-11-19)" records history; the comment should say what the test checks.

@alisman
alisman added this pull request to the merge queue Nov 19, 2026
Merged via the queue into master with commit f651c23 Nov 19, 2026
12 checks passed
@alisman
alisman deleted the studyview-facet-values branch November 19, 2026 17:40

This branch was successfully deployed

1 active deployment
Preview – cohort-lab — 6c9c421e Deployed Nov 19, 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