MagnetizerRunOptions
Options for a run of a Magnetizer
Type Parameters
T
T
Properties
constrain?
optionalconstrain:MagnetizerConstrainFunction
Optional function used to constrain the movement of elements when the magnetizer is being applied.
elements?
optionalelements:Record<string,T> |T[]
List of elements to magnetize. If not provided, the magnetizer's current element list is used.
exclude?
optionalexclude:FilterFunction<T>
Optional function used to determine which elements to completely exclude from the magnetizer - they are treated as if they do not exist, and other elements may end up positioned intersecting them.
filter?
optionalfilter:FilterFunction<T>
Optional function used to filter elements from being affected by the magnetizer. They are still taken into account when magnetizing the other elements, unless you set excludeFocus:true.
focus?
optionalfocus:string
Element to use as the focus for the magnetize operation. This means its center will be the focus point, and also that it will not be moved
gather?
optionalgather:boolean
Defaults to false. If true, the magnetizer works in reverse: elements are gathered together (without overlapping)
grid?
optionalgrid:Grid
Optional grid to constrain movement to.
invertTrackbackPreference?
optionalinvertTrackbackPreference:boolean
If this is set, the magnetizer will not run trackbacks this time it is run.
iterations?
optionaliterations:number
Number of iterations to run for. More iterations takes longer but does better magnetizing.
origin?
optionalorigin:PointXY
Optional origin to use for magnetization process. If not provided, the computed center of the all elements to be magnetized will be used instead.
padding?
optionalpadding:PointXY
Optional value for the padding to leave between elements. Defaults to 20 pixels in each axis.
trackbackThreshold?
optionaltrackbackThreshold:number
Threshold beyond which the magnetizer will not attempt to track some element back to its original position. In some cases a user might want to push an element using the magnetizer and have the changes stick. Defaults to Infinity.