diff --git a/agent/skills/dashboard-design/SKILL.md b/agent/skills/dashboard-design/SKILL.md index 273b247..6a4e4e7 100644 --- a/agent/skills/dashboard-design/SKILL.md +++ b/agent/skills/dashboard-design/SKILL.md @@ -1,7 +1,7 @@ --- name: dashboard-design description: Design and code a self-contained HTML dashboard for DeepSQL — ground on the schema, verify SQL, then write a beautiful single-file dashboard that loads data via the deepsql.query bridge. -version: 2.0.0 +version: 2.1.0 platforms: [linux, macos, windows] metadata: hermes: @@ -23,16 +23,26 @@ await deepsql.query("SELECT ...") // -> { columns: string[], rows: any[] deepsql.ready(fn) // runs fn() once the bridge is live (use this to kick off loading) // Charts — ALWAYS use these instead of hand-writing SVG. Built-in hover tooltips -// (show the value on mouse-over), number formatting, sparse axis labels, and a -// graceful "No data" empty state. Pass the deepsql.query result straight in, or -// [{label,value}] / [[label,value]]. First column = label, second = value (or -// opts.labelKey/valueKey). opts: { valueFormat(fn), height, color, emptyText }. +// (show the value on mouse-over), number formatting, sparse axis labels, a +// graceful "No data" empty state, and a corner expand button that opens the +// same chart larger in an overlay — all automatic, nothing to wire yourself. +// Pass the deepsql.query result straight in, or [{label,value}] / [[label,value]]. +// First column = label, second = value (or opts.labelKey/valueKey). +// opts: { valueFormat(fn), height, color, emptyText, title }. deepsql.charts.bar(elOrSelector, data, opts) // rankings, counts by day deepsql.charts.line(elOrSelector, data, opts) // trends over time (area+line) deepsql.charts.donut(elOrSelector, data, opts) // share/composition (with legend + %) deepsql.charts.format(n) // human number formatter ``` +**Chart sizing and the expand control are handled by the runtime — do not build your own.** +Height is fixed regardless of container width (a chart in a wide card never balloons), and every +chart already gets a corner "expand" button that opens a larger re-render in an overlay — this is +exactly the kind of per-chart chrome that's tempting to hand-roll and easy to get inconsistent +across widgets, so it's built into `deepsql.charts.*` once instead. Pass `opts.title` (the chart's +plain-business-language heading) so the expanded overlay has something to show as its title — do +not add your own zoom/expand/fullscreen button, modal, or lightbox; one already exists per chart. + Hard rules: - Inline everything — one `