GeomSfLabel
Simple-features labels with background boxes: places aes.label at representative geometry points with a measured rounded rect (Multi* → one label per part). color=ink+box stroke; fill=box background.
Defaults
- geom
sf_label- default stat
sf_coordinates- default position
identity- params type
SfLabelParams
Svelte component
import { GGPlot, GeomSfLabel } from "@ggsvelte/svelte";
<GGPlot data={rows} aes={{ x: "x", y: "y" }}>
<GeomSfLabel />
</GGPlot> JSON layer
{
"geom": "sf_label",
"stat": "sf_coordinates"
} Params
geometrystringName of the data column holding GeoJSON Geometry JSON strings. Default "geometry".
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 representative point: "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.
paddingnumberBox padding around the text in px. Default 3.
radiusnumberBox corner radius in px. Default 3.
linewidthnumberBox stroke width in px. Default 0.5.
Allowed stats
sf_coordinatesdefault
Allowed positions
identitydefault