Collection

extends Group

The Collection class represents a group of marks, glyphs, or collections (i.e., nested collection). Children inside a collection have the same “type” property. Collections are created through the repeat, divide, and densify operations.

Properties inherited from Group

propertyexplanationtypedefault value
bounds the bounding rectangle of the groupRectangle
children the graphical objects in the groupArray[]
dataScopethe data scope of the groupDataScopeundefined
firstChild the first child in the groupMark or Group
id the unique id of the groupString
lastChild the last child in the groupMark or Group
layoutthe layout of the group childrenLayoutundefined
type the type of the groupString“collection”
visibilitywhether the group is visible (“visible” or “hidden”)String“visible”
x the x coordinate of the center of the group boundsNumber
y the y coordinate of the center of the group boundsNumber

Methods inherited from Group

methodexplanationreturn type
addChild(c)adds an object to the groupvoid
addChildAt(c, i)adds an object to the group at the specified indexvoid
removeAll()removes all the children from the groupvoid
removeChild(c)removes the specified object from the groupvoid