Repository navigation
Description
Task
T-111a· Milestone M8 — Dashboard · Size S · Priority P0 · Epic #8Implements FR-DSH-004
Branch
feat/t-111a-riskheatmap-component-p-fail-heatmap— one task = one branch = one PR (doc 32 §6)
Summary
Implement components/RiskHeatmap per doc 13 §6 using the lazy Plotly wrapper: colour ramp from risk tokens, scatter overlay (○/✕), contour at 0.5, SVG hatch overlay for UNCERTAIN cells, log axes, onCellClick.
Context / motivation
Core visual of the Risk Atlas.
Scope
In scope
- Accessible data-table alternative (toggle) for screen readers.
Implementation guidance
components/RiskHeatmap/RiskHeatmap.tsxprops (doc 13 §6):slice: RiskSliceDTO,logX?,logY?(default from the slice),onCellClick?(values: {x: number; y: number}),size?: 'thumb'|'full'.- Traces: heatmap of
p_failwith a colourscale built from--risk-safe→--risk-uncertain→--risk-failure; scatter of evaluated points (○ PASS / ✕ FAIL); contour at 0.5; UNCERTAIN hatching as an SVG<pattern>overlay aligned with Plotly's axes after render (encapsulated inhatchOverlay.ts). - Thumbnail mode: no axes/hover,
staticPlot: true, for pair-matrix performance. - Data-table alternative (
role="table") toggle. - Standards: respect the layering contracts (doc 16 §2) and conventions in doc 34; no hard-coded tunables — thresholds/defaults come from typed settings (doc 27); no magic numbers (ruff
PLR2004); public APIs typed (mypy strict) and documented.
Acceptance criteria
- Renders fixture slice; click returns physical coordinates.
- Table alternative passes axe.
- Overlay realigns on resize (test with mocked layout).
- 15 thumbnails render in < 1 s in a browser (Playwright perf check in T-114).
- Tests listed below added and green in CI; coverage of new code meets the gate in doc 18 §3.
- Docs, config reference and CHANGELOG
Unreleasedupdated where behaviour, keys or interfaces changed. - Definition of Done (doc 32 §3) satisfied.
Tests required
components/RiskHeatmap/*.test.tsx.
Dependencies
Blocked by: #177 (T-110b)
Blocks: #179 (T-111b)
Parallelization notes
Files / paths owned by this task — avoid editing other paths; shared files (pyproject.toml entry points, cli/main.py, api/routers/__init__.py, router.tsx, docker/compose.yaml, ci.yml) are append-only:
web/src/components/RiskHeatmap/**
Parallel with T-111b layout.
Definition of Done
Per doc 32 §3 and AGENTS.md §5: lint, format, mypy strict and import-linter green; tests added and passing; docs updated; PR template completed with Closes #<this issue>; Conventional Commit messages referencing T-111a (doc 16 §6); commits authored only by the repository owner identity (AGENTS.md §4); CI green; reviewer checklist (doc 32 §5.1) satisfied.
References
Design docs: doc 13 §3.6 · doc 13 §6 · doc 09 §5.3
Requirements: FR-DSH-004 (traceability: doc 28)
External:
Metadata
Metadata
Assignees
Labels
Projects
- StatusShow more project fieldsBacklog
Activity
Build Risk Atlas and Trials dashboard (#305)
test(web): verify Atlas probes reach the live Console (T-111b) (#314)
CodewithJha commentedon Nov 22, 2026
Shipped on main (merged PR).
fix(web): render the Risk Atlas with lazy Plotly (T-111a) (#326)