root = Card([header, liveViewers, topTitles, watchTrend, churnSection, genrePerf, buffering, deliveryHealth, regionFocus, releases, licenses, recClicks, deadEndSearches, revenueSplit, deviceSplit, featureFlags, promoteTitle, followups])
header = CardHeader("Streaming Operations Room", "Live overview of platform health and content performance")
liveViewers = Card([liveHeading, liveStat, liveDelta], "sunk")
liveHeading = Heading("Viewers watching right now", "h3")
liveStat = TextContent("1,284,392", "large-heavy")
liveDelta = TextContent("+4.2% vs this time last week")
topTitles = Card([topHeading, topTable], "sunk")
topHeading = Heading("Most-watched titles", "h3")
topTable = Table([topTitle, topHours])
topTitle = Col("Title", ["Nightfall Protocol", "Echoes of the Deep", "The Last Cartographer", "Static Bloom", "Runaway Circuit"])
topHours = Col("Hours watched", [48210, 39145, 30780, 25490, 19830], "number")
watchTrend = Card([watchHeading, watchChart], "sunk")
watchHeading = Heading("Watch time — past month", "h3")
watchChart = AreaChart(["Sep 1", "Sep 5", "Sep 9", "Sep 13", "Sep 17", "Sep 21", "Sep 25", "Sep 30"], [watchSeries], "natural", "Date", "Hours (millions)")
watchSeries = Series("Watch time", [4.1, 4.6, 4.3, 5.2, 5.8, 5.4, 6.1, 6.5])
churnSection = Card([churnHeading, churnChart], "sunk")
churnHeading = Heading("New subscribers vs cancellations", "h3")
churnChart = LineChart(["Sep 1", "Sep 5", "Sep 9", "Sep 13", "Sep 17", "Sep 21", "Sep 25", "Sep 30"], [subSeries, cancelSeries], "linear", "Date", "Count")
subSeries = Series("New subscribers", [12040, 13280, 12850, 15120, 16840, 15990, 17430, 18920])
cancelSeries = Series("Cancellations", [4820, 5140, 4980, 5390, 5620, 5480, 5790, 6010])
genrePerf = Card([genreHeading, genreRadar], "sunk")
genreHeading = Heading("Performance by genre", "h3")
genreRadar = RadarChart(["Drama", "Comedy", "Sci-Fi", "Documentary", "Action", "Animation", "Reality"], [genreSeries])
genreSeries = Series("Avg hours/title", [82, 61, 74, 55, 68, 71, 47])
buffering = Card([bufferHeading, bufferProgress], "sunk")
bufferHeading = Heading("Buffering rate", "h3")
bufferProgress = Progress(1.8, "1.8% of streams buffered in the last 15 min")
deliveryHealth = Card([deliveryHeading, deliveryTable], "sunk")
deliveryHeading = Heading("Delivery health by region", "h3")
deliveryTable = Table([regionName, regionHealth])
regionName = Col("Region", ["North America", "Europe", "Asia-Pacific", "Latin America", "Africa"])
regionHealth = Col("Health", ["Excellent", "Good", "Fair", "Good", "Poor"])
regionFocus = Card([regionHeading, regionSelect, regionNote], "sunk")
regionHeading = Heading("Focus on one region", "h3")
regionNote = TextContent("Select a region to filter all metrics above.", "small")
releases = Card([releaseHeading, releaseList], "sunk")
releaseHeading = Heading("Releases coming this month", "h3")
releaseList = ListBlock([release1, release2, release3])
release1 = ListItem("Neon Tide", "Oct 12 — Drama series", null, "View")
release2 = ListItem("Paper Moons", "Oct 19 — Documentary film", null, "View")
release3 = ListItem("Gravity Well", "Oct 28 — Sci-Fi series", null, "View")
licenses = Card([licenseHeading, licenseTable], "sunk")
licenseHeading = Heading("Licenses expiring soon", "h3")
licenseTable = Table([licenseTitle, licenseDate])
licenseTitle = Col("Title", ["The Old Harbor", "Midnight Atlas", "Cobalt Season"])
licenseDate = Col("Expires", ["Nov 3", "Nov 15", "Nov 27"])
recClicks = Card([recHeading, recChart], "sunk")
recHeading = Heading("Recommendation click-through", "h3")
recChart = BarChart(["Sep 1", "Sep 8", "Sep 15", "Sep 22", "Sep 29"], [recSeries], "grouped", "Week", "Click-through %")
recSeries = Series("CTR", [3.1, 3.4, 3.2, 3.8, 3.6])
deadEndSearches = Card([searchHeading, searchTable], "sunk")
searchHeading = Heading("Searches without playback", "h3")
searchTable = Table([searchTerm, searchCount])
searchTerm = Col("Search term", ["northern lights", "k-drama 2024", "space western", "true crime"])
searchCount = Col("Dead-end count", [1840, 1520, 980, 760], "number")
revenueSplit = Card([revenueHeading2, revenuePie], "sunk")
revenueHeading2 = Heading("Revenue split by plan", "h3")
revenuePie = PieChart(["Basic", "Standard", "Premium", "Family"], [32, 28, 25, 15], "donut")
deviceSplit = Card([deviceHeading, deviceChart], "sunk")
deviceHeading = Heading("Viewing split by device", "h3")
deviceChart = SingleStackedBarChart(["TV", "Mobile", "Tablet", "Desktop", "Console"], [44, 31, 12, 9, 4])
regionSelect = Select("region", [regionAll, regionNA, regionEU, regionAP, regionLA, regionAF], "Choose a region", null, null, "medium")
regionAll = SelectItem("all", "All regions")
regionNA = SelectItem("na", "North America")
regionEU = SelectItem("eu", "Europe")
regionAP = SelectItem("ap", "Asia-Pacific")
regionLA = SelectItem("la", "Latin America")
regionAF = SelectItem("af", "Africa")
featureFlags = Card([featureHeading, featureList], "sunk")
featureHeading = Heading("Feature flags", "h3")
featureList = ListBlock([flag1, flag2, flag3, flag4])
flag1 = ListItem("New player UI", "Rollout 60%", null, "Toggle")
flag2 = ListItem("Offline downloads", "Enabled", null, "Toggle")
flag3 = ListItem("AI subtitles", "Beta", null, "Toggle")
flag4 = ListItem("4K HDR on mobile", "Disabled", null, "Toggle")
promoteTitle = Card([promoteHeading, promoteForm], "sunk")
promoteHeading = Heading("Promote a title on home", "h3")
promoteForm = Form("promote", promoteButtons, [promoteTitleField, promoteSlotField])
promoteTitleField = FormControl("Title", promoteTitleInput)
promoteTitleInput = Input("title", "Search a title")
promoteSlotField = FormControl("Home slot", promoteSlotSelect)
promoteSlotSelect = Select("slot", [slotHero, slotRow, slotBanner], "Choose position")
slotHero = SelectItem("hero", "Hero carousel")
slotRow = SelectItem("row", "Top row")
slotBanner = SelectItem("banner", "Featured banner")
promoteButtons = Buttons([promoteBtn])
promoteBtn = Button("Promote now", null, "primary")
followups = FollowUpBlock([followup1, followup2, followup3])
followup1 = FollowUpItem("Show a region deep-dive")
followup2 = FollowUpItem("Recommend titles to re-license")
followup3 = FollowUpItem("Summarize today's churn risk")