Skip to content

[T-110b] Insights panel: SHAP bars, interaction heatmap, GP lengthscale comparison, CV confidence (Plotly lazy) #177

Closed

Description

@CodewithJha

Task T-110b · Milestone M8 — Dashboard · Size S · Priority P1 · Epic #8

Implements FR-DSH-003 · FR-ANA-003

Branch feat/t-110b-insights-panel-shap-bars-interaction — one task = one branch = one PR (doc 32 §6)

Summary

Implement features/casebook/insights/ and components/charts/plotly.ts (lazy partial bundle: heatmap, scatter, box) showing importance bars, parameter × parameter interaction heatmap, lengthscale comparison with disagreement flag, CV AUC + low-confidence label.

Context / motivation

Answers 'why'; Plotly loaded only on this route to stay within bundle budget.

Scope

In scope

  • Shared lazy Plotly wrapper used by Atlas and Trials too.

Implementation guidance

  • components/charts/plotly.ts: export const loadPlotly = () => import('./plotlyBundle'), where plotlyBundle.ts registers only heatmap, scatter, box and contour traces on plotly.js/lib/core (partial bundle, doc 13 §5); a PlotlyChart wrapper (react-plotly.js/factory) with a theme layout derived from CSS variables at runtime and config: {displaylogo: false, responsive: true}.
  • features/casebook/insights/InsightsPanel.tsx (tab insights and casebook side panel): SHAP global bars (sorted, GP 1/ℓ rank alongside with a disagreement icon), interaction heatmap (param × param, symmetric), CV quality (AUC ± std, balanced accuracy, low-confidence label with explanation), per-mode importance selector.
  • Charts include a text summary for screen readers (sentence naming the top-3 parameters).
  • 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

  • Plotly not in the initial chunk (bundle analysis test).
  • Charts render fixture data.
  • Initial chunk excludes Plotly (checked locally here, enforced in T-114).
  • Low-confidence explanation shown when flagged.
  • 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

  • features/casebook/insights/*.test.tsx; bundle check in T-114.

Dependencies

Blocked by: #165 (T-085d), #164 (T-085c)

Blocks: #178 (T-111a), #181 (T-112b)

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/features/casebook/insights/**
  • web/src/components/charts/plotly.ts

Parallel with T-110a.

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-110b (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.5 · doc 13 §5 · doc 09 §4

Requirements: FR-DSH-003 · FR-ANA-003 (traceability: doc 28)

External:

Activity

  1. added this to the M8 — Dashboard milestone on Nov 19, 2026
  2. added 2 commits that reference this issue on Nov 22, 2026
    0e39f24
    9581c15
  3. 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

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions