Skip to content

declutterFrontier

declutterFrontier(tree, frontier, t, width, height, opts, scratch?): Uint32Array

Defined in: network/lod.ts:2911

Thin an LOD frontier in screen space: keep higher-importance glyphs (by tree LODTree.weight = strength) and drop lower-importance ones whose centre lies within spacing·(rᵢ + rⱼ) of a kept glyph. The default spacing 2 also drops near neighbours, so kept glyphs keep a gap around them and the links between them stay visible; in a small graph that can hide a whole non-overlapping module aggregate (#512). Spacing 1 drops only glyphs that really overlap a kept one. Greedy in descending importance over a screen grid, so a dense cluster keeps its most important members and the kept set is overlap-free (no overdraw). Runs per cut, so it’s zoom-dependent — more glyphs resolve as you zoom in. Returns the kept frontier ids (original order).

Pass an engine-owned scratch (makeDeclutterFrontierScratch) to make the thinning allocation-free steady-state (#213); the returned set is then a view of scratch.out, valid until the next call with that scratch. Without it, every call allocates a private scratch.

LODTree

Uint32Array

LODTransform

number

number

DeclutterOptions

DeclutterFrontierScratch

Uint32Array