7aa49b0d6b
- Remove non-functional sidebar items: Cost Analysis, Export Data - Remove filter trigger items: Drug/Trust/Directory Selection, Indications - Add Chart Views section: Icicle Chart (active), Sankey Diagram (disabled), Timeline (disabled) - Remove tab row from chart_card.py (chart view selection now in sidebar) - Remove open_drawer callback (sidebar no longer has filter triggers) - Add .sidebar__item--disabled CSS class
62 lines
2.2 KiB
Python
62 lines
2.2 KiB
Python
"""Chart card component — header and dcc.Graph for icicle chart."""
|
|
from dash import html, dcc
|
|
|
|
|
|
def make_chart_card():
|
|
"""Return a chart card matching 01_nhs_classic.html structure.
|
|
|
|
Contains:
|
|
- Header with title and dynamic subtitle (hierarchy label)
|
|
- dcc.Loading wrapper around dcc.Graph for loading spinner
|
|
Chart view selection (icicle/sankey/timeline) is in the sidebar.
|
|
"""
|
|
return html.Section(
|
|
className="chart-card",
|
|
**{"aria-label": "Patient pathway chart"},
|
|
children=[
|
|
# Card header
|
|
html.Div(
|
|
className="chart-card__header",
|
|
children=[
|
|
html.Div(
|
|
children=[
|
|
html.Div(
|
|
"Patient Pathway Visualization",
|
|
className="chart-card__title",
|
|
),
|
|
html.Div(
|
|
"Trust \u2192 Directorate \u2192 Drug \u2192 Patient Pathway",
|
|
className="chart-card__subtitle",
|
|
id="chart-subtitle",
|
|
),
|
|
]
|
|
),
|
|
],
|
|
),
|
|
# Chart area with loading spinner
|
|
dcc.Loading(
|
|
type="circle",
|
|
color="#005EB8",
|
|
children=[
|
|
html.Div(
|
|
id="chart-container",
|
|
children=[
|
|
dcc.Graph(
|
|
id="pathway-chart",
|
|
style={"minHeight": "500px", "flex": "1"},
|
|
config={
|
|
"displayModeBar": True,
|
|
"displaylogo": False,
|
|
"modeBarButtonsToRemove": [
|
|
"lasso2d",
|
|
"select2d",
|
|
],
|
|
},
|
|
),
|
|
],
|
|
),
|
|
],
|
|
),
|
|
],
|
|
)
|