Skip to content

LabelCullScratch

Defined in: labels/cull.ts:223

Reusable buffers for cullLabels. Placement runs on the per-frame path (every setTransform re-places every label), so the caller holds ONE of these and passes it back in: the steady-state cull then allocates nothing but the survivor array. Same shape of contract as core/declutter’s core!DeclutterScratch.

lastTests / lastPlaced / lastCandidates describe the last call — the deterministic signature the per-frame guard asserts on (tests must stay O(candidates), never O(candidates²)).

aux: Int32Array

Defined in: labels/cull.ts:243


boxes: Float64Array

Defined in: labels/cull.ts:234

Placed AABBs, stride 4: minX, minY, maxX, maxY.


corners: Float64Array

Defined in: labels/cull.ts:236

Placed corners, stride 8: x0,y0, x1,y1, x2,y2, x3,y3 (for the oriented SAT test).


head: Int32Array

Defined in: labels/cull.ts:230

Per-cell head of the intrusive list of placed labels (−1 = empty).


hist: Uint32Array

Defined in: labels/cull.ts:244


keyHi: Uint32Array

Defined in: labels/cull.ts:241

Radix scratch (large candidate sets only, see RADIX_MIN): the sortable high/low words of each candidate’s priority, the ping-pong target, and the 16-bit digit histogram.


keyLo: Uint32Array

Defined in: labels/cull.ts:242


keys: Float64Array

Defined in: labels/cull.ts:228

Candidate priorities, indexed BY CANDIDATE INDEX, so the placement-order sort compares two typed reads instead of two property loads through the candidate array (6.5× faster at 200k).


lastCandidates: number

Defined in: labels/cull.ts:250

In-viewport candidates considered by the last call.


lastPlaced: number

Defined in: labels/cull.ts:248

Labels placed by the last call.


lastTests: number

Defined in: labels/cull.ts:246

Pairwise overlap tests performed by the last call.


next: Int32Array

Defined in: labels/cull.ts:232

Next placed label in the same cell (−1 = end).


order: Int32Array

Defined in: labels/cull.ts:225

Candidate indices, in placement (priority-descending) order.


oriented: Uint8Array

Defined in: labels/cull.ts:238

1 when the placed label is rotated (needs SAT rather than the AABB verdict).