Skip to main content
Version: 4.3

SpatialIndexOptions

Options for <Diagram spatialIndex> — quad-tree tuning for the spatial index it creates.

Values are reactive: changing them re-configures the live quad-tree. Unsetting a value keeps the last applied configuration (the quad-tree is not reset to its defaults).

Properties

isQuadTreeAutoGrow?

readonly optional isQuadTreeAutoGrow?: boolean;

Let an explicit SpatialIndexOptions.quadTreeBoundary grow to fit elements that fall outside it. Ignored when no boundary is set (the quad-tree always auto-grows in that case).

Default

false

isQuadTreeLazy?

readonly optional isQuadTreeLazy?: boolean;

Defer building the quad-tree until the first spatial query instead of indexing eagerly as cells change.

Default

false

quadTreeBoundary?

readonly optional quadTreeBoundary?: PlainRect;

Bounding box the quad-tree indexes. When omitted, the quad-tree picks its own boundary and grows to fit the content.


quadTreeCapacity?

readonly optional quadTreeCapacity?: number;

Maximum number of elements a quad-tree node holds before it splits.

Default

16

quadTreeMaxDepth?

readonly optional quadTreeMaxDepth?: number;

Maximum depth of the quad-tree. Deeper trees localize queries to smaller regions at the cost of more nodes.

Default

8