Mirrored Tree Layout


I am working on creating a mirrored tree layout, essentially I want a there to be two trees in this diagram on running down and the other running upwards.
I was planning on SubClassing GoLayoutLayeredDigraph and passing the whole document in and then perform two layouts (one for each tree). Is this possible, as I am having problems. The first problem is accessing individual layers, I was hoping to AddNodesAndLinksFromCollection for the two layers I need, however there are three layers (one for the links) is there any way I can use an indexer on the Layers Collection?
The second is, is it actually possible to perform two layouts on essentially different networks in the same document?
The third is, are there any functions to find the bounding rectangle of a layer, and also easily move the posistions of all the nodes relative to another layer. The example being, we layout the two graphs, then move each node in the second tree underneath the first?

  1. No, it’s easiest to figure out how many objects there are in the two layers, allocate an array, and call IGoCollection.CopyTo on each layer to your array.
  2. Yes. A recursive layout to handle GoSubGraphs is another example of this.
  3. Yes, you can use the static method GoDocument.ComputeBounds, which takes an IGoCollection.
    And yes, you can create a GoSelection (which is a subclass of GoCollection and therefore also implements IGoCollection) of your objects and call GoView.MoveSelection.


Wow cheers. I will look into this right now.
Kind Regards,
Paul Kinlan