Maximum Iterations AutoLayoutForced

To Illustrate my problem you can use the WinSample Layout Demo

  • Add 3 Items (ABC) and link them with 2 links. (A-B) (A-C)
  • Add a fourth item (D) and do not link it.
    Then do CTRL-F and OK
    My problem is that is that the high number of iterations resize the GoView too much and the whole thing becomes unreadable and the D get stuck at a far end of the screen.
    Is there a way to prevent this and keep things close together besides lowering the number of iterations ? And if not, how can I extrapolate a “Magic” iteration count.
    Thanks
    Dimitri

Yes, the default force-directed autolayout parameters don’t limit disconnected graphs (including individual nodes). If this were the “real world”, you would get the same behavior, because apparently there is no force holding together two nodes that don’t have a path of links connecting them.
It depends on what you want to do, but you would perform repeated autolayouts, each working on a separate connected graph independently. You can do that by constructing separate GoLayoutNetworks, each with a connected graph. Afterwards you can decide how to place each partial graph–either filling in your document in some manner, or maybe overlapping.
Alternatively you can decide to keep them all together (so that nodes from different connected partial graphs can influence each other) by using a force field around them all. The Layout User Guide provides the code for this, as the first code example in the Advanced Topics chapter.