LabelBox
Defined in: labels/cull.ts:5
A label positioned in SCREEN pixels (after the view transform is applied).
Indexable
Section titled “Indexable”[
key:string]:unknown
Carried through untouched (e.g. text, datum).
Properties
Section titled “Properties”height?
Section titled “height?”
optionalheight?:number
Defined in: labels/cull.ts:13
id:
string|number
Defined in: labels/cull.ts:6
keepUpright?
Section titled “keepUpright?”
optionalkeepUpright?:boolean
Defined in: labels/cull.ts:28
Oriented labels only: flip 180° (and the text side) when the rotation would render the text upside down — the standard radial-tree readability flip.
priority?
Section titled “priority?”
optionalpriority?:number
Defined in: labels/cull.ts:15
Higher wins collisions; defaults to 0.
rotation?
Section titled “rotation?”
optionalrotation?:number
Defined in: labels/cull.ts:23
Reading-direction angle in radians (CSS-clockwise, i.e. rotate(rotation·180/π deg)).
Setting it switches the label to the ORIENTED model: text runs along the rotated axis,
vertically centred on the anchor, and both the collision box and the rendered CSS
transform are derived from it — so the two can never disagree. Leave undefined for a
plain axis-aligned, top-left box (the caller then owns any CSS transform).
textAnchor?
Section titled “textAnchor?”
optionaltextAnchor?:TextAnchor
Defined in: labels/cull.ts:25
Oriented labels only: which way the text runs from the anchor. Defaults to “start”.
width?
Section titled “width?”
optionalwidth?:number
Defined in: labels/cull.ts:12
Box size in pixels; used for collision. Defaults to a small box if omitted.
x:
number
Defined in: labels/cull.ts:9
Screen-space anchor. For a plain label this is the box’s top-left; for an oriented
label (see rotation) it is the rotation/transform origin the text radiates from.
y:
number
Defined in: labels/cull.ts:10