NmForceDirectedLayout constructor

NmForceDirectedLayout({
  1. required List<NmGraphNodeData> nodes,
  2. required List<NmGraphEdgeData> edges,
  3. double width = 800.0,
  4. double height = 600.0,
  5. int iterations = 100,
  6. double coolingFactor = 0.95,
})

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();
}