doLayout method
Position all of the nodes that do not have an assigned Part#location in the manner of a simple rectangular array. The default implementation ignores all Groups and Links; many subclasses of Layout ignore all instances of Parts that are not Nodes or Links.
You can override this method to do whatever node positioning and link routing that you wish.
When the layout makes use of a LayoutNetwork, this method should call #makeNetwork and #updateParts. The #updateParts method will call #commitLayout within a transaction. The outline of such an override should be like:
public doLayout(coll) {
if (this.network === null) this.network = this.makeNetwork(coll);
// assign LayoutVertex.bounds to all vertexes in the network:
var vit = this.network.vertexes.iterator;
while (vit.next()) {
var v = vit.value;
v.centerX = ...
v.centerY = ...
}
this.updateParts();
this.network = null;
}
Override #commitLayout to actually position nodes and route links.
When the layout does not make use of a LayoutNetwork, this method should make direct changes to Nodes and Links within a transaction, and it should call #collectParts on the argument coll in order to get the proper set of Nodes and Links to work on. Examples are provided in the Extensions directory.
If this Layout belongs to a Diagram, the argument must be either the same Diagram or must denote Parts that belong to the Diagram. Please read the Introduction page on Extensions for how to override methods and how to call this base method. @expose @param {Diagram|Group|Iterable.
Implementation
void doLayout(_i2.Object coll) {
_i4.callMethod(
this,
'doLayout',
[coll],
);
}