root = Card([header, deptFilter, enrollmentCard, applicationsCard, acceptanceCard, tuitionCard, courseFillCard, teachingLoadCard, riskCard, scholarshipCard, housingCard, eventsCard, givingCard, semesterCompareCard, waitlistCard, approveCourseCard, messageCard, followups])
header = CardHeader("University Administrator Overview", "Spring 2025 semester")
deptFilter = Form("department-filter", filterButtons, [deptField])
deptField = FormControl("Focus on department", deptSelect)
deptSelect = Select("department", [deptAll, deptEng, deptBus, deptSci, deptHum], "All departments")
deptAll = SelectItem("all", "All Departments")
deptEng = SelectItem("eng", "Engineering")
deptBus = SelectItem("bus", "Business")
deptSci = SelectItem("sci", "Sciences")
deptHum = SelectItem("hum", "Humanities")
filterButtons = Buttons([applyFilter])
applyFilter = Button("Apply filter")
enrollmentCard = Card([enrollHeader, enrollChart], "card", "column", "m")
enrollHeader = CardHeader("Total Enrollment", "Five-year trend")
enrollChart = LineChart(["2021", "2022", "2023", "2024", "2025"], [enrollSeries], "linear", "Year", "Students")
enrollSeries = Series("Enrollment", [18200, 19400, 20800, 22100, 23500])
applicationsCard = Card([appHeader, appChart], "card", "column", "m")
appHeader = CardHeader("Applications by Program", "Spring 2025")
appChart = HorizontalBarChart(["Engineering", "Business", "Sciences", "Humanities"], [appSeries], "grouped", "Applications", "Program")
appSeries = Series("Applications", [3200, 2800, 2100, 1500])
acceptanceCard = Card([acceptHeader, acceptCallout], "card", "column", "m")
acceptHeader = CardHeader("Acceptance Rate", "Spring 2025")
acceptCallout = Callout("info", "48% overall", "Acceptance rate across all programs, down 2% from last semester.")
tuitionCard = Card([tuitionHeader, tuitionCallout], "card", "column", "m")
tuitionHeader = CardHeader("Tuition Revenue", "This year")
tuitionCallout = Callout("success", "$412M collected", "Total tuition revenue for 2024-25 academic year.")
courseFillCard = Card([fillHeader, fillChart], "card", "column", "m")
fillHeader = CardHeader("Course Offerings Fill Rate", "Spring 2025")
fillChart = BarChart(["CS 101", "MATH 210", "BUS 305", "BIO 120", "ENG 210"], [fillSeries], "grouped", "Course", "Seats filled")
fillSeries = Series("Enrolled", [120, 85, 60, 95, 45])
teachingLoadCard = Card([loadHeader, loadTable], "card", "column", "m")
loadHeader = CardHeader("Teaching Load by Faculty", "Spring 2025")
loadTable = Table([facultyCol, coursesCol, studentsCol])
facultyCol = Col("Faculty", ["Dr. Patel", "Dr. Nguyen", "Dr. Lee", "Dr. Garcia"])
coursesCol = Col("Courses", [3, 4, 2, 5])
studentsCol = Col("Students", [210, 340, 150, 420])
riskCard = Card([riskHeader, riskList], "card", "column", "m")
riskHeader = CardHeader("Students at Academic Risk", "Spring 2025")
riskList = ListBlock([riskItem1, riskItem2, riskItem3], "number")
riskItem1 = ListItem("1,240 students", "Below 2.0 GPA — 5.3% of total enrollment")
riskItem2 = ListItem("310 students", "On academic probation")
riskItem3 = ListItem("85 students", "At risk of dismissal")
scholarshipCard = Card([scholHeader, scholProgress], "card", "column", "m")
scholHeader = CardHeader("Scholarship Budget", "2024-25")
scholProgress = Progress(72, "72% of $18M budget used")
housingCard = Card([housingHeader, housingChart], "card", "column", "m")
housingHeader = CardHeader("Housing Occupancy", "Spring 2025")
housingChart = SingleStackedBarChart(["Dorms", "Apartments", "Family Housing"], [92, 78, 64])
eventsCard = Card([eventsHeader, eventsList], "card", "column", "m")
eventsHeader = CardHeader("Campus Events This Month", "April 2025")
eventsList = ListBlock([event1, event2, event3], "image")
event1 = ListItem("Spring Career Fair", "Apr 12 — Student Union", [["https://picsum.photos/seed/career/100/100"]])
event2 = ListItem("Research Symposium", "Apr 18 — Science Hall", [["https://picsum.photos/seed/research/100/100"]])
event3 = ListItem("Alumni Gala", "Apr 25 — Main Quad", [["https://picsum.photos/seed/gala/100/100"]])
givingCard = Card([givingHeader, givingChart], "card", "column", "m")
givingHeader = CardHeader("Alumni Giving", "Four-year trend")
givingChart = LineChart(["2021", "2022", "2023", "2024"], [givingSeries], "linear", "Year", "Donors")
givingSeries = Series("Donors", [8200, 9100, 10400, 11800])
semesterCompareCard = Card([semHeader, semChart], "card", "column", "m")
semHeader = CardHeader("This Semester vs. Last", "Fall 2024 vs. Spring 2025")
semChart = BarChart(["Enrollment", "Applications", "Tuition ($M)"], [semFall, semSpring], "grouped", "Metric", "Value")
semFall = Series("Fall 2024", [22100, 18500, 198])
semSpring = Series("Spring 2025", [23500, 9600, 214])
waitlistCard = Card([waitHeader, waitTable], "card", "column", "m")
waitHeader = CardHeader("Waitlisted Students per Program", "Spring 2025")
waitTable = Table([programCol, waitCol])
programCol = Col("Program", ["Engineering", "Business", "Sciences", "Humanities"])
waitCol = Col("Waitlisted", [420, 310, 180, 95])
approveCourseCard = Card([approveHeader, approveForm], "card", "column", "m")
approveHeader = CardHeader("Approve New Course", "Pending approval")
approveForm = Form("approve-course", approveButtons, [courseNameField, courseDeptField, courseCreditsField])
courseNameField = FormControl("Course name", courseNameInput)
courseNameInput = Input("course_name", "AI Ethics & Society")
courseDeptField = FormControl("Department", courseDeptSelect)
courseDeptSelect = Select("course_dept", [courseDeptSci, courseDeptHum], "Sciences")
courseDeptSci = SelectItem("sci", "Sciences")
courseDeptHum = SelectItem("hum", "Humanities")
courseCreditsField = FormControl("Credits", courseCreditsInput)
courseCreditsInput = Input("credits", "3", "number")
approveButtons = Buttons([approveBtn, rejectBtn])
approveBtn = Button("Approve course", null, "primary")
rejectBtn = Button("Reject", null, "tertiary")
messageCard = Card([messageHeader, messageForm], "card", "column", "m")
messageHeader = CardHeader("Message a Student Group", "Send announcement")
messageForm = Form("send-message", messageButtons, [groupField, subjectField, bodyField])
groupField = FormControl("Group", groupSelect)
groupSelect = Select("group", [group1, group2, group3], "Choose group")
group1 = SelectItem("freshmen", "Freshman Class")
group2 = SelectItem("seniors", "Senior Class")
group3 = SelectItem("engsoc", "Engineering Society")
subjectField = FormControl("Subject", subjectInput)
subjectInput = Input("subject", "Spring finals schedule")
bodyField = FormControl("Message", bodyArea)
bodyArea = TextArea("body", "Write your message here...", 5)
messageButtons = Buttons([sendBtn])
sendBtn = Button("Send message", null, "primary")
followups = FollowUpBlock([f1, f2, f3])
f1 = FollowUpItem("Show detailed enrollment breakdown by college")
f2 = FollowUpItem("List top 10 courses with waitlists")
f3 = FollowUpItem("Compare tuition revenue to budget targets")