NgDiagramGroupsService
since v0.8.0The NgDiagramGroupsService provides methods for managing node groups in the diagram.
Example usage
Section titled “Example usage”private groupsService = inject(NgDiagramGroupsService);
// Add nodes to a groupthis.groupsService.addToGroup('groupId', ['nodeId1', 'nodeId2']);Extends
Section titled “Extends”NgDiagramBaseService
Methods
Section titled “Methods”addToGroup()
Section titled “addToGroup()”addToGroup(
groupId,nodeIds):Promise<void>
Adds nodes to a group.
Parameters
Section titled “Parameters”groupId
Section titled “groupId”string
The ID of the group to add nodes to.
nodeIds
Section titled “nodeIds”string[]
Array of node IDs to add to the group.
Returns
Section titled “Returns”Promise<void>
A promise that resolves once the change has been applied to the model. Inside a transaction, the promise resolves right away and the change is applied when the transaction commits.
highlightGroup()
Section titled “highlightGroup()”highlightGroup(
groupId,nodes):Promise<void>
Highlights a group.
Parameters
Section titled “Parameters”groupId
Section titled “groupId”string
The ID of the group to highlight.
Node[]
The nodes to highlight as part of the group.
Returns
Section titled “Returns”Promise<void>
A promise that resolves once the change has been applied.
highlightGroupClear()
Section titled “highlightGroupClear()”highlightGroupClear():
Promise<void>
Clears all group highlights.
Returns
Section titled “Returns”Promise<void>
A promise that resolves once the change has been applied.
removeFromGroup()
Section titled “removeFromGroup()”removeFromGroup(
groupId,nodeIds):Promise<void>
Removes nodes from a group.
Parameters
Section titled “Parameters”groupId
Section titled “groupId”string
The ID of the group to remove nodes from.
nodeIds
Section titled “nodeIds”string[]
Array of node IDs to remove from the group.
Returns
Section titled “Returns”Promise<void>
A promise that resolves once the change has been applied to the model. Inside a transaction, the promise resolves right away and the change is applied when the transaction commits.