@walter Thanks for #2. It seems to work and stops generating random graphs.
However I still cannot seem to resolve #1. The node I have set to fixed… it still positions itself in odd places. For example, it might position itself in the bottom right of the canvas. I am trying to get it to position directly in the middle. Is that even possible with ForceLayout?
Maybe I misunderstood what you wanted to do. If you don’t care about where your “special” node is relative to other nodes in your graph, but you do care about where that node appears in your viewport (a.k.a. canvas) when the layout is done, then maybe you just want to call Diagram.centerRect at the appropriate time.
myDiagram = $(go.Diagram, ...,
{ ...
"initialLayoutCompleted": function(e) {
var node = e.diagram.findNodeForKey(...);
// ... or however you want to find your special node
if (node !== null) e.diagram.centerRect(node.actualBounds);
}
}
);
Remember that by default the diagram cannot scroll beyond the edges of its document bounds, so if the desired node is near the edge of the document, the node might still appear near the corresponding edge of the viewport, not precisely at the center.
There is no way to force ForceDirectedLayout to make sure that a particular vertex/node is precisely at the center of the resulting graph.