Spaces:
Sleeping
Sleeping
Prompt β hover tooltips on the fitness Γ synergy scatter (highlighted dots)
Add hover to the scatter so the highlighted dots (winner, p16, cell_cycle) show their genes + key scores. Frontend-only. Depends on PROMPT_fitness_synergy_scatter.md being in (it draws the canvas). Verified the data is all on the module row. No engine/API/airgap change. tsc after.
Scope β hover only the highlighted dots
Hit-test only the highlighted points (winner + cell_cycle + p16/immune groups) β that's a few dozen, so it's trivially fast, and it keeps the reveal bounded. Do NOT hover-test the ~6,000 faint background dots (they're not revealed, and revealing all of them would break the airgap).
Hit-testing on the canvas
- When drawing the highlighted dots, also record each one's screen position + its module:
{ cx, cy, module }in a ref array. - On
mousemoveover the canvas, find the nearest highlighted point within ~8px of the cursor; if found, show the tooltip for that module; on mouseout / none-in-range, hide it. - Tooltip = an absolutely-positioned HTML div over the chart container, following the cursor (clamp to stay on-screen).
Tooltip content
For the hovered group show:
- Genes (revealed symbols), e.g.
MCM5, MCM2(winner:C11orf85, ZFR2). - Source tag: winner / p16 / cell_cycle (or immune / MMR for CRC) β colour-matched to the dot.
- GP fitness =
m.gp_fitness - Combined AUROC =
m.combined_holdout - Coherence =
m.coherence - Synergy =
m.combined_holdout β max(per_gene single_gene_metric)(the same value the table/column uses; reuse the shared helper, don't recompute inconsistently). - (Optionally size =
m.size.) Format every number through the existingfmtFitso non-finite shows "β".
Revealing the gene symbols (bounded)
- The highlighted groups may include modules not on the current table page, so their symbols may not be revealed yet. On scatter mount, batch-reveal the union of the highlighted groups'
gene_idsin onepostRevealcall (winner + allref_sets-tagged groups). This is bounded (a few dozen groups Γ a few genes β ~100-200 ids), same discipline as revealing the reference sets. CachesymbolByOpaqueand use it in the tooltip. - Never reveal the background groups' genes.
CONSTRAINTS
- Frontend-only; scores are already on the row, symbols via a bounded reveal of the highlighted groups only. No engine/API/airgap change.
- Keep hover restricted to highlighted dots (fast + bounded reveal).
Checkpoint
- Hovering a winner / p16 / cell_cycle dot shows a tooltip with its gene symbols + GP fitness, Combined AUROC, Coherence, Synergy (and source).
- Background dots are not hover-targets; no full-map reveal.
tscclean; no API/airgap change.