Group
Represents a set of drawing elements, possibly including other groups.
children
Element[]
The children of this group.
options
The configuration of this element.
Constructors
Group
(options?: GroupOptions)
Creates a new Group instance with the specified options.
Parameters
options?
Configuration options for the group.
Methods
append
Appends the specified element as a last child of the group.
Parameters
elements
Element[]
bbox
Returns the bounding box of the element with applied transformations.
Returns
- The bounding box of the element with transformations applied.
clear
Removes all child elements from the group.
clip
Gets the clipping path for this element.
Returns
- The clipping path for this element.
clip
Sets the clipping path for this element. The Path instance will be monitored for changes. Can be replaced by calling the clip
method.
The following example demonstrates how to set a clipping path on a Circle.
The following example demonstrates how to clear a clipping path.
Parameters
clip
The element clipping path.
clippedBBox
Returns the bounding box of the element with clipping and transformations applied. This is the rectangle that will fit around the actual rendered element.
Returns
- The bounding box of the element with clipping and transformations applied.
containsPoint
Returns true
if the shape contains the specified point.
Parameters
point
The point that should be checked.
Returns
boolean
value indicating if the shape contains the point.
insert
Inserts an element at the specified position.
Parameters
position
number
The position to insert the element at. Existing children beyond this position are shifted right.
element
The element to insert.
opacity
Gets the element opacity.
Returns
number
The current element opacity.
opacity
Sets the opacity of the element.
Parameters
opacity
number
The element opacity. Ranges from 0 (completely transparent) to 1 (completely opaque).
remove
Removes the specified element from the group.
Parameters
element
The element to remove.
removeAt
Removes the child element at the specified position.
Parameters
index
number
The index at which the element currently resides.
transform
Gets the transformation of the element.
Returns
- The current transformation on the element.
transform
Sets the transformation of the element.
Parameters
transform
The transformation to apply to the element.
visible
Gets the visibility of the element.
Returns
boolean
true if the element is visible. Otherwise, returns false
.
visible
Sets the visibility of the element.
Parameters
visible
boolean
A flag which indicates if the element will be visible.