doLayout method

void doLayout(
  1. Object coll
)

Perform the force-directed layout.

If there is no Layout#network, this calls #makeNetwork to create a LayoutNetwork from the given collection of Parts. This removes any reflexive edges in the network, since they should be ignored.

For each vertex this calls and remembers the result of #electricalCharge as the ForceDirectedVertex#charge and the result of #gravitationalMass as the ForceDirectedVertex#mass.

For each edge this calls and remembers the result of #springStiffness as the ForceDirectedEdge#stiffness and the result of #springLength as the ForceDirectedEdge#length.

This then iterates, updating the position of each vertex according to the forces upon it, until reaching #maxIterations or until no vertex moves more than about #epsilonDistance.

Finally this calls Layout#updateParts to commit the Node positions from the vertex positions. Layout#updateParts calls #commitLayout within a transaction. @param {Diagram|Group|Iterable.

Implementation

void doLayout(_i2.Object coll) {
  _i4.callMethod(
    this,
    'doLayout',
    [coll],
  );
}