Commit Graph

225 Commits

Author SHA1 Message Date
Andrew Charlwood ebf3218431 docs: update progress.txt with iteration 13 (Task D.3 complete) 2026-02-07 03:41:22 +00:00
Andrew Charlwood 0a14f1fce3 feat: drug timeline Gantt chart tab (Task D.3) 2026-02-07 03:40:29 +00:00
Andrew Charlwood 3b1de4933f docs: update progress.txt with iteration 12 (Task C.4 complete) 2026-02-07 03:33:30 +00:00
Andrew Charlwood 1405476818 feat: drug switching network graph tab (Task C.4) 2026-02-07 03:32:14 +00:00
Andrew Charlwood ac688c9ac0 docs: update progress.txt with iteration 11 (Task C.3 complete) 2026-02-07 03:26:50 +00:00
Andrew Charlwood d8df41619d feat: duration vs cost scatter plot tab (Task C.3) 2026-02-07 03:25:39 +00:00
Andrew Charlwood d4a2dea497 docs: update progress.txt with iteration 10 (Task C.2 complete) 2026-02-07 03:19:48 +00:00
Andrew Charlwood 55c9af2de7 feat: pathway depth distribution chart tab (Task C.2)
Horizontal bar chart showing patients who stopped at each treatment
line depth (exclusive counts, not cumulative like the funnel).
2026-02-07 03:18:28 +00:00
Andrew Charlwood 41712039a6 docs: update progress.txt with iteration 9 (Task C.1 complete) 2026-02-07 03:13:31 +00:00
Andrew Charlwood a6cf6efa18 feat: retention funnel chart tab with treatment line depth (Task C.1) 2026-02-07 03:12:30 +00:00
Andrew Charlwood 37bac5d841 docs: update progress.txt with iteration 8 (Task B.4 complete) 2026-02-07 03:06:44 +00:00
Andrew Charlwood 8e2e2b7125 feat: heatmap metric toggle for both PP and TC views (Task B.4)
- Add Heatmap tab to Patient Pathways TAB_DEFINITIONS (was only in ALL_TAB_DEFINITIONS)
- Add dmc.SegmentedControl (Patients/Cost/Cost p.a.) to PP chart card header, hidden by default
- update_chart callback controls toggle visibility via heatmap-metric-wrapper style output
- _render_heatmap() now accepts metric param from toggle
- Add dmc.SegmentedControl to TC heatmap chart cell inline
- tc_heatmap callback reads tc-heatmap-metric-toggle value and passes metric to figure fn
2026-02-07 03:05:41 +00:00
Andrew Charlwood 51d435d9a2 docs: update progress.txt with iteration 7 (Task B.3 complete) 2026-02-07 03:00:40 +00:00
Andrew Charlwood fb30f5f49a fix: Sankey freeform arrangement + increased padding (Task B.3) 2026-02-07 02:59:59 +00:00
Andrew Charlwood a22b2e7811 docs: update progress.txt with iteration 6 (Task B.2 complete) 2026-02-07 02:57:59 +00:00
Andrew Charlwood cbac37ea6b fix: smooth green→amber→red gradient for cost effectiveness chart (Task B.2) 2026-02-07 02:57:16 +00:00
Andrew Charlwood 8035762005 docs: update progress.txt with iteration 5 (Task B.1 complete) 2026-02-07 02:54:41 +00:00
Andrew Charlwood 8d05adc358 fix: consistent titles via _base_layout() for Sankey, Cost Effectiveness, Duration (Task B.1) 2026-02-07 02:53:59 +00:00
Andrew Charlwood fe7153375e docs: update progress.txt with iteration 4 (Task A.4 complete, Phase A done) 2026-02-07 02:49:42 +00:00
Andrew Charlwood 950d93b16b fix: trust palette for cost waterfall + Viridis dosing gradient (Task A.4) 2026-02-07 02:49:01 +00:00
Andrew Charlwood 060cea2a03 docs: update progress.txt with iteration 3 (Task A.3 complete) 2026-02-07 02:44:20 +00:00
Andrew Charlwood 90de24c72d fix: adaptive legends + _base_layout for 4 chart functions (Task A.3)
- Add _smart_legend(n_items) and _smart_legend_margin(n_items) helpers
  - >15 items: vertical right legend with extra right margin
  - <=15 items: horizontal legend with dynamic bottom margin
- Apply _base_layout() + _smart_legend() to:
  - create_market_share_figure() — DRUG_PALETTE, adaptive legend
  - create_trust_market_share_figure() — DRUG_PALETTE, adaptive legend
  - create_dosing_figure() — DRUG_PALETTE, legend adapts to trace count
  - create_trust_duration_figure() — TRUST_PALETTE, fixed l=200 margin
- Replace all local nhs_colours lists with module-level palettes
- Net reduction of 48 lines via DRY layout code
2026-02-07 02:43:35 +00:00
Andrew Charlwood ffa29bd10c docs: update progress.txt with iteration 2 (Task A.2 complete) 2026-02-07 02:36:40 +00:00
Andrew Charlwood 56ca11ea30 fix: heatmap linear colorscale, cell annotations, autosize (Task A.2)
- Replace non-linear 7-stop colorscale with linear 5-stop in both
  create_heatmap_figure() and create_trust_heatmap_figure()
- Add cell text annotations formatted per metric (patients: N, cost: £Nk, cost_pp_pa: £N)
- Set zmin=0 explicitly for correct color mapping
- Remove fixed width, use autosize=True via _base_layout()
- Replace l=200 fixed margin with l=8 + yaxis automargin=True
- Add subtitle annotation when 25-drug cap is reached
- Reduce xgap/ygap from 2 to 1 when >15 drug columns
- Apply _base_layout() to both heatmap functions for consistent styling
2026-02-07 02:36:02 +00:00
Andrew Charlwood 8b980a755f feat: add shared styling constants and _base_layout() helper (Task A.1)
Add module-level constants (CHART_FONT_FAMILY, CHART_TITLE_SIZE,
CHART_TITLE_COLOR, GRID_COLOR, ANNOTATION_COLOR, TRUST_PALETTE,
DRUG_PALETTE) and _base_layout() helper to DRY shared layout
properties across all chart functions. Apply to create_icicle_from_nodes
as proof-of-concept.
2026-02-07 02:31:16 +00:00
Andrew Charlwood 8f1bb488df chore: reset Ralph loop for visualization improvements phase
- IMPLEMENTATION_PLAN.md: new plan with Phases A-D (bug fixes, polish, new analytics, backend analytics)
- RALPH_PROMPT.md: updated focus to chart improvements
- progress.txt: reset with preserved architecture patterns
- guardrails.md: trimmed to relevant rules, added chart-specific guardrails
- ralph.ps1: updated banner text
2026-02-07 02:17:48 +00:00
Andrew Charlwood a943bee8f2 chore: cleanup archive, update ralph loop files, add analytics spec
- Remove old iteration logs and deprecated files from archive/can_delete/
- Update RALPH_PROMPT.md and guardrails.md for Phase 10+ work
- Update ralph.ps1 banner text
- Add AdditionalAnalytics.md chart specification
- Add run.bat convenience script
2026-02-07 02:10:03 +00:00
Andrew Charlwood 9171563651 docs: update progress.txt with iteration 47 (Task 11.4 complete — ALL TASKS DONE) 2026-02-07 00:39:35 +00:00
Andrew Charlwood caf7ada287 style: improve filter modal aesthetics for large screens (Task 11.4)
- Drug modal: size 70%, sm chips in 4-col SimpleGrid layout
- Trust modal: size lg, md chips in vertical Stack layout
- Directorate modal: size 70%, larger badges and text
- CSS: modal title full-width, chip nowrap, scroll padding
2026-02-07 00:37:47 +00:00
Andrew Charlwood 59f6cbafaa docs: update progress.txt with iteration 46 (Task 11.3 complete — chart fill height) 2026-02-07 00:32:30 +00:00
Andrew Charlwood 10d47d616c style: make Patient Pathways chart fill available viewport height (Task 11.3)
- Changed .main from min-height to height with overflow-y auto
- Added flex chain: #view-container → #patient-pathways-view → .chart-card
  → dcc.Loading wrapper → #chart-container → #pathway-chart
- All flex parents get min-height: 0 for proper flex shrinking
- dcc.Graph set to responsive=True with flex: 1 and minHeight: 0
- Trust Comparison view scrolls naturally via .main overflow-y auto
2026-02-07 00:31:47 +00:00
Andrew Charlwood ab62acf41d docs: update progress.txt with iteration 45 (Task 11.2 complete — TC chart sizing) 2026-02-07 00:25:58 +00:00
Andrew Charlwood a4059b5829 style: increase Trust Comparison chart height from 320px to 500px (Task 11.2)
Charts were overspilling 320px containers. Increased to 500px for
readability. Added overflow: hidden + min-height: 0 to .tc-chart-cell
to prevent any content leaking. Dashboard scrolls vertically, which
is acceptable for 6 readable charts.
2026-02-07 00:25:08 +00:00
Andrew Charlwood 4ec3e6b973 docs: update progress.txt with iteration 44 (Task 11.1 complete — Clear All button repositioned) 2026-02-07 00:20:39 +00:00
Andrew Charlwood 99ccddbb98 style: move Clear All button to left side next to filter buttons (Task 11.1)
Moved Clear All from right-aligned separate sibling into the
pathway-filters__buttons group. Removed justify-content: space-between
from .pathway-filters. Added thin vertical separator between
Directorates and Clear All for visual distinction.
2026-02-07 00:20:11 +00:00
Andrew Charlwood 2b997fbb4f docs: update progress.txt with iteration 43 (Task 10.11 complete — final integration) 2026-02-06 22:55:41 +00:00
Andrew Charlwood 5f890f2d93 docs: final integration verification + CLAUDE.md update for two-view architecture (Task 10.11) 2026-02-06 22:55:22 +00:00
Andrew Charlwood 552b949ed9 docs: update progress.txt with iteration 42 (Task 10.10 complete — CSS cleanup + polish) 2026-02-06 22:41:02 +00:00
Andrew Charlwood c5b6191a5b style: clean up dead CSS, add CSS variables, improve responsive rules (Task 10.10)
- Remove dead .kpi-row/.kpi-card CSS (KPI row replaced by header fraction KPIs)
- Remove dead .top-header__breadcrumb CSS (breadcrumb removed in 10.3)
- Remove dead .filter-select CSS (replaced by dcc.Dropdown)
- Remove dead .sidebar__item--disabled CSS (disabled items removed in restructure)
- Delete unused dash_app/components/kpi_row.py
- Add --sub-header-h and --header-total-h CSS variables
- Update .main and .sub-header to use CSS variables instead of hardcoded values
- Add responsive rules: header KPIs collapse at 1200px, hide at 768px
- Add responsive pathway-filters wrap at 768px
- Remove dead .kpi-row responsive rules
2026-02-06 22:39:48 +00:00
Andrew Charlwood ba9909f151 docs: update progress.txt with iteration 41 (Task 10.9 complete — pathway filter relocation) 2026-02-06 22:33:23 +00:00
Andrew Charlwood f1eecf88bf feat: scope pathway filters to Patient Pathways view with design-spec CSS (Task 10.9) 2026-02-06 22:32:02 +00:00
Andrew Charlwood 9c783a7e4e docs: update progress.txt with iteration 40 (Task 10.8 complete — TC 6-chart dashboard) 2026-02-06 22:24:47 +00:00
Andrew Charlwood ea6b9065bf feat: Trust Comparison 6-chart dashboard with real data (Task 10.8)
- Add 3 new visualization functions to plotly_generator.py:
  create_trust_market_share_figure, create_trust_heatmap_figure,
  create_trust_duration_figure
- Replace 6 placeholder callbacks in trust_comparison.py with real
  implementations using trust-comparison queries + figure builders
- Cost Waterfall reuses existing figure function via key mapping
- Dosing reuses existing create_dosing_figure with group_by="trust"
- Cost Effectiveness reuses existing function scoped to directorate
- All 6 charts respond to date filter and chart type toggle
- Validated with both directory (RHEUMATOLOGY) and indication (asthma)
2026-02-06 22:23:47 +00:00
Andrew Charlwood b52fc295de docs: update progress.txt with iteration 39 (Task 10.7 complete — TC landing page) 2026-02-06 22:16:09 +00:00
Andrew Charlwood 10739ca84d feat: Trust Comparison landing page + directorate selector (Task 10.7)
- Add get_directorate_summary() query for per-directorate patient/drug counts
- Create trust_comparison.py with landing grid and 6-chart dashboard layout
- Wire directorate card clicks and back button through app-state callbacks
- Add TC landing and dashboard CSS per Phase 10 design spec
- Placeholder charts for 6 dashboard graphs (filled in Task 10.8)
- Chart type toggle clears selected directorate when switching modes
2026-02-06 22:15:10 +00:00
Andrew Charlwood 04edf2cea5 docs: update progress.txt with iteration 38 (Task 10.6 complete — trust-comparison queries) 2026-02-06 22:05:31 +00:00
Andrew Charlwood 9d4e32910d feat: add 5 trust-comparison query functions for Phase 10.6
New per-trust-within-directorate queries:
- get_trust_market_share: drugs by trust within a directorate
- get_trust_cost_waterfall: cost per patient by trust
- get_trust_dosing: drug dosing intervals by trust
- get_trust_heatmap: trust x drug matrix for one directorate
- get_trust_durations: drug durations by trust

Also verified existing get_pathway_costs(directory=X) works for
directorate-scoped Cost Effectiveness (no new function needed).

Thin wrappers added in dash_app/data/queries.py.
2026-02-06 22:04:43 +00:00
Andrew Charlwood e123599312 docs: update progress.txt with iteration 37 (Task 10.5 complete — Patient Pathways 2-tab view) 2026-02-06 21:58:18 +00:00
Andrew Charlwood 979b79794c feat: reduce Patient Pathways to Icicle + Sankey tabs only (Task 10.5)
Removed 6 chart tabs (Market Share, Cost Effectiveness, Cost Waterfall,
Dosing, Heatmap, Duration) from the Patient Pathways tab bar. These will
reappear in the Trust Comparison dashboard (Task 10.8).

All _render_* helper functions preserved in chart.py for reuse.
2026-02-06 21:57:06 +00:00
Andrew Charlwood 0f1ae5dd2a docs: update progress.txt with iteration 36 (Task 10.4 complete — global filter sub-header) 2026-02-06 21:52:55 +00:00