IShapesGroupControllerApi
Drawing Groups API. Refer to the Drawings API article for more information.
Methods
addShapeToGroup
Add a drawing to a group.
Signature
addShapeToGroup(groupId: ShapesGroupId, shapeId: EntityId) => void
Parameters
Name | Type | Description |
---|---|---|
groupId | ShapesGroupId | A group ID. |
shapeId | EntityId | A drawing ID. |
Returns
void
availableZOrderOperations
Get an object containing the available Z-order operations for a group.
Signature
availableZOrderOperations(groupId: ShapesGroupId) => AvailableZOrderOperations
Parameters
Name | Type | Description |
---|---|---|
groupId | ShapesGroupId | A group ID. |
Returns
The available Z-order operations.
bringForward
Move the group one level up in the Z-order.
Signature
bringForward(groupId: ShapesGroupId) => void
Parameters
Name | Type | Description |
---|---|---|
groupId | ShapesGroupId | A group ID. |
Returns
void
bringToFront
Move the group to the top of the Z-order.
Signature
bringToFront(groupId: ShapesGroupId) => void
Parameters
Name | Type | Description |
---|---|---|
groupId | ShapesGroupId | A group ID. |
Returns
void
canBeGroupped
Check if some drawings can be grouped.
Signature
canBeGroupped(shapes: readonly EntityId[]) => boolean
Parameters
Name | Type | Description |
---|---|---|
shapes | readonly EntityId[] | An array of drawing IDs. |
Returns
true
if the drawings can be grouped, false
otherwise.
boolean
createGroupFromSelection
Create a group of drawings from the selection.
Throws
If selection is empty, or selection contains non-drawings, or selection contains drawings from more than one pane.
Signature
createGroupFromSelection() => ShapesGroupId
Returns
The ID of the created group.
excludeShapeFromGroup
Remove a drawing from a group. If the drawing is the only drawing in the group then the group is also removed.
Signature
excludeShapeFromGroup(groupId: ShapesGroupId, shapeId: EntityId) => void
Parameters
Name | Type | Description |
---|---|---|
groupId | ShapesGroupId | A group ID. |
shapeId | EntityId | A drawing ID. |
Returns
void
getGroupName
Get the name of a group.
Signature
getGroupName(groupId: ShapesGroupId) => string
Parameters
Name | Type | Description |
---|---|---|
groupId | ShapesGroupId | A group ID. |
Returns
The name of the group.
string
groupLock
Get locked state of a group.
Signature
groupLock(groupId: ShapesGroupId) => GroupLockState
Parameters
Name | Type | Description |
---|---|---|
groupId | ShapesGroupId | A group ID. |
Returns
The locked state.
groupVisibility
Get the visibility state of a group.
Signature
groupVisibility(groupId: ShapesGroupId) => GroupVisibilityState
Parameters
Name | Type | Description |
---|---|---|
groupId | ShapesGroupId | A group ID. |
Returns
The visibility state.
groups
Get an array of all drawing groups.
Signature
groups() => readonly ShapesGroupId[]
Returns
An array of group IDs.
readonly ShapesGroupId[]
insertAfter
Move the group immediately below the target in the Z-order.
Signature
insertAfter(groupId: ShapesGroupId, target: EntityId | ShapesGroupId) => void
Parameters
Name | Type | Description |
---|---|---|
groupId | ShapesGroupId | A group ID. |
target | EntityId | ShapesGroupId | A target ID. |
Returns
void
insertBefore
Move the group immediately above the target in the Z-order.
Signature
insertBefore(groupId: ShapesGroupId, target: EntityId | ShapesGroupId) => void
Parameters
Name | Type | Description |
---|---|---|
groupId | ShapesGroupId | A group ID. |
target | EntityId | ShapesGroupId | A target ID. |
Returns
void
removeGroup
Remove a group of drawings.
Signature
removeGroup(groupId: ShapesGroupId) => void
Parameters
Name | Type | Description |
---|---|---|
groupId | ShapesGroupId | A group ID. |
Returns
void
sendBackward
Move the group one level down in the Z-order.
Signature
sendBackward(groupId: ShapesGroupId) => void
Parameters
Name | Type | Description |
---|---|---|
groupId | ShapesGroupId | A group ID. |
Returns
void
sendToBack
Move the group to the bottom of the Z-order.
Signature
sendToBack(groupId: ShapesGroupId) => void
Parameters
Name | Type | Description |
---|---|---|
groupId | ShapesGroupId | A group ID. |
Returns
void
setGroupLock
Lock or unlock a group.
Signature
setGroupLock(groupId: ShapesGroupId, value: boolean) => void
Parameters
Name | Type | Description |
---|---|---|
groupId | ShapesGroupId | A group ID. |
value | boolean | A boolean flag. true to lock, false to unlock. |
Returns
void
setGroupName
Set the name of a group. Names do not need to be unique.
Signature
setGroupName(groupId: ShapesGroupId, name: string) => void
Parameters
Name | Type | Description |
---|---|---|
groupId | ShapesGroupId | A group ID. |
name | string | The new name of the group. |
Returns
void
setGroupVisibility
Show or hide all drawings in a group.
Signature
setGroupVisibility(groupId: ShapesGroupId, value: boolean) => void
Parameters
Name | Type | Description |
---|---|---|
groupId | ShapesGroupId | A group ID. |
value | boolean | A boolean flag. true to show, false to hide. |
Returns
void
shapesInGroup
Get an array of IDs for each drawing in a group.
Signature
shapesInGroup(groupId: ShapesGroupId) => readonly EntityId[]
Parameters
Name | Type | Description |
---|---|---|
groupId | ShapesGroupId | A group ID. |
Returns
An array of drawing IDs.
readonly EntityId[]