GeomPath

Path geometry: connects points in data (row) order within each group — unlike line, which sorts by x. Use for trajectories, loops, connected scatterplots, and ellipse rings (stat ellipse). With stat connect, successive points expand into connection vertices.

Light-theme example chart for GeomPath
Napoleon's march on Moscow, by Minard

Defaults

geom
path
default stat
identity
default position
identity
params type
PathParams

Svelte component

import { GGPlot, GeomPath } from "@ggts-sh/svelte";

<GGPlot data={rows} aes={{ x: "x", y: "y" }}>
  <GeomPath />
</GGPlot>

JSON layer

{
  "geom": "path"
}

Params

alpha

number

Path opacity. Must be between 0 and 1 (inclusive). Default 1.

linewidth

number

Stroke width in px. Must be greater than 0. Default 1.5.

curve

"linear" | "step"

Interpolation between points: "linear" (straight segments, default) or "step" (horizontal-then-vertical steps).

connection

"hv" | "vh" | "mid" | "linear"

STAT CONNECT ONLY: how successive points join — "hv" (default), "vh", "mid", or "linear". Ignored for other stats.

fun

"first" | "last" | "mean" | "median" | "min" | "max" | "sum"

STAT MANUAL ONLY: portable named transform (first|last|mean|median|min|max|sum). Required when stat is "manual".

level

number

STAT ELLIPSE ONLY: confidence level of the bivariate normal ellipse, strictly between 0 and 1. Default 0.95.

type

"norm"

STAT ELLIPSE ONLY: construction type. Only "norm" (bivariate normal) is supported in v1.

segments

number

STAT ELLIPSE ONLY: number of perimeter samples before the closing duplicate (output length = segments + 1). Default 51.

strokePaint

GradientPaint

Within-mark gradient stroke paint (not a data scale). Requires a solid fallback.

glow

GlowSpec

Bounded within-mark glow treatment (not theme decoration).

Allowed stats

Allowed positions

Examples

← All geoms · Getting started