Skip to content

NgDiagramSelectionService

The NgDiagramSelectionService provides methods for managing the selection state of nodes and edges in the diagram.

private selectionService = inject(NgDiagramSelectionService);
// Select nodes and edges
this.selectionService.select(['nodeId1'], ['edgeId1']);
  • NgDiagramBaseService

selection: Signal<{ edges: Edge<object>[]; nodes: Node[]; }>

Returns a computed signal for the current selection of nodes and edges.

deleteSelection(): void

Deletes the current selection of nodes and edges.

void


deselect(nodeIds, edgeIds): void

Deselects nodes and edges by their IDs.

string[] = []

Array of node IDs to deselect.

string[] = []

Array of edge IDs to deselect.

void


deselectAll(): void

Deselects all currently selected nodes and edges.

void


select(nodeIds, edgeIds): void

Selects nodes and edges by their IDs.

string[] = []

Array of node IDs to select.

string[] = []

Array of edge IDs to select.

void