GeomSfText

Simple-features text labels: places aes.label at representative geometry points (Multi* → one label per part; stat_sf_coordinates).

Defaults

geom
sf_text
default stat
sf_coordinates
default position
identity
params type
SfTextParams

Svelte component

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

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

JSON layer

{
  "geom": "sf_text",
  "stat": "sf_coordinates"
}

Params

geometry

string

Name of the data column holding GeoJSON Geometry JSON strings. Default "geometry".

alpha

number

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

size

number

Font 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".

dx

number

Horizontal offset in px applied after positioning. Default 0.

dy

number

Vertical offset in px applied after positioning (positive = down). Default 0.

Allowed stats

Allowed positions

Examples

← All geoms · Getting started