ForceSimulation constructor

ForceSimulation({
  1. required List<NetworkNode> nodes,
  2. required List<NetworkLink> links,
  3. double alpha = 1.0,
  4. double alphaMin = 0.001,
  5. double alphaDecay = 0.0228,
  6. double alphaTarget = 0,
  7. double velocityDecay = 0.4,
  8. List<Force>? forces,
  9. void onTick()?,
  10. void onEnd()?,
})

Implementation

ForceSimulation({
  required this.nodes,
  required this.links,
  this.alpha = 1.0,
  this.alphaMin = 0.001,
  this.alphaDecay = 0.0228,
  this.alphaTarget = 0,
  this.velocityDecay = 0.4,
  List<Force>? forces,
  this.onTick,
  this.onEnd,
}) : forces = forces ?? [] {
  _buildNodeMap();
  _initializePositions();
}