performLayout method

  1. @override
void performLayout(
  1. Graph graph,
  2. Size size
)
override

Calculates and applies node positions based on the layout algorithm.

Override this method in subclasses to implement specific layout behavior.

Implementation

@override
void performLayout(Graph graph, Size size) {
  super.performLayout(graph, size);

  if (graph.nodes.isEmpty) return;

  final rootNode = _determineRootNode(graph);
  if (rootNode == null) return;

  final treeStructure = _buildTreeStructure(graph, rootNode);
  _applyTreeLayout(graph, treeStructure, size);
}