Widgets polling at different rates through one shared cache
Two widgets show revenue but share one timer at the faster 300 ms rate: 4 requests in 1.1 s (at 0, 300, 600 and 900 ms). Payroll is hidden (and never fetched) for a user without hr:read; the server must refuse it anyway.
A dashboard is a grid of independent widgets that each load, refresh, fail and render on their own; the design is about a shared query cache, polling or streaming at sensible rates, charts that draw thousands of points cheaply, virtualised tables, filters and time ranges in the URL, and permissions enforced on the server.
Change the code and press Run (Ctrl+Enter). Predict what will happen first, then break it on purpose and read what changes. Your edits are saved and match the lesson page.
Ready for more? This phase has 5 hands-on exercises with automatic checks.
Practice questions
Write the code in the editor, run it, then open the model answer to compare.
Make the polling example pause while the tab is hidden.
Add a "View as table" toggle to the chart example that shows the last 5 raw values of the selected range.
Explain it without notes
Walk me through the architecture of a dashboard with 20 widgets.
Polling or streaming: how do you choose, and how do you make polling efficient?
How do you render a chart with 100,000 points?
How would you design filters and time ranges for a dashboard?
How are permissions handled in a dashboard?
Preview
Console
Nothing logged yet.Expected console output
hidden: Payroll (needs hr:read)
requests after 1.1 s: revenue 4, users 6, payroll 0