LabelAnchor
Defined in: labels/label-layer.ts:6
A label anchored in REFERENCE (projected, pre-transform) pixel space.
Properties
Section titled “Properties”height?
Section titled “height?”
optionalheight?:number
Defined in: labels/label-layer.ts:12
id:
string|number
Defined in: labels/label-layer.ts:7
keepUpright?
Section titled “keepUpright?”
optionalkeepUpright?:boolean
Defined in: labels/label-layer.ts:30
Oriented labels only: flip 180° to keep the text upright (radial-tree readability flip).
offset?
Section titled “offset?”
optionaloffset?: [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).
priority?
Section titled “priority?”
optionalpriority?: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
rotation?
Section titled “rotation?”
optionalrotation?: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
textAnchor?
Section titled “textAnchor?”
optionaltextAnchor?:TextAnchor
Defined in: labels/label-layer.ts:28
Oriented labels only: which way the text runs from the anchor (default “start”).
transform?
Section titled “transform?”
optionaltransform?: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.
transformOrigin?
Section titled “transformOrigin?”
optionaltransformOrigin?:string
Defined in: labels/label-layer.ts:35
transform-origin for the node; defaults to “0 0” (the anchor point).
width?
Section titled “width?”
optionalwidth?:number
Defined in: labels/label-layer.ts:11