Building Database Dashboards
Building database dashboards takes three tile kinds and a grid. A dashboard
is a tile grid of saved-object references — chart, count-card, and table tiles —
persisted as a saved object of
type: dashboard.
- Chart — reuses the chart panel in read-only mode. In edit mode every chart tile carries a saved-chart picker: binding points the tile at a saved chart by reference (the tile re-renders whenever the chart is re-saved) and renames the tile after the chart, so a dashboard cannot mislabel what it shows. Clearing the binding falls back to the tile’s built-in configuration.
- Count card — a single aggregate value plus a label. The value comes from a server aggregate query, never a client-side count.
- Table — the first N rows of a saved query, linking to the full grid.
Each tile fetches independently through the useFetcher() seam (no direct
fetch), with its own loading and error state and an optional per-tile refresh
interval.
Edit vs view mode
Section titled “Edit vs view mode”Edit mode allows drag, resize, add, and remove; view mode exposes none of
these affordances — no editable name, no Save/Rename/Delete, no drag handles,
and no “New dashboard” control. Drag and resize persist to the definition, so
reopening restores each tile’s { x, y, w, h } exactly.
Fail-soft and no cascade
Section titled “Fail-soft and no cascade”- A tile whose query throws does not unmount or blank the dashboard — sibling tiles survive.
- A tile whose referenced saved object was deleted renders a tile-level error naming the missing id, and every other tile still loads. Deleting a saved object performs no cascade delete of dashboards referencing it.
Related
Section titled “Related”- Saved objects
- Chart panel — the tile that plots a server aggregate.
- Pivot UI — cross-tab designer over the same sources.
- Saved queries — what a table tile reads.
- Data workbench overview