calculateGraphSize method
Implementation
Size calculateGraphSize(Graph graph) {
var left = double.infinity;
var top = double.infinity;
var right = double.negativeInfinity;
var bottom = double.negativeInfinity;
graph.nodes.forEach((node) {
left = min(left, node.x);
top = min(top, node.y);
right = max(right, node.x + node.width);
bottom = max(bottom, node.y + node.height);
});
return Size(right - left, bottom - top);
}