Skip to content

[T-111a] RiskHeatmap component: p_fail heatmap, evaluated points, 0.5 contour, hatched UNCERTAIN band, log axes #178

Closed

Description

@CodewithJha

Task T-111a · Milestone M8 — Dashboard · Size S · Priority P0 · Epic #8

Implements 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.tsx props (doc 13 §6): slice: RiskSliceDTO, logX?, logY? (default from the slice), onCellClick?(values: {x: number; y: number}), size?: 'thumb'|'full'.
  • Traces: heatmap of p_fail with 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 in hatchOverlay.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 Unreleased updated 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:

Activity

  1. added this to the M8 — Dashboard milestone on Nov 19, 2026
  2. CodewithJha commented on Nov 22, 2026

    @CodewithJha
    OwnerAuthor

    Shipped on main (merged PR).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:dashboardReact web dashboardmilestone:M8M8 — Dashboardpriority:P0Critical path / blocks otherssize:S<= 1 daytaskChild task of a milestone epictype:featureNew functionality

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions