class Geometry · Computations
SeparateBoxesAlongAxisOptions
Options for Separate.boxesAlongAxis.
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
maxoptional
max?: number | RealThe largest coordinate along the axis that a box may reach with its edge (default: no limit).
minoptional
min?: number | RealThe smallest coordinate along the axis that a box may reach with its edge (default: no limit).
obstaclesoptional
obstacles?: Box[]Boxes that are not moved but kept clear of, e.g. the one the user drags. They are not part of the result.
paddingoptional
padding?: number | RealThe smallest gap between two boxes (default 0).
shrinkoptional
shrink?: booleanWhat happens when the boxes don't fit between min, max, the obstacles and the boxes that
stay put. false (default): they keep their size and the gaps between them are reduced by a
common factor, so they overlap evenly. true: all boxes are made smaller about their centers
by the largest common factor at which they fit (the padding and the obstacles keep their
size).
weightsoptional
weights?: number[]One weight per box, in the order of the boxes: a box with a higher weight moves less, one
with weight Infinity stays where it is, one with weight 0 moves freely. A missing weight
(or NaN) counts as 1.
