Skip to content

feat(smartem): /models heatmap matrix on mock data (PR 67a)#87

Open
vredchenko wants to merge 1 commit into
mainfrom
feat/67-weights-matrix
Open

feat(smartem): /models heatmap matrix on mock data (PR 67a)#87
vredchenko wants to merge 1 commit into
mainfrom
feat/67-weights-matrix

Conversation

@vredchenko
Copy link
Copy Markdown
Collaborator

Summary

PR 67a from the plan in #67. Adds the model × metric weights heatmap to apps/smartem at the existing top-level /models nav route. Renders on a hand-rolled mock fixture; no chart library introduced. apps/legacy is untouched.

  • New route apps/smartem/src/routes/models.tsx — page header + matrix.
  • New component apps/smartem/src/components/weights/WeightsMatrix.tsx — CSS-grid layout, MUI Tooltip per cell, gradient legend below.
  • New colour helper apps/smartem/src/components/weights/cellColor.ts — single-hue blue ramp, dark-text-on-light / light-text-on-dark above 0.55.
  • New mock fixture apps/smartem/src/data/mock-model-weights.ts — 4 models × 5 metrics = 19 populated cells + 1 empty for the "no data" demo. Shaped to match orval's QualityPredictionModelWeight type so PR 67b2 can swap in useGetModelWeightsForGridGridGridUuidModelWeightsGet without restructuring the data flow.
  • Auto-regenerated apps/smartem/src/routeTree.gen.ts for the new /models route.

What's deferred

  • Chart library / sparklines / time series: blocked on the time-series UI library ADR tracked at smartem-devtools#196. PR 67b2 lands after that ADR.
  • Time slider: PR 67c.
  • Grid / acquisition selector: MVP hard-codes a mock grid id. Page header surfaces the temporary scope ("weights for grid-A1 (mock)").

Test plan

  • npm run typecheck — clean across all workspaces
  • npm run check (Biome lint + format) — clean
  • Pre-push hooks green (typecheck, lint, format-check, gitleaks)
  • Smoke check via npm run dev:smartem:mock (Playwright):
    • Page header "Models" + subheader "weights for grid-A1 (mock)"
    • 4 row headers (resnet-atlas, vit-gridsquare, efficientnet-ice, dae-atlas), 5 column headers (astigmatism, ctf_resolution, defocus, ice_thickness, motion)
    • 19 weight cells with values (e.g. 0.82, 0.30) colour-coded; 1 empty cell
    • Hover tooltip on 0.82 cell: resnet-atlas · defocus | Weight: 0.820 | Apr 29, 2026, 07:00 PM
    • Legend gradient with stops 0.00 / 0.25 / 0.50 / 0.75 / 1.00
    • Zero console errors

Closes none — progresses #67.

Implements PR 67a from the plan in #67: a per-grid model × metric weights
matrix at the existing top-level /models nav route, rendered on a hand-rolled
mock fixture. Cells are colour-coded by current weight (single-hue blue
ramp); hovering shows a tooltip with model, metric, weight and timestamp;
empty (model, metric) pairs render as a dashed "no data" tile; a gradient
legend sits below the matrix.

No chart library introduced (deferred to PR 67b1, the ADR tracked at
DiamondLightSource/smartem-devtools#196). The mock fixture is shaped to
match orval's QualityPredictionModelWeight type so PR 67b2 can swap in
useGetModelWeightsForGridGridGridUuidModelWeightsGet without restructuring
the data flow.

apps/legacy is untouched.
@vredchenko vredchenko added the development New features or functionality implementation label Apr 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

development New features or functionality implementation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant