GeomLine
Line geometry: connects points in x order, one line per group (groups derive from discrete aesthetics such as color, or from aes.group). Use for time series, trends, and line charts. With stat ecdf, pair with step curves; with stat bin (freqpoly alias), y is computed from counts/density; with stat connect, successive points expand into connection vertices.
Defaults
- geom
line- default stat
identity- default position
identity- params type
LineParams
Svelte component
import { GGPlot, GeomLine } from "@ggsvelte/svelte";
<GGPlot data={rows} aes={{ x: "x", y: "y" }}>
<GeomLine />
</GGPlot> JSON layer
{
"geom": "line"
} Params
alphanumberLine opacity. Must be between 0 and 1 (inclusive). Default 1.
linewidthnumberStroke width in px. Must be greater than 0. Default 1.5.
curve"linear" | "step" | "step-hv" | "step-vh"Interpolation: "linear" (default), "step" (mid-x corners), "step-hv" (horizontal then vertical — correct for ECDF), or "step-vh".
padbooleanWith stat ecdf: when true (default), prepend (xmin, 0) so step stairs start at zero. Finite-clamped.
nnumberWith stat ecdf: evaluate on n equally spaced x in [min, max] per group; omit for one point per unique x.
connection"hv" | "vh" | "mid" | "linear"STAT CONNECT ONLY: how successive points join — "hv" (default), "vh", "mid", or "linear". Ignored for other stats.
binsnumberSTAT BIN / SUMMARY_BIN: number of bins (integer ≥ 1). Default 30 — an advisory reminds you to pick a real value. Overridden by binwidth.
binwidthnumberSTAT BIN / SUMMARY_BIN: bin width in data units (must be greater than 0). Takes precedence over bins.
boundarynumberSTAT BIN / SUMMARY_BIN: align a bin EDGE with this x value. Mutually exclusive with center.
centernumberSTAT BIN / SUMMARY_BIN: align a bin CENTER with this x value. Mutually exclusive with boundary.
closed"right" | "left"STAT BIN / SUMMARY_BIN: which edge of each bin is inclusive: "right" (default) or "left".
fun"first" | "last" | "mean" | "median" | "min" | "max" | "sum"SUMMARY_BIN center fun (mean/median/sum;) or MANUAL named transform (first|last|mean|median|min|max|sum;). Required when stat is "manual".
funMinSummaryFunSTAT SUMMARY_BIN ONLY: lower bound summary (ymin).
funMaxSummaryFunSTAT SUMMARY_BIN ONLY: upper bound summary (ymax).
strokePaintGradientPaintWithin-mark gradient stroke paint (not a data scale). Requires a solid fallback.
glowGlowSpecBounded within-mark glow treatment (not theme decoration).
Allowed stats
Allowed positions
identitydefault
Examples
- Halley's life table, 1693
- Galton's regression to the middle
- London's bills of mortality, 1629 to 1710
- Michelson's speed of light as a frequency polygon
- Cavendish's readings against the modern value
- Richardson's deadly quarrels
- Quetelet's soldiers and the error curve
- Playfair's wheat and wages, 1565 to 1821