If your situation is like the Arrowheads sample, there is a particular node, which I will call the “root” node, in each subnetwork that is laid out by the ArrangingLayout.primaryLayout. You don’t want that root node to be put in the circle, but you want to put that node at the center of the circle.
So the first step is to make sure the root node is not positioned by the CircularLayout in the ArrangingLayout.preparePrimaryLayout function:
if (root !== null) {
root.isLayoutPositioned = false;
lay.root = root;
// ...
We save the reference to that “root” node on the layout so that at the end of the layout we can put it at the center. That can be accomplished in an override of CircularLayout.commitNodes:
primaryLayout: $(go.CircularLayout,
{
commitNodes: function() {
go.CircularLayout.prototype.commitNodes.call(this);
if (this.root) {
this.root.location = this.actualCenter;
this.root.isLayoutPositioned = true;
this.root = null;
}
}
}),
This also depends on the node template setting Part.locationSpot to go.Spot.Center
.