selectAllNodes method

void selectAllNodes()

Selects all selectable nodes in the graph.

Only nodes with selectable: true are included. GroupNode and CommentNode have selectable: false by default and won't be selected.

This is a convenience method for selecting everything. Use Cmd+A / Ctrl+A keyboard shortcut to trigger this.

Example:

controller.selectAllNodes();

Implementation

void selectAllNodes() {
  runInAction(() {
    _selectedNodeIds.clear();
    for (final node in _nodes.values) {
      if (node.selectable) {
        _selectedNodeIds.add(node.id);
        node.selected.value = true;
      }
    }
  });
}