PackingLayout

extends Layout

The PackingLayout class represents a layout that positions objects by packing them in an area. To create a PackingLayout object and apply it to a collection, use the layout function:

let pl = atlas.layout("packing", {x: 100, y: 100});
collection.layout = pl;

Properties

propertyexplanationtypedefault value
type the type of the layoutString“packing”
group the group that uses this layoutGroup
xthe x coordinate of the center of the enclosing areaNumber
ythe y coordinate of the center of the enclosing areaNumber
widththe width of the enclosing areaNumber
heightthe height of the enclosing areaNumber

Methods inherited from Layout

methodexplanationreturn type
clone() returns a copy of this layoutvoid
run() apply this layoutvoid