getConnectionsForNode method
Gets all connections associated with a node.
Returns connections where the node is either the source or target.
Parameters:
nodeId: The ID of the node to get connections for
Returns a list of connections (may be empty).
Example:
final connections = controller.getConnectionsForNode('node1');
print('Node has ${connections.length} connections');
Implementation
List<Connection> getConnectionsForNode(String nodeId) {
return _connections
.where(
(conn) => conn.sourceNodeId == nodeId || conn.targetNodeId == nodeId,
)
.toList();
}