Charts
Small, fixed-shape marks for a glance, not an analysis.
MiniLineChart
One series, no legend — if it needs a legend it is not a mini chart.
Usage
import {
Funnel,
MiniBarChart,
MiniLineChart,
Sparkline,
} from '@oceanic-hub/brand-system'Composition
Use the following composition to build with Charts:
MiniLineChart
Sparkline
MiniBarChart
FunnelThese are glanceable, not analytical — no legends, no tooltips, no interaction. If a
reader needs to hover something to understand it, the chart is doing the wrong job and the
surface wants Chart — this package's recharts chrome, where the tooltip, the legend and the
axes live. Neither is a lightweight version of the other; they ship side by side, the export
names do not collide, and this one is a fixed set — nothing new composes out of them.
A chart either has a name its caller gave it, or it is hidden — never a name this package
invented. MiniLineChart and MiniBarChart assert role="img", so they will not let you
ship one unnamed: a generic default like "Line chart" would tell a screen reader nothing it could
not already get from the role, so there is no placeholder to fall back on. Sparkline is
aria-hidden by default and stays decorative unless you pass label, because it usually sits
beside the figure it trends — naming it too would announce that number twice.
color on Sparkline takes a semantic role, never a raw hex or a CSS variable: the
colour arrives as data through a prop, which is exactly the one place the no-raw-hex lint rule
cannot see a literal to catch. MiniBarChart's target draws the single reference rule a
small chart can carry before it becomes noise.
Sparkline
A trend, not a chart: no axes, no gridlines, no tooltip. Read it at a glance.
MiniBarChart
label is required — the surface names what it plots, because the package cannot.
Funnel
Stages in order, widths proportional to the first stage.
Sparkline roles
color takes a semantic role, never a colour — the roles a series can mean, shown in full.
A divided bar, an unfinished one, and an annotation
value2 splits one bar into two segments — a whole divided in two, not a second series — so the value label reads the TOTAL and the geometry carries the split. A 2px gap in the ground separates them, because two abutting fills in two roles read as one bar changing colour at an arbitrary height. inProgress draws a period that is still accumulating as a dashed outline with no fill: the usual move, a lighter fill, reads as "smaller", which is the one thing it does not mean. note puts one short caption under the x-label for the outlier a bar cannot explain. The x-key is label now; month still works and is deprecated.
Two series in one mark
series2 overlays a second measurement of the same thing over the same x — drawn dashed, in a subordinate role, and sharing the primary's y-domain so one unit is one distance in both. At 96 pixels wide with no ticks there is no room for a second scale, and a twin-axis sparkline can draw a crossing that never happened. Texture, not hue, is what carries "this is the other one": it survives at this size and it does not depend on telling two colours apart. The mark stays anonymous — identity belongs to the legend you put beside it.
API Reference
See the Charts API page for every prop of every part, with types, defaults and the contract that pins them.