Skip to content

NgDiagramGroupsService

since v0.8.0

The NgDiagramGroupsService provides methods for managing node groups in the diagram.

private groupsService = inject(NgDiagramGroupsService);
// Add nodes to a group
this.groupsService.addToGroup('groupId', ['nodeId1', 'nodeId2']);
  • NgDiagramBaseService

addToGroup(groupId, nodeIds): Promise<void>

Adds nodes to a group.

string

The ID of the group to add nodes to.

string[]

Array of node IDs to add to the group.

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(groupId, nodes): Promise<void>

Highlights a group.

string

The ID of the group to highlight.

Node[]

The nodes to highlight as part of the group.

Promise<void>

A promise that resolves once the change has been applied.


highlightGroupClear(): Promise<void>

Clears all group highlights.

Promise<void>

A promise that resolves once the change has been applied.


removeFromGroup(groupId, nodeIds): Promise<void>

Removes nodes from a group.

string

The ID of the group to remove nodes from.

string[]

Array of node IDs to remove from the group.

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.