From 979b79794c0fb5ab27da97b6a0627948d286d3c7 Mon Sep 17 00:00:00 2001 From: Andrew Charlwood Date: Fri, 6 Feb 2026 21:57:06 +0000 Subject: [PATCH] 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. --- IMPLEMENTATION_PLAN.md | 8 ++++---- dash_app/callbacks/chart.py | 10 ++++++++-- dash_app/components/chart_card.py | 9 ++++++++- 3 files changed, 20 insertions(+), 7 deletions(-) diff --git a/IMPLEMENTATION_PLAN.md b/IMPLEMENTATION_PLAN.md index d044fdb..1af4ffb 100644 --- a/IMPLEMENTATION_PLAN.md +++ b/IMPLEMENTATION_PLAN.md @@ -503,10 +503,10 @@ Additionally: KPI row removed, fraction KPIs moved to header, global filter sub- - **Checkpoint**: Global sub-header renders below main header, date/chart-type controls work, visible in both views ✓ ### 10.5 Patient Pathways view — reduce to Icicle + Sankey -- [ ] Create a Patient Pathways view component (or update chart_card.py) with only 2 tabs: Icicle, Sankey -- [ ] Remove Market Share, Cost Waterfall, Dosing, Heatmap, Duration, Cost Effectiveness from this view's tab bar -- [ ] Existing filter → chart-data → chart callback pipeline stays for these 2 tabs -- [ ] This view is shown when `active_view == "patient-pathways"` +- [x] Create a Patient Pathways view component (or update chart_card.py) with only 2 tabs: Icicle, Sankey +- [x] Remove Market Share, Cost Waterfall, Dosing, Heatmap, Duration, Cost Effectiveness from this view's tab bar +- [x] Existing filter → chart-data → chart callback pipeline stays for these 2 tabs +- [x] This view is shown when `active_view == "patient-pathways"` - **Checkpoint**: Patient Pathways shows only Icicle + Sankey tabs, both still work with all existing filters ### 10.6 Trust Comparison query functions diff --git a/dash_app/callbacks/chart.py b/dash_app/callbacks/chart.py index 910d5e2..a85c2d9 100644 --- a/dash_app/callbacks/chart.py +++ b/dash_app/callbacks/chart.py @@ -1,4 +1,10 @@ -"""Callbacks for tab switching, pathway data loading, and chart rendering.""" +"""Callbacks for tab switching, pathway data loading, and chart rendering. + +NOTE: The _render_* helper functions for all 8 chart types are preserved here. +Patient Pathways view uses only icicle + sankey tabs. The remaining 6 chart +renderers (_render_market_share, _render_cost_waterfall, etc.) will be reused +by the Trust Comparison dashboard in Task 10.8. +""" import logging from dash import Input, Output, State, ctx, no_update @@ -8,7 +14,7 @@ from dash_app.components.chart_card import TAB_DEFINITIONS log = logging.getLogger(__name__) -# Tab IDs for callback inputs +# Tab IDs for callback inputs — matches Patient Pathways tab bar (2 tabs) _TAB_IDS = [f"tab-{tab_id}" for tab_id, _ in TAB_DEFINITIONS] diff --git a/dash_app/components/chart_card.py b/dash_app/components/chart_card.py index 9eedced..febf464 100644 --- a/dash_app/components/chart_card.py +++ b/dash_app/components/chart_card.py @@ -2,7 +2,14 @@ from dash import html, dcc +# Patient Pathways view: only Icicle + Sankey TAB_DEFINITIONS = [ + ("icicle", "Icicle"), + ("sankey", "Sankey"), +] + +# Full set retained for Trust Comparison dashboard (Phase 10.8) +ALL_TAB_DEFINITIONS = [ ("icicle", "Icicle"), ("market-share", "Market Share"), ("cost-effectiveness", "Cost Effectiveness"), @@ -18,7 +25,7 @@ def make_chart_card(): """Return a chart card with tab bar and dcc.Graph. Contains: - - Tab bar with 8 chart tabs (Icicle active by default) + - Tab bar with 2 chart tabs (Icicle active by default, Sankey) - Header with title and dynamic subtitle - dcc.Loading wrapper around dcc.Graph for loading spinner """