GeomLabel
Label geometry: text with a rounded rectangular background box. Requires x, y, and label channels. No collision detection.
Defaults
- geom
label- default stat
identity- default position
identity- params type
LabelParams
Svelte component
import { GGPlot, GeomLabel } from "@ggsvelte/svelte";
<GGPlot data={rows} aes={{ x: "x", y: "y" }}>
<GeomLabel />
</GGPlot> JSON layer
{
"geom": "label"
} Params
alphanumberLabel opacity. Must be between 0 and 1 (inclusive). Default 1.
sizenumberFont size in px. Must be greater than 0. Default 11.
anchor"start" | "middle" | "end"Horizontal text anchor relative to the (x, y) position: "start", "middle" (default), or "end".
dxnumberHorizontal offset in px applied after positioning. Default 0.
dynumberVertical offset in px applied after positioning (positive = down). Default 0.
paddingnumberUniform box padding around the text in px. Default 3.
radiusnumberCorner radius of the background box in px. Default 3.
linewidthnumberBox outline stroke width in px. Default 0.5.
Allowed stats
identitydefault