setNodeSize method

void setNodeSize(
  1. String nodeId,
  2. Size size
)

Sets the size of a node.

Updates the node's size which will trigger reactive updates in the UI and automatically adjust port positions and connections.

Does nothing if the node with nodeId doesn't exist.

Parameters:

  • nodeId: The ID of the node to resize
  • size: The new size for the node

Example:

controller.setNodeSize('node1', Size(200, 150));

Implementation

void setNodeSize(String nodeId, Size size) {
  final node = _nodes[nodeId];
  if (node == null) return;

  runInAction(() {
    node.size.value = size;
  });
}