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
This commit is contained in:
@@ -1,11 +1,13 @@
|
||||
"""Chart card component — tab bar, header, and dcc.Graph for charts."""
|
||||
from dash import html, dcc
|
||||
import dash_mantine_components as dmc
|
||||
|
||||
|
||||
# Patient Pathways view: only Icicle + Sankey
|
||||
# Patient Pathways view: Icicle, Sankey, Heatmap
|
||||
TAB_DEFINITIONS = [
|
||||
("icicle", "Icicle"),
|
||||
("sankey", "Sankey"),
|
||||
("heatmap", "Heatmap"),
|
||||
]
|
||||
|
||||
# Full set retained for Trust Comparison dashboard (Phase 10.8)
|
||||
@@ -69,6 +71,23 @@ def make_chart_card():
|
||||
),
|
||||
]
|
||||
),
|
||||
# Heatmap metric toggle — visible only when heatmap tab active
|
||||
html.Div(
|
||||
id="heatmap-metric-wrapper",
|
||||
style={"display": "none"},
|
||||
children=[
|
||||
dmc.SegmentedControl(
|
||||
id="heatmap-metric-toggle",
|
||||
data=[
|
||||
{"value": "patients", "label": "Patients"},
|
||||
{"value": "cost", "label": "Cost"},
|
||||
{"value": "cost_pp_pa", "label": "Cost p.a."},
|
||||
],
|
||||
value="patients",
|
||||
size="xs",
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
# Chart area with loading spinner
|
||||
|
||||
Reference in New Issue
Block a user