LabelBox
Defined in: labels/cull.ts:10
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”baseline?
Section titled “baseline?”
optionalbaseline?:LabelBaseline
Defined in: labels/cull.ts:35
Plain labels: vertical placement of the box (default "top").
height?
Section titled “height?”
optionalheight?:number
Defined in: labels/cull.ts:19
id:
string|number
Defined in: labels/cull.ts:11
keepUpright?
Section titled “keepUpright?”
optionalkeepUpright?:boolean
Defined in: labels/cull.ts:38
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:21
Higher wins collisions; defaults to 0.
rotation?
Section titled “rotation?”
optionalrotation?:number
Defined in: labels/cull.ts:29
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 an
axis-aligned box placed by textAnchor/baseline.
textAnchor?
Section titled “textAnchor?”
optionaltextAnchor?:TextAnchor
Defined in: labels/cull.ts:33
Which way the text runs from the anchor — "start" (default) puts the anchor at the box’s
left edge, "middle" centres it, "end" puts it at the right edge. Honoured by BOTH models
(#204: a centred label must collide on the box it actually renders in).
width?
Section titled “width?”
optionalwidth?:number
Defined in: labels/cull.ts:18
Box size in pixels; used for collision. Defaults to a small box if omitted.
x:
number
Defined in: labels/cull.ts:15
Screen-space anchor. Where the box sits around it is declared by textAnchor / baseline (plain labels) or by rotation (oriented labels) — never by a hand-written CSS transform, so collision and render can’t disagree.
y:
number
Defined in: labels/cull.ts:16