Files
HighCostDrugsDemo/dash_app/app.py
T
Andrew Charlwood bdc1690f0f feat: add header and sidebar components for Dash layout (Task 2.1)
- header.py: NHS branded top bar with logo, title, breadcrumb,
  data freshness indicators (record count + last updated with IDs
  for callback updates)
- sidebar.py: Navigation with 7 items across Analysis/Reports
  sections, SVG icons via data URI, Drug Selection and Indications
  items have IDs for drawer open callbacks (Phase 4)
- app.py: Assembles header + sidebar + main content placeholder
- nhs.css: Added .sidebar__icon rule for img-based SVG icons
2026-02-06 13:13:03 +00:00

44 lines
1.2 KiB
Python

"""Dash application entry point with layout root and state stores."""
from dash import Dash, html, dcc
import dash_mantine_components as dmc
from dash_app.components.header import make_header
from dash_app.components.sidebar import make_sidebar
app = Dash(
__name__,
suppress_callback_exceptions=True,
)
app.layout = dmc.MantineProvider(
children=[
# State stores
dcc.Store(id="app-state", storage_type="session", data={
"chart_type": "directory",
"initiated": "all",
"last_seen": "6mo",
"date_filter_id": "all_6mo",
"selected_drugs": [],
"selected_directorates": [],
}),
dcc.Store(id="chart-data", storage_type="memory"),
dcc.Store(id="reference-data", storage_type="session"),
# Page structure
make_header(),
make_sidebar(),
html.Main(
className="main",
children=[
html.H1("HCD Analysis", style={"color": "#003087"}),
html.P(
"Layout scaffolding with header and sidebar. "
"KPIs, filter bar, and chart card will be added in Task 2.2."
),
],
),
],
)
server = app.server