# Dashboard Scene

> Build a live data dashboard that opens with an animated short, as a single HTML file for one 1920…

Build a live data dashboard that opens with an animated short, as a single HTML file for one 1920×1080 screen. The page loads its data (window.DATA from data.js); a hand-drawn, generated canvas scene of the place the data comes from (turbines turning with the wind, smoke rising with gas, windows lighting with demand, riders crossing a city) plays two or three focused shots of the moments that mattered, then lands in its tile on the dashboard and keeps playing there. Every KPI, chart and table is a small SQL query run in the browser, so figures follow the data, update when new rows arrive, and show "how this is calculated". Use this skill whenever the user asks for a dashboard, KPI screen, control-room or lobby display with an animation, intro, video, short, story, illustrated or "alive" view of the data, or a dashboard "people will remember", even if they only say "animate this dashboard".

- Page: https://ss33.ai/skills/skillstore33/dashboard-scene-66366395289
- Publisher: skillstore33
- Category: [Data & Analytics](https://ss33.ai/skills/category/data-and-analytics-m1r3i9) › [Analysis & BI](https://ss33.ai/skills/category/data-and-analytics-m1r3i9/analysis-and-bi-b2nit8)
- License: MIT

## Skill

SKILL.md: https://ss33.ai/api/v1/ss33/download/skillstore33/dashboard-scene-66366395289

# Dashboard with a scene

The bar: a viewer who watches the 20-second short understands where the numbers come from (the place, what moves, which moments mattered) before reading a single figure, and the dashboard it lands in is as honest and readable as one without a scene. The picture shows proportions and moments; the runtime's readouts, clock and tiles show the figures. A scene that is pretty but driven by nothing, or that flickers, fails the bar.

## References

- `read_skill_file("dashboard-scene", "references/starter.html")`: **required**. Tokens, the `scene-left` layout, every tile type, a scene tile with shots, the script tags, and a skeleton scene showing the contract.
- `read_skill_file("dashboard-scene", "references/scene.md")`: the full `g`/`f` API tables, shots and their attributes, channels, flicker-free recipes, composition, castings for other data. Read it unless you are certain of the API below.
- `read_skill_file("dashboard-scene", "references/tiles.md")`: the two scene layouts and their budgets, tile types and attributes, the SQL subset, recipes.
- `read_skill_file("dashboard-scene", "references/styles.md")`: tested style families and a hue table. Optional.

Request what you need in one turn; your next reply is the finished file.

## Contract (checkers depend on it)

- One HTML file ending with, in this order:
  ```html
  <script src="data.js"></script>
  <script src="https://cdn.jsdelivr.net/gh/ReadyaiHub/dash-runtime@1.1.0/dash.js"></script>
  <script>(() => { DashScene.register({ setup(g) { … }, draw(ctx, f, s) { … } }); })();</script>
  ```
  No other script, handler, library, image or CSS animation.
- `<body data-motion>`. Everything inside `.dash` (1920×1080). The board is exactly 12 × 5 in source order, with exactly one `<section class="tile … scene">` (`c6 r3` in `scene-left`, `c8 r4` in `scene-hero`: near 16:9 so the short lands without cropping). Never `font-size`, sizes, positions or `style=""`.
- Every visible figure comes from a query; you type only figures the brief states, in attributes. A swap test reloads on other data: tiles must move, and so must the scene.
- Header: `<span data-updated></span>`, at most 3 controls, each changing something. A date `<select data-filter="date">` lets the viewer pick a day, which the scene tile then plays.

## The scene tile and the runtime

- `data-scene`: one flat query, **one row per moment** in time order (`ORDER BY date, time`), selecting every column the scene reads; split a measure by group with `SUM(CASE WHEN …) AS name`. Header filters apply to it.
- `data-readout="col|Label|format|unit|agg, …"` (agg `avg|max|min|sum` over the shot; the tile shows the first 3).
- `<ol class="shots">`, 2–3 `<li>`: `data-from`/`data-to` (`YYYY-MM-DD HH:MM`), or `data-pick="max:col"`/`min:col` for the day with the highest/lowest average (then `data-from`/`data-to` are times, honoured only with an `HH:MM` column: with an integer `hour` the whole day plays); `data-seconds` 5–7; optional `data-tag` read as `f.shot.tag`; caption ≤ 14 words naming what the brief says happened.
- A shot should be one focused window, 6–14 hours or a day, so `f.hour` visibly turns; a week in 6 seconds is unreadable. Open on an ordinary day when the events need a contrast.
- `g` (setup, once per data load): `w`, `h` (1920×1080), `rand(i, salt)`, `noise(x, salt)`, `rows`, `days`, `max(col)`, `min(col)`, `lerp`, `clamp`, `smooth`, `ease`.
- `f` (draw, every frame): `n(col)` 0–1 of the column's max, smoothed over about an hour; `range(col)` 0–1 between min and max (for levels that never reach 0); `cum(col)` the running total of `n`, for anything moving at a data-driven speed; `sm(col, seconds)`; `now(col)` unsmoothed; `shot` `{i, text, tag, p}`; `hour` (fractional or null); `day`, `dayf`; `t` (seconds, continuous across shots); `perDay`; `mode` (`'intro'`/`'tile'`); `row`, `raw`, `rows`, `i`; `max`, `min`; the same helpers as `g`.
- The canvas is always 1920 × 1080 logical pixels, cleared and context-reset before each frame; the runtime adds the push-in, crossfades, clock, readouts and captions.

## Non-obvious rules

- **Draw is a pure function of `f` and the setup state.** The clock seeks (video export, Replay, day pick), so: no `Date`, `performance.now`, `Math.random`, timers, `requestAnimationFrame`, DOM access or state carried between frames. Angles come from `f.cum`, never `angle += speed`; particles get their age from `f.t` (`((f.t + k * P / N) % P) / P`); randomness is `f.rand(i, salt)`.
- **No flicker.** Counts fade (draw item `i` with `globalAlpha = f.clamp(k - i)`, `k = f.n(col) * N`), never `Math.round`. Identity (colour, lane, size) is fixed in setup; two groups are two pools, not one recoloured pool. No hard thresholds on moving values: fade across a wide band, or use `f.shot.tag` for on/off conditions. Keep base speeds modest and self-moving things (clouds, water) on `f.t`.
- **No figures in the picture.** Never draw text, numbers or dates; never scale by a typed data figure (`wind / 4200`). A capacity the brief states may appear as a fraction of `g.max(col)`.
- **Safe zones.** Keep the top-left 900 × 200 quiet (clock, readouts), the bottom 140 px centre quiet (captions), and the tile's top corners clear (title, SQL button). Actors live in the middle band.
- **Budget.** About 2,000 shapes and ~30 gradients per frame, no `filter`/`shadowBlur` on many shapes: the tile repaints continuously.

## Craft

Cast before drawing: one place seen from one viewpoint, 5–7 actors, each reading one column through one channel (speed via `cum`, amount via `n`, light via `range` with per-light `f.rand(i) < share`, pulses along a path, weather via `shot.tag`, time of day via `hour`). Every measure the brief cares about gets an actor; every actor reads a column. Depth in three or four layers that desaturate toward the horizon; one large near actor for scale, many small ones for quantity; one key light and a day/night palette mix driven by `f.hour` rather than darkening; a palette from the place, not from the dashboard accent; a soft vignette last. The starter's scene is a floor, not a model: go well beyond it.

For the dashboard around it, the usual honesty applies: ratios of sums, per-day as `SUM / COUNT(DISTINCT date)`, `days_ago`/`week_ago` for recent periods, flat queries only (no JOIN or subquery), `ORDER BY` on charts, KPIs with `data-vs` or `data-target` and `data-good` and no note, every event a `data-mark` or a shot, every target a `data-target`, words that stay true when the data moves (`h1` 3–7 words, titles ≤ 9, notes ≤ 12).

Put a PLAN comment first in `<body>`, including a SCENE line (actor ← column, channel) and a SHOTS line.

## Deliverable

The complete HTML file in one ```html code block, ending with `</html>`, in the same reply as the plan; then 2–3 lines: layout and style, the scene's place and actors, and the shots.
