root = Card([header, kpiRow, enrollmentCard, applicationsCard, tuitionCard, courseCard, facultyCard, riskCallout, scholarshipCard, housingCard, eventsCard, givingCard, departmentCard, compareCard, waitlistCard, approveDialog, messageCard], "card", "column", "l")
header = CardHeader("University Overview", "Spring 2025 · Northwood University")
kpiRow = Card([enrollStat, tuitionStat, acceptStat], "sunk", "row", "l")
enrollStat = Card([enrollNum, enrollLabel], "clear")
enrollNum = TextContent("22,850", "large-heavy")
enrollLabel = TextContent("Total enrollment", "small")
tuitionStat = Card([tuitionNum, tuitionLabel], "clear")
tuitionNum = TextContent("$342.8M", "large-heavy")
tuitionLabel = TextContent("Tuition revenue FY25", "small")
acceptStat = Card([acceptNum, acceptLabel, acceptProgress], "clear")
acceptNum = TextContent("68%", "large-heavy")
acceptLabel = TextContent("Acceptance rate", "small")
acceptProgress = Progress(68)
enrollmentCard = Card([enrollmentHeading, enrollChart], "sunk")
enrollmentHeading = Heading("Enrollment trend", "h3")
enrollChart = AreaChart(["2020", "2021", "2022", "2023", "2024"], [enrollSeries], "linear", "Year", "Students")
enrollSeries = Series("Total enrollment", [18200, 19300, 20150, 21400, 22850])
applicationsCard = Card([applicationsHeading, applicationsChart], "sunk")
applicationsHeading = Heading("Applications by program", "h3")
applicationsChart = HorizontalBarChart(["Computer Science", "Business", "Engineering", "Psychology", "Biology", "Design"], [appSeries], "grouped", "Applications", "Program")
appSeries = Series("Applications", [1240, 980, 760, 540, 480, 430])
tuitionCard = Card([tuitionHeading, tuitionChart], "sunk")
tuitionHeading = Heading("Tuition revenue", "h3")
tuitionChart = BarChart(["FY21", "FY22", "FY23", "FY24", "FY25"], [tuitionSeries], "grouped", "Year", "USD ($M)")
tuitionSeries = Series("Tuition revenue", [298.4, 312.1, 325.6, 334.2, 342.8])
courseCard = Card([courseHeading, courseTable], "sunk")
courseHeading = Heading("Course capacity", "h3")
courseTable = Table([courseCol, enrolledCol, capCol, fillCol])
courseCol = Col("Course", ["CS 101", "BUS 220", "ENG 110", "PSY 240", "BIO 130", "DES 200"])
enrolledCol = Col("Enrolled", [95, 120, 88, 72, 64, 55])
capCol = Col("Capacity", [100, 120, 90, 80, 80, 60])
fillCol = Col("Fill", ["95%", "100%", "98%", "90%", "80%", "92%"])
facultyCard = Card([facultyHeading, facultyChart], "sunk")
facultyHeading = Heading("Teaching load by faculty", "h3")
facultyChart = HorizontalBarChart(["Dr. Alvarez", "Dr. Chen", "Dr. Osei", "Dr. Patel", "Dr. Whitfield"], [facultySeries], "grouped", "Faculty", "Courses taught")
facultySeries = Series("Courses", [4, 5, 3, 6, 4])
riskCallout = Callout("error", "Academic risk", "142 students are below 2.0 GPA this term. 38 are first-year students.")
scholarshipCard = Card([scholarshipHeading, scholarshipProgress], "sunk")
scholarshipHeading = Heading("Scholarship budget", "h3")
scholarshipProgress = Progress(74, "$18.4M of $25M used")
housingCard = Card([housingHeading, housingProgress], "sunk")
housingHeading = Heading("Housing occupancy", "h3")
housingProgress = Progress(93, "93% occupied")
eventsCard = Card([eventsHeading, eventsTable], "sunk")
eventsHeading = Heading("Campus events this month", "h3")
eventsTable = Table([eventNameCol, eventDateCol, eventLocationCol])
eventNameCol = Col("Event", ["Spring Career Fair", "Guest Lecture: Dr. Fields", "Basketball Championship", "Research Symposium", "Earth Day Festival"])
eventDateCol = Col("Date", ["Apr 3", "Apr 10", "Apr 14", "Apr 22", "Apr 25"])
eventLocationCol = Col("Location", ["Student Union", "Auditorium", "Field House", "Science Hall", "Quad"])
givingCard = Card([givingHeading, givingChart], "sunk")
givingHeading = Heading("Alumni giving", "h3")
givingChart = BarChart(["2021", "2022", "2023", "2024"], [givingSeries], "grouped", "Year", "USD ($M)")
givingSeries = Series("Alumni giving", [24.1, 27.6, 29.8, 33.2])
departmentCard = Card([departmentHeading, departmentForm], "sunk")
departmentHeading = Heading("Focus on a department", "h3")
departmentForm = Form("department-focus", deptButtons, [deptField])
deptField = FormControl("Department", deptSelect)
deptSelect = Select("department", [deptCS, deptBus, deptEng, deptPsy], "Select a department")
deptCS = SelectItem("cs", "Computer Science")
deptBus = SelectItem("business", "Business School")
deptEng = SelectItem("engineering", "Engineering")
deptPsy = SelectItem("psychology", "Psychology")
deptButtons = Buttons([deptBtn])
deptBtn = Button("Focus department")
compareCard = Card([compareHeading, compareTable], "sunk")
compareHeading = Heading("This semester vs last", "h3")
compareTable = Table([metricCol, lastCol, thisCol, changeCol])
metricCol = Col("Metric", ["Enrollment", "Credit hours", "Avg GPA", "Retention", "New admits"])
lastCol = Col("Spring 2024", [22100, 284000, 3.12, "88%", 1890])
thisCol = Col("Spring 2025", [22850, 291500, 3.18, "89%", 1950])
changeCol = Col("Change", ["+3.4%", "+2.6%", "+0.06", "+1 pt", "+3.2%"])
waitlistCard = Card([waitlistHeading, waitlistChart], "sunk")
waitlistHeading = Heading("Waitlisted students by program", "h3")
waitlistChart = HorizontalBarChart(["Computer Science", "Business", "Engineering", "Psychology", "Biology"], [waitlistSeries], "grouped", "Program", "Waitlisted students")
waitlistSeries = Series("Waitlist", [85, 42, 67, 23, 18])
approveDialog = AlertDialogBlock("Approve new course", "CS 405: Applied Machine Learning", "Proposed by Dr. Rivera · 3 credits · Projected enrollment 48. Approve this course?", "Approve", "Keep pending")
messageCard = Card([messageHeading, messageForm], "sunk")
messageHeading = Heading("Message a student group", "h3")
messageForm = Form("group-message", messageButtons, [groupField, messageField])
groupField = FormControl("Student group", groupSelect)
groupSelect = Select("group", [groupEng, groupCS, groupAth], "Select a group")
groupEng = SelectItem("engineering", "Engineering Society")
groupCS = SelectItem("cs-club", "Computer Science Club")
groupAth = SelectItem("athletics", "Varsity Athletics")
messageField = FormControl("Message", messageTextarea)
messageTextarea = TextArea("message", "Type your message…", 4)
messageButtons = Buttons([sendBtn])
sendBtn = Button("Send message")