NgDiagramSelectionService
since v0.8.0The NgDiagramSelectionService provides methods for managing the selection state of nodes and edges in the diagram.
Example usage
Section titled “Example usage”private selectionService = inject(NgDiagramSelectionService);
// Select nodes and edgesthis.selectionService.select(['nodeId1'], ['edgeId1']);Extends
Section titled “Extends”NgDiagramBaseService
Properties
Section titled “Properties”selection
Section titled “selection”selection:
Signal<{edges:Edge<object>[];nodes:Node[]; }>
Returns a computed signal for the current selection of nodes and edges.
Methods
Section titled “Methods”deleteSelection()
Section titled “deleteSelection()”deleteSelection():
Promise<void>
Deletes the current selection of nodes and edges.
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.
deselect()
Section titled “deselect()”deselect(
nodeIds,edgeIds):Promise<void>
Deselects nodes and edges by their IDs.
Parameters
Section titled “Parameters”nodeIds
Section titled “nodeIds”string[] = []
Array of node IDs to deselect.
edgeIds
Section titled “edgeIds”string[] = []
Array of edge IDs to deselect.
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.
deselectAll()
Section titled “deselectAll()”deselectAll():
Promise<void>
Deselects all currently selected nodes and edges.
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.
select()
Section titled “select()”select(
nodeIds,edgeIds):Promise<void>
Selects nodes and edges by their IDs.
Parameters
Section titled “Parameters”nodeIds
Section titled “nodeIds”string[] = []
Array of node IDs to select.
edgeIds
Section titled “edgeIds”string[] = []
Array of edge IDs to select.
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.