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.
- 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
- 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
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.
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.
- 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)
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.
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.
Extract chart type toggle and date filter dropdowns from filter_bar.py
into a new sub-header component. Sub-header is fixed-position below the
main header, visible across both views. Filter bar now contains only
drug/trust/directorate buttons for Patient Pathways view.
All 8 chart tabs verified — queries, figures, and filter dispatch
tested in both directory and indication modes. CLAUDE.md updated
with new chart types, query functions, and parsing utilities.
Phase 9 completion criteria all satisfied.
- Create create_cost_effectiveness_figure() in plotly_generator.py
Horizontal lollipop chart with dot size by patient count,
colour gradient green→amber→red by cost, retention annotations
- Fix calculate_retention_rate() to accept both 'value' and 'patients' keys
- Add _render_cost_effectiveness() dispatch in chart.py callbacks
- Wire into tab switching for active_tab='cost-effectiveness'
- create_market_share_figure() in src/visualization/plotly_generator.py
- Horizontal stacked bar chart: directorates × drugs with patient %
- Wire into tab dispatch via _render_market_share() helper in chart.py
- Responds to date, chart type, trust, and directorate filters
New query functions in src/data_processing/pathway_queries.py:
- get_drug_market_share: Level 3 drug nodes grouped by directory
- get_pathway_costs: Level 4+ pathway nodes with cost_pp_pa
- get_cost_waterfall: Directorate cost per patient from level 3 aggregation
- get_drug_transitions: Sankey source/target drug transitions with ordinal line labels
- get_dosing_intervals: Parsed average_spacing by trust/directory
- get_drug_directory_matrix: Directory x drug pivot with patient/cost metrics
- get_treatment_durations: Weighted avg_days by drug within directorates
Thin wrappers added in dash_app/data/queries.py for all 7 functions.