Arrange all Child nodes

I want to do arrange all child jobs in nice format in

rectangle shape.



Here i am attaching screen shot explaining my problem.



I can insert into rectangle format but i need to arrange the nodes

which users draws individual nodes.



Looking for your suggestions.

A simple Layered Digraph looks like it will work well.







The layout sample doesn’t let me set the links to Orthogonal=true with Style=RoundedLine, but that will make the links look like you draw them.



One thing… the little pairs of blue blocks… are those one node with an input and an output? If that’s true, you are all set. If not, you’ll have to create a “virtual link” between them in the layout.Network before doing the PerformLayout.

Hi,

I used code like
Dim Layout As GoLayoutLayeredDigraph = New GoLayoutLayeredDigraph() Layout.Document = Me.Document Layout.SetsPortSpots = False Dim network As GoLayoutLayeredDigraphNetwork = Layout.CreateNetwork() network.AddNodesAndLinksFromCollection(coll, True)
this is some what does what i needed. This is working when i have equal nodes on top and bottom.
How ever if nodes are different i am not getting rectangle shape.
Here i am attaching two screens explain my problem.
Is there any way i can arrange this into rectangle shape.
After arranging
UserUploads/20110127_154447_afterArrange.jpg

Right. Layered Digraph lays out things in “layers”, so the nodes. So Block 1 goes in layer 2 and Block 2 & 3 go in layer 3 (layer 1 is the blue node on the left).



So, if you block 3 half way between 1 and 2, you’ll have to do some customization via overrides. Read through the Advanced Options section of the Layout User Guide.



Actually, to my eye, I like the way it is doing the layout already. But maybe I’m just used to the way our algorithm works.

Hello Jake,



I have read advanced options for GoLayoutLayeredDigraph layout.



For adding new layer for block3 AssignLayers routine looks like i need to override.



I looked all samples for customising GoLayoutLayeredDigraph class and AssignLayers i could not find it.



Could please send some simple class for overriding this and how to add new layer.



Hello Jake,



Further to my previous message network layout when PerformLayout is putting to top left.



I want to keep left blue block position should not be changed.



I tryed setting Layout.ArrangementOrigin position to left block position. Still moves little bit.



Can you suggest me how can i keep left block constant.

We typically advise that when you override AssignLayers, you call the base method, then step through the network and “tweak” the assignment of layers. In your case, you want to create a whole new layer (one or more actually) which has the effect of bumping up the layer assignment of every node after that. (in the example above, when you create a new layer for Block 3… Block 2 and the blue block have to be bumped.)



That’s non trivial.



And the way layer spacing works, you won’t get the effect of spacing 3 half way in between 1 and 2, but rather would be leaving 1 and 3 where they are, and moving Block 2 to the right… spreading out your graph… probably more than you want.



It may be easier to let Layout run, then write your own traverses the paths from each blue node to each blue node computing distance, then centering your Blocks on each path.

LayeredDigraph doesn’t let you “lock down” nodes, it wants the freedom to move them all.

Hello jake,
"It may be easier to let Layout run, then write your own traverses the paths from each blue node to each blue node computing distance, then centering your Blocks on each path."
This option looks better for me. Is there any function i can override or use it. I was calling performLayout from node rightmenu.
"LayeredDigraph doesn't let you "lock down" nodes, it wants the freedom to move them all."

Here i want to move all the layout (all the nodes and links). Really after running layout i want to keep left middle point of layout rectangle equal to orignal open bracket block(left blue block) position.
ArrangementOrigin only have effect before running layout. Does not have affect after.
Layout.PerformLayout() Layout.ArrangementOrigin = OrigPoint
Can you suggest me how can achieve this task.

This option looks better for me. Is there any function i can override or use it. I was calling performLayout from node rightmenu.



There’s no single function… I’m suggesting you write code to traverse the diagram and “fix it up” according your own aesthetics. See the section in the User Guide on Traversing a Diagram.



> Can you suggest me how can achieve this task



First, call Doc.Bounds = Doc.ComputeBounds(); (where Doc is your GoDocument)



this computes the complete bounds of the nodes and links.



Then you can adjust GoView.DocPosition to move the view’s position on the document.