Skip to content

DeclutterScratch

Defined in: core/declutter.ts:27

Reusable grid scratch so a per-frame caller (geo declutter runs on every zoom) allocates nothing. Only head and next are required — a hand-built { head, next } works; the per-glyph form creates the rest on first use. Build it with declutterScratch to have them from the start.

optional cells?: number

Defined in: core/declutter.ts:45

Grid cells the last call scanned, empty ones included — the other half of that signature, for the per-glyph radius form. The uniform form always scans ≤ 9 cells per glyph and leaves it 0.


optional classNext?: Int32Array<ArrayBufferLike>

Defined in: core/declutter.ts:36

Intrusive per-cell link of the radius-class grids, per glyph — per-glyph radius form (created on first use).


optional counts?: Int32Array<ArrayBufferLike>

Defined in: core/declutter.ts:34

Kept glyphs per single-grid cell — per-glyph radius form (created on first use).


head: Int32Array

Defined in: core/declutter.ts:30

Per-cell list heads: the single grid (cell = 2·spacing·maxR), then — per-glyph radius form — every radius class’s grid, back to back.


optional levels?: DeclutterLevels

Defined in: core/declutter.ts:38

Per-radius-class grid tables for the per-glyph radius form (created on first use).


next: Int32Array

Defined in: core/declutter.ts:32

Intrusive per-cell link of the single grid, per glyph.


optional probes?: number

Defined in: core/declutter.ts:42

Distance tests the last call ran — the deterministic cost signature per-frame guards assert.


optional seq?: Int32Array<ArrayBufferLike>

Defined in: core/declutter.ts:40

Insertion rank of each kept glyph — per-glyph radius form with winners only (grown on use).