NmForceDirectedLayout constructor
NmForceDirectedLayout({
- required List<
NmGraphNodeData> nodes, - required List<
NmGraphEdgeData> edges, - double width = 800.0,
- double height = 600.0,
- int iterations = 100,
- double coolingFactor = 0.95,
Creates a NmForceDirectedLayout.
Implementation
NmForceDirectedLayout({required this.nodes, required this.edges, this.width = 800.0, this.height = 600.0, this.iterations = 100, this.coolingFactor = 0.95}) {
_temperature = math.sqrt(width * height) / 10;
_k = math.sqrt((width * height) / nodes.length);
_initialize();
}