GeomSegment

Segment geometry: one finite line per data row from (x, y) to (xend, yend). Unlike rule, endpoints are data-mapped and do not span the panel.

Defaults

geom
segment
default stat
identity
default position
identity
params type
SegmentParams

Svelte component

import { GGPlot, GeomSegment } from "@ggsvelte/svelte";

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

JSON layer

{
  "geom": "segment"
}

Params

alpha

number

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

linewidth

number

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

lineend

"butt" | "round" | "square"

SVG stroke-linecap for segment ends. Default "butt".

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