class Geometry · Computations

SeparateBoxesOptions

Options for Separate.boxes (boxes that move in x and y).

All fields are optional. Numbers can be given as plain numbers or as reactive values; the value they hold when the function runs is used.

Properties

iterationsoptional

iterations?: number

The largest number of rounds (default 20): each round moves the boxes apart for the pairs known so far, then adds the pairs that overlap afterwards. Fewer are used when nothing overlaps any more.

paddingoptional

padding?: number | Real

The smallest gap between two boxes (default 0).

previousoptional

previous?: (Box | null | undefined)[]

The layout of the last update, one entry per box in the same order (usually the last result), or null / undefined (or missing at the end) for a box without one. A pair that was apart there keeps its side of each other (left/right or above/below).

weightsoptional

weights?: number[]

One weight per box, in the order of the boxes: a box with a higher weight moves less, one with weight 0 moves freely. A missing weight (or NaN) counts as 1. No box is fixed: Infinity counts as 1000 times the largest other weight, so such a box moves very little.