root = Card([header, exportActions, oeeHeader, oeeProgress, oeeDetail, targetHeader, targetChart, targetText, linesHeader, linesList, defectHeader, defectChart, downtimeHeader, downtimeChart, maintHeader, maintTable, stockHeader, stockTable, suppliersHeader, suppliersList, shiftHeader, shiftChart, safetyHeader, safetyText, qualityHeader, qualityTable, energyHeader, energyText, woHeader, woTable, scheduleHeader, maintForm, focusHeader, focusRadio, andonHeader, andonList], "card", "column", "l")
header = CardHeader("Factory Floor Supervisor Console", "Plant 1 · 14:32 · Shift B")
exportActions = Buttons([exportBtn])
exportBtn = Button("Export shift report", null, "primary")
oeeHeader = CardHeader("Overall Equipment Effectiveness", "Today")
oeeProgress = Progress(74, "OEE 74.2%")
oeeDetail = TextContent("Availability **91%** · Performance **87%** · Quality **94%**")
targetHeader = CardHeader("Units Produced vs Target", "Today")
targetChart = BarChart(["Produced", "Target"], [unitsSeries])
unitsSeries = Series("Units", [4820, 5400])
targetText = TextContent("**4,820** produced / **5,400** target · **89%** of plan")
linesHeader = CardHeader("Production Lines", "Rate and status")
linesList = ListBlock([lineAItem, lineBItem, lineCItem, lineDItem], "number")
lineAItem = ListItem("Line A", "Rate 96% · Running · Product P-100")
lineBItem = ListItem("Line B", "Rate 88% · Running · Product P-210")
lineCItem = ListItem("Line C", "Rate 0% · Down · Changeover")
lineDItem = ListItem("Line D", "Rate 71% · Running slow · Material wait")
defectHeader = CardHeader("Defect Rate", "Past month")
defectChart = LineChart(["W1", "W2", "W3", "W4"], [defectSeries], "linear", "Week", "Defect %")
defectSeries = Series("Defect %", [1.8, 1.5, 1.9, 1.2])
downtimeHeader = CardHeader("Downtime by Cause", "This week")
downtimeChart = PieChart(["Changeover", "Breakdown", "Material wait", "Quality checks"], [86, 42, 28, 15])
maintHeader = CardHeader("Machines Due for Maintenance")
maintTable = Table([maintMachineCol, maintDueCol, maintPriorityCol])
maintMachineCol = Col("Machine", ["Press 3", "Lathe 7", "CNC 2", "Conveyor 4"])
maintDueCol = Col("Due", ["Today", "Tomorrow", "Jun 14", "Jun 15"])
maintPriorityCol = Col("Priority", ["High", "Medium", "High", "Low"])
stockHeader = CardHeader("Raw Material Stock", "Steel · Resin · Packaging")
stockTable = Table([stockMatCol, stockLevelCol, stockReorderCol])
stockMatCol = Col("Material", ["Steel coil", "Resin granulate", "Packaging cartons"])
stockLevelCol = Col("Stock", ["42 t", "18 t", "9,600 units"])
stockReorderCol = Col("Reorder level", ["30 t", "25 t", "8,000 units"])
suppliersHeader = CardHeader("Supplier Deliveries", "Due this week")
suppliersList = ListBlock([supplier1, supplier2, supplier3], "number")
supplier1 = ListItem("Steelworks Nord", "Steel coil · Due Fri")
supplier2 = ListItem("PolyChem", "Resin granulate · Due Thu")
supplier3 = ListItem("PackPlus", "Cartons · Due Wed")
shiftHeader = CardHeader("Shift Output Comparison", "Today")
shiftChart = BarChart(["Morning", "Afternoon", "Night"], [shiftSeries])
shiftSeries = Series("Output", [1920, 1740, 1160])
safetyHeader = CardHeader("Safety", "Year to date")
safetyText = TextContent("Incidents this year: **12** · Days since last incident: **203**")
qualityHeader = CardHeader("Batches on Quality Hold")
qualityTable = Table([batchIdCol, batchProductCol, batchReasonCol])
batchIdCol = Col("Batch", ["B-1182", "B-1187", "B-1190"])
batchProductCol = Col("Product", ["P-100", "P-210", "P-310"])
batchReasonCol = Col("Reason", ["Dimensional check", "Color variance", "Moisture limit"])
energyHeader = CardHeader("Energy Use", "Today")
energyText = TextContent("**38.4 MWh** · 3.1% below daily plan")
woHeader = CardHeader("Open Work Orders", "By priority")
woTable = Table([woIdCol, woLineCol, woTaskCol, woPriorityCol])
woIdCol = Col("WO #", ["WO-2451", "WO-2452", "WO-2453", "WO-2454"])
woLineCol = Col("Line", ["C", "A", "B", "D"])
woTaskCol = Col("Task", ["Replace press die", "Calibrate sensors", "Lubricate conveyor", "Inspect safety guard"])
woPriorityCol = Col("Priority", ["Critical", "High", "Medium", "Low"])
scheduleHeader = CardHeader("Schedule Maintenance", "Machine and date")
maintForm = Form("schedule-maintenance", maintButtons, [machineField, dateField])
machineField = FormControl("Machine", machineSelect)
machineSelect = Select("machine", [machineOption1, machineOption2, machineOption3], "Select machine")
machineOption1 = SelectItem("press-3", "Press 3")
machineOption2 = SelectItem("lathe-7", "Lathe 7")
machineOption3 = SelectItem("cnc-2", "CNC 2")
dateField = FormControl("Date", datePicker)
datePicker = DatePicker("maintenance-date", "single")
maintButtons = Buttons([maintSubmitBtn])
maintSubmitBtn = Button("Schedule maintenance", null, "primary")
focusHeader = CardHeader("Focus on One Line")
focusRadio = RadioGroup("focus_line", [focusAll, focusA, focusB, focusC], "all")
focusAll = RadioItem("All lines", "Show entire floor", "all")
focusA = RadioItem("Line A", "Focus machines, orders and alerts on Line A", "A")
focusB = RadioItem("Line B", "Focus machines, orders and alerts on Line B", "B")
focusC = RadioItem("Line C", "Focus machines, orders and alerts on Line C", "C")
andonHeader = CardHeader("Live Andon Alerts", "Updated just now")
andonList = ListBlock([andon1, andon2, andon3], "number")
andon1 = ListItem("Line C · 13:42", "Press stopped — operator pulled andon")
andon2 = ListItem("Line D · 13:55", "Material feed jam — awaiting setup")
andon3 = ListItem("Line B · 14:05", "Sensor alarm — monitoring")