Analytics layout
UnderstoryUsage
The app shell mounts it. Its pieces live in @/components/analytics.
When to use
Use it for
- Every analytics page in one order: the toolbar (date range, resolution), a row of
MetricsCardtiles, then the chart and the table, each in its own card. SelectDateandResolutionSelectdrive the whole page, so the tiles and charts refresh together.- Charts draw from the chart tokens (
--chart-1and on) and carry a legend.
Avoid
- A chart as the only way to read a number: pair it with tiles or a table.
- Controls inside each chart that move it out of step with the rest of the page.
Accessibility
Checks
- A legend or labels name every series, so nothing depends on color alone.
API
Read from each component's stories, the same source as COMPONENTS.md, and kept in step by check:design-system.
MetricsCard
Its stories don't declare
argTypes, so no props are listed. The variants show its states.VariantsDefaultPercentageEmptyWithChangeNegativeChangeNeutralChangeRefreshingLoadingErrorState
SelectDate
Its stories don't declare
argTypes, so no props are listed. The variants show its states.VariantsDefaultCustomRangeCustomPresetsAndUnitsDisabled
ResolutionSelect
Its stories don't declare
argTypes, so no props are listed. The variants show its states.Also exportsRESOLUTION_OPTIONS
VariantsDefaultUnresolved