Skip to content
silverpoint
Documentation menu

Concepts

Dashboards

New in 0.2. A Dashboard lays charts out in a titled, responsive grid from a data-only layout, sizes each chart to its cell, passes the ground to every chart inside, and can link them on a field.

A linked dashboard

Breakpoints are the dashboard's own width: sm below 640 px, md up to 1024 px, lg above. The defaults are 1, 2 and 4 columns. Point at an hour in any chart: the others mark the same hour.

Operations

Service health over the last day. Hover or focus an hour in any chart: the others mark the same hour.

RevenueRevenue. thousands at 171, change +6.4; 14 points from 118 to 171.Revenue171thousands+6.4
Revenue
pointvalue
1118
2124
3121
4132
5140
6136
7129
8142
9151
10147
11155
12162
13158
14171
ChurnChurn. per cent at 118, change -0.4; 14 points from 118 to 171.Churn118per cent-0.4
Churn
pointvalue
1171
2158
3162
4155
5147
6151
7142
8129
9136
10140
11132
12121
13124
14118
TrafficTraffic. Line chart of 12 hour values; hits ranges from 11 to 88.Traffichits20406080100000408121620
Traffic
hourhits
0018
0214
0411
0616
0834
1058
1271
1466
1674
1888
2062
2241
ErrorsErrors. Bar chart in columns of 12 hour values; errors from 1 to 12.Errors2468101200061218
Errors
hourerrors
002
021
041
063
085
107
129
146
168
1812
206
224
UptimeUptime. Uptime at 99% of the range.Uptime99%Uptime
Uptime
measurevalue
Uptime99%
LoadLoad. Area chart of 12 hour values; load ranges from 15 to 92.Load%20406080100000408121620
Load
hourload
0022
0218
0415
0621
0844
1063
1278
1472
1681
1892
2066
2247
CapacityCapacity. Capacity used at 64% of the range.Capacity010064%Capacity used
Capacity
measurevalue
Capacity used64%

In your code

tsx
import { Dashboard, DashboardCell } from '@silverpoint/react/dashboard';
import { KpiCard } from '@silverpoint/react/kpi-card';
import { LineChart } from '@silverpoint/react/line-chart';
import { BarChart } from '@silverpoint/react/bar-chart';

<Dashboard
  id="ops"
  title="Operations"
  description="Service health over the last day."
  layout={{
    columns: { sm: 1, md: 2, lg: 4 },
    cells: [{ id: 'revenue' }, { id: 'traffic', colSpan: { md: 2, lg: 3 }, rowSpan: 2 }, { id: 'errors' }],
  }}
  link={{ key: 'hour' }}
  onLinkChange={(linked) => console.log(linked)}   // { key: 'hour', value: '18' } or null
>
  <DashboardCell cell="revenue"><KpiCard title="Revenue" metric="thousands" delta={6.4} /></DashboardCell>
  <DashboardCell cell="traffic"><LineChart data={ops} xKey="hour" valueKey="hits" title="Traffic" /></DashboardCell>
  <DashboardCell cell="errors"><BarChart data={ops} xKey="hour" valueKey="errors" title="Errors" /></DashboardCell>
</Dashboard>

Props

PropTypeWhat it does
idstring, requiredStable id; charts inside get derived ids (ops--traffic).
title / labelstringA visible heading, or an accessible name without one. One of them is required.
layoutDashboardLayoutcolumns, rowHeight (240), gap (16) and cells: [{ id, colSpan, rowSpan }] — per breakpoint if you like.
link{ key: string }Links the charts on a datum field.
descriptionstringA line under the title.
headingLevel2–6The heading level of the title.
ssrWidthnumberThe width the grid is laid out for before the browser measures it.
ground, substrate, mode, localePassed to every chart inside, below the chart's own props.

With link={{ key: 'hour' }}, exploring an item in one chart marks, in every other chart, the items whose datum has the same hour. The marks are hidden from assistive technology, and linked state never reaches the server render. A chart whose rows have no such field warns SP016. In React the link is its own client boundary, @silverpoint/react/dashboard-link; in Reflex, dashboard_link(...) links charts you lay out yourself.