root = Card([header, hubCard, kpiCard, onTimeCard, flightTableCard, delayCallout, gateChangesCard, crewCard, weatherCallout, loadCard, connectionsCard, rebookCard, cancellationsCard, turnaroundCard, followUps], "card", "column", "l")
header = CardHeader("Hub Operations Desk", "KATL · Thursday, 14:30 ET · Shift B")
hubCard = Card([hubHeader, hubForm], "sunk", "column", "m")
hubHeader = CardHeader("Switch hub", "View operations at another airport")
hubForm = Form("hub-select", hubButtons, [hubField])
hubField = FormControl("Hub", hubSelect, "Current: ATL — Hartsfield-Jackson")
hubSelect = Select("hub", [atlItem, dfwItem, ordItem, denItem], "Choose a hub")
atlItem = SelectItem("ATL", "ATL — Atlanta")
dfwItem = SelectItem("DFW", "DFW — Dallas/Fort Worth")
ordItem = SelectItem("ORD", "ORD — Chicago O'Hare")
denItem = SelectItem("DEN", "DEN — Denver")
hubButtons = Buttons([hubGoBtn])
hubGoBtn = Button("View hub", null, "primary")
kpiCard = Card([kpiHeader, kpiTable], "sunk", "column", "m")
kpiHeader = CardHeader("At a glance", "Key operating metrics today")
kpiTable = Table([kpiMetricCol, kpiValueCol])
kpiMetricCol = Col("Metric", ["On-time performance", "Avg passenger load", "Avg turnaround", "Cancellations"])
kpiValueCol = Col("Value", ["87%", "78%", "42 min", "4 flights"])
onTimeCard = Card([onTimeHeader, onTimeChart, onTimeText], "sunk", "column", "m")
onTimeHeader = CardHeader("On-time performance today", "Departures from KATL")
onTimeChart = SingleStackedBarChart(["On time", "Delayed"], [82, 12])
onTimeText = TextContent("87% of 94 departures left on time. Average delay among delayed flights is 38 minutes.", "small")
flightTableCard = Card([flightHeader, flightTable], "sunk", "column", "m")
flightHeader = CardHeader("Departures", "Flight number · route · gate · status")
flightTable = Table([flightCol, routeCol, gateCol, statusCol])
flightCol = Col("Flight", ["DL 451", "UA 1188", "AA 902", "WN 335", "DL 872", "AA 118", "DL 209", "UA 447"])
routeCol = Col("Route", ["ATL → JFK", "ATL → ORD", "ATL → DFW", "ATL → DEN", "ATL → LAX", "ATL → MIA", "ATL → BOS", "ATL → SFO"])
gateCol = Col("Gate", ["C4", "C4", "B9", "A15", "C9", "C6", "A3", "—"])
statusCol = Col("Status", ["Delayed", "On Time", "Boarding", "On Time", "Delayed", "On Time", "Delayed", "Cancelled"])
delayCallout = Callout("warning", "3 flights delayed", "DL 451 to JFK, DL 872 to LAX, and DL 209 to BOS are running 35–45 minutes late. Ground crew has been reassigned to cover gate moves.")
gateChangesCard = Card([gateHeader, gateList], "sunk", "column", "m")
gateHeader = CardHeader("Recent gate changes", "Last 30 minutes")
gateList = ListBlock([gateChange1, gateChange2, gateChange3], "number")
gateChange1 = ListItem("DL 451", "B12 → C4 · 14:20")
gateChange2 = ListItem("AA 902", "B7 → B9 · 14:05")
gateChange3 = ListItem("WN 335", "A11 → A15 · 13:50")
crewCard = Card([crewHeader, crewList], "sunk", "column", "m")
crewHeader = CardHeader("Crews available for reassignment", "Qualified and on standby at KATL")
crewList = ListBlock([crew1, crew2, crew3], "number")
crew1 = ListItem("CM-221", "Flight Attendant · Available now")
crew2 = ListItem("CM-118", "First Officer · Available 15:00")
crew3 = ListItem("CM-305", "Flight Attendant · Available 15:30")
weatherCallout = Callout("info", "Weather advisory: thunderstorm watch", "Possible ground stop 16:00–18:00 ET. Winds gusting to 35 kt. Monitor inbound flow and gate assignments.")
loadCard = Card([loadHeader, loadProgress, loadText], "sunk", "column", "m")
loadHeader = CardHeader("Average passenger load today", "All departures")
loadProgress = Progress(78, "78% average load")
loadText = TextContent("Load factor ranges from 61% to 94% by route. Heaviest loads to JFK, LAX, and BOS.", "small")
connectionsCard = Card([connectionsHeader, connectionsTable], "sunk", "column", "m")
connectionsHeader = CardHeader("Connections at risk", "Flights with tight connections at KATL")
connectionsTable = Table([paxCol, connectionCol, routingCol, connectTimeCol, riskCol])
paxCol = Col("Pax", [12, 8, 5, 3])
connectionCol = Col("Connection", ["DL 108 → JFK", "UA 537 → ORD", "AA 1334 → DFW", "WN 672 → DEN"])
routingCol = Col("Routing", ["DL 451 → DL 108", "UA 1188 → UA 537", "AA 902 → AA 1334", "WN 335 → WN 672"])
connectTimeCol = Col("Connection time", ["40 min", "35 min", "25 min", "30 min"])
riskCol = Col("Risk", ["High", "Medium", "High", "Medium"])
rebookCard = Card([rebookHeader, rebookForm], "sunk", "column", "m")
rebookHeader = CardHeader("Rebook affected passengers", "For delayed and cancelled connections")
rebookForm = Form("rebook-form", rebookButtons, [locatorField, destinationField])
locatorField = FormControl("Passenger locator", locatorInput, "e.g., KX7M2N")
locatorInput = Input("locator", "Enter locator", "text")
destinationField = FormControl("Preferred destination", destinationSelect)
destinationSelect = Select("destination", [destJFK, destSFO, destLAX, destORD], "Select airport")
destJFK = SelectItem("JFK", "New York JFK")
destSFO = SelectItem("SFO", "San Francisco")
destLAX = SelectItem("LAX", "Los Angeles")
destORD = SelectItem("ORD", "Chicago O'Hare")
rebookButtons = Buttons([rebookBtn, standbyBtn])
rebookBtn = Button("Rebook passenger", null, "primary")
standbyBtn = Button("Add to standby", null, "secondary")
cancellationsCard = Card([cancellationsHeader, cancellationsList], "sunk", "column", "m")
cancellationsHeader = CardHeader("Cancellations today", "4 flights cancelled at KATL")
cancellationsList = ListBlock([cancel1, cancel2, cancel3, cancel4], "number")
cancel1 = ListItem("UA 447", "ATL → SFO · 10:05 · Crew availability")
cancel2 = ListItem("DL 620", "ATL → SEA · 11:20 · Weather")
cancel3 = ListItem("WN 118", "ATL → LAS · 12:00 · Mechanical")
cancel4 = ListItem("UA 223", "ATL → IAH · 13:15 · Crew availability")
turnaroundCard = Card([turnaroundHeader, turnaroundText, turnaroundChart], "sunk", "column", "m")
turnaroundHeader = CardHeader("Average turnaround time", "Gate to gate")
turnaroundText = TextContent("Average turnaround is 42 minutes, 7 minutes above plan.", "default")
turnaroundChart = HorizontalBarChart(["DL", "UA", "AA", "WN"], [turnSeries], "grouped", "Airline", "Minutes")
turnSeries = Series("Avg turnaround", [38, 46, 41, 43])
followUps = FollowUpBlock([f1, f2])
f1 = FollowUpItem("Show delayed flight details")
f2 = FollowUpItem("Rebook passengers on UA 447")