Skip to content

LabelAnchor

Defined in: labels/label-layer.ts:6

A label anchored in REFERENCE (projected, pre-transform) pixel space.

optional height?: number

Defined in: labels/label-layer.ts:12


id: string | number

Defined in: labels/label-layer.ts:7


optional keepUpright?: boolean

Defined in: labels/label-layer.ts:30

Oriented labels only: flip 180° to keep the text upright (radial-tree readability flip).


optional offset?: [number, number]

Defined in: labels/label-layer.ts:19

A constant screen-pixel offset [dx, dy] from the projected anchor, applied to BOTH the rendered position and the collision box — so it stays a fixed distance from the node at any zoom, and culling reflects where the label actually sits (no overlap as you zoom in).


optional priority?: number

Defined in: labels/label-layer.ts:13


refX: number

Defined in: labels/label-layer.ts:8


refY: number

Defined in: labels/label-layer.ts:9


optional rotation?: number

Defined in: labels/label-layer.ts:26

Reading-direction angle in radians. Setting it switches the label to the ORIENTED model: the library derives BOTH the rendered CSS transform and the collision box from this single angle (with textAnchor/keepUpright), so they cannot drift apart. Leave it undefined for a plain axis-aligned label and supply your own transform.


text: string

Defined in: labels/label-layer.ts:10


optional textAnchor?: TextAnchor

Defined in: labels/label-layer.ts:28

Oriented labels only: which way the text runs from the anchor (default “start”).


optional transform?: string

Defined in: labels/label-layer.ts:33

Optional CSS transform for a PLAIN label (ignored when rotation is set, since the library then generates the transform). Use offset for the constant-px gap.


optional transformOrigin?: string

Defined in: labels/label-layer.ts:35

transform-origin for the node; defaults to “0 0” (the anchor point).


optional width?: number

Defined in: labels/label-layer.ts:11