Skip to content
Charts55Components12Visuals14ASCII45
GitHubGet startedGet started
All chartsTerrainCool
PreviousNext: Hex city

CoolCL-17

Terrain

A grid of readings as a lit landscape, so peaks and quiet valleys read at a glance.

Part
CL-17
Component
TerrainCard
From
@lilt-ui/charts

Server load

80%80%
00:0004:0008:0012:0016:0020:00MonTueWedThuFriSatSun
Higher and brighter: more · Hover to pin a reading
Server load
ObservationValue
00:00 · Mon12%
02:00 · Mon12%
04:00 · Mon13%
06:00 · Mon18%
08:00 · Mon31%
10:00 · Mon56%
12:00 · Mon78%
14:00 · Mon78%
16:00 · Mon56%
18:00 · Mon31%
20:00 · Mon18%
22:00 · Mon13%
00:00 · Tue12%
02:00 · Tue12%
04:00 · Tue13%
06:00 · Tue18%
08:00 · Tue31%
10:00 · Tue56%
12:00 · Tue78%
14:00 · Tue78%
16:00 · Tue56%
18:00 · Tue31%
20:00 · Tue18%
22:00 · Tue13%
00:00 · Wed12%
02:00 · Wed12%
04:00 · Wed14%
06:00 · Wed27%
08:00 · Wed49%
10:00 · Wed65%
12:00 · Wed80%
14:00 · Wed79%
16:00 · Wed56%
18:00 · Wed31%
20:00 · Wed18%
22:00 · Wed13%
00:00 · Thu12%
02:00 · Thu12%
04:00 · Thu13%
06:00 · Thu18%
08:00 · Thu31%
10:00 · Thu56%
12:00 · Thu78%
14:00 · Thu78%
16:00 · Thu56%
18:00 · Thu31%
20:00 · Thu18%
22:00 · Thu13%
00:00 · Fri12%
02:00 · Fri12%
04:00 · Fri13%
06:00 · Fri18%
08:00 · Fri31%
10:00 · Fri56%
12:00 · Fri78%
14:00 · Fri78%
16:00 · Fri56%
18:00 · Fri31%
20:00 · Fri18%
22:00 · Fri13%
00:00 · Sat12%
02:00 · Sat12%
04:00 · Sat13%
06:00 · Sat15%
08:00 · Sat21%
10:00 · Sat33%
12:00 · Sat44%
14:00 · Sat44%
16:00 · Sat33%
18:00 · Sat21%
20:00 · Sat15%
22:00 · Sat13%
00:00 · Sun12%
02:00 · Sun12%
04:00 · Sun13%
06:00 · Sun15%
08:00 · Sun21%
10:00 · Sun33%
12:00 · Sun44%
14:00 · Sun44%
16:00 · Sun33%
18:00 · Sun21%
20:00 · Sun15%
22:00 · Sun13%
Default01 / 01

Installation

One package, one sheet.

Add the package, then import the component and the stylesheet once. See Getting started for theming.

$npm install @lilt-ui/charts
import { TerrainCard } from '@lilt-ui/charts';
import '@lilt-ui/charts/styles.css';

Usage

The default card.

The default card above, as you would write it.

<TerrainCard title="Server load" data={serverLoad} x="hour" y="day" value="load" />

Omit title to leave out the visible title. Set header={false} to remove the whole header, and use aria-label to name a chart inside your own card. surface="ghost" controls only the visual frame. See Card composition.

Data

The shape it reads.

One row per x and y pair, at least two of each. The surface passes exactly through every reading and is smoothed between them; smoothing sets how many samples sit between neighbours. A missing reading sits on the floor and reads as no data. Duplicate pairs are rejected.

const serverLoad = [
  { day: 'Mon', hour: '00:00', load: 12 },
  { day: 'Mon', hour: '02:00', load: 14 },
  // …one row per day and hour
];

Props36

Every prop.

Every prop TerrainCard accepts, in the order you are likely to reach for them.

PropTypeDescription
titlestringOptional visible title. Omit to render no title. Also supplies the accessible name unless aria-label is set.
headerbooleanDefaults to true. False removes the whole header: title, headline, delta and period controls, with no reserved space. Pass data directly when your app owns period selection.
aria-labelstringAccessible chart name, independent of the visible title. Falls back to title, then a generic chart name.
dataRow[]One row per observation. Omit when using ranges.
heightnumberMinimum plot height, default 320px. Dense data may expand within the scrollable viewport.
depthbooleanLit tiles, solid bars, or spheres. Data positions remain exact; loading keeps the same depth treatment.
colorstringOverride the palette with one CSS color.
aggregate'sum' | 'mean' | 'max'Resting headline summary; Strip defaults to mean, the others to sum.
headlinenumberOverride the resting headline.
deltanumberFractional change shown alongside the headline.
deltaTone'default' | 'inverse' | 'neutral'Use inverse when a decrease is good.
rangestringStatic period label.
ranges{ id, label, data, headline?, delta? }[]Period choices with their own data.
defaultRangestringInitial period id.
localestringLocale for numbers and dates; defaults to en-US.
formatValue(value: number) => stringCustom value formatter.
badgeReactNodeContent for the glass tab above the card.
classNamestringClass on the card frame.
styleCSSProperties | ChartStyleInline styles and scoped chart variables.
onSelectionChange(selection | null) => voidReports id, original row (or null for an absent day), value, and pinned state.
renderReadout(selection | null) => ReactNodeConsumer-owned readout, including when the header is hidden.
valueFormatIntl.NumberFormatOptionsFormats the headline, tiles, and axis, e.g. currency.
surface'elevated' | 'outline' | 'ghost'Card treatment. Ghost removes the visual frame only; header and legend are independent controls.
palette'spectrum' | 'iris' | 'cobalt' | 'emerald'Series colors. Spectrum by default; explicit series colors still win.
numberStyle'count' | 'pop' | 'slide' | 'roll' | 'flow' | 'scramble'How the headline animates when its value changes. Count (default) counts to the new value.
loadingbooleanShows a neutral loading skeleton, not data.
loadingStyle'shimmer' | 'draw' | 'breathe'Shimmer sweeps a highlight over still shapes; draw reveals them in order; breathe lets them settle. Follows the selected look, including depth, and respects reduced motion.
empty'dots' | 'shape' | ReactElement | nullWhat the card shows when the period has no data. Dots (default) gathers a quiet dot field around the message; shape lays the chart’s own outline behind it. Pass `<ChartEmpty>` with your own words, any element of your own, or null for nothing. Both looks stay still, so empty never reads as loading, and the headline reads a dash, never zero.
motion'auto' | 'none'None turns off decorative motion; reduced motion does this automatically.
xtext key of RowColumns, running away to the right.
ytext key of RowRows, coming toward the viewer.
valuenumeric key of RowSurface height, color, and headline.
risenumberHow many cell lengths the highest value rises, default 3.
smoothingnumberSurface samples between neighbouring readings, 1 to 6, default 4.
domain[number, number]Fixed value domain that must contain every value. Defaults to zero through the largest.
onKeyDownKeyboardEventHandler<HTMLElement>Keyboard handler on the card frame. Chart inspection also has its own keyboard handling.
Previous chartArc bridgesNext chartHex city

Ready when your data is. Start with one install.

Install a package, import the stylesheet once, and drop in a card or a scene.

Read the guideRead the guideView on GitHubView on GitHub
ChartsAll chartsAll chartsFinanceFinanceCustomizeCustomizeFeaturesFeatures
ComponentsAll componentsAll componentsAIAIStatusStatusActionsActionsDataData
VisualsAll visualsAll visualsAIAIDataDataSecuritySecurityProductProduct
ASCIIAll scenesAll scenesTextTextInterfaceInterfaceBackgroundsBackgroundsMediaMediaDataData
DocsGetting startedGetting startedAPI referenceAPI referenceMotion & accessibilityMotion & accessibilityllms.txtllms.txt
React components with a little lilt.GitHubGitHubnpmnpm