Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Tree Layout of nodes with many origins and destina (Read 1982 times)
sweetdeath
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 18
Joined: Mar 16th, 2011
Tree Layout of nodes with many origins and destina
May 30th, 2011 at 11:33am
Print Post  
Hello, Stoyan. If I have generated some nodes, and I want to layout them automatically by inner layout engine, just like Tree Layout. First, I generated all the nodes, and then I use "TreeLayout.Arrange(diagram)"to rearrange them. However, it doesn't work well, for example, some links have cross nodes. Can you tell me how solve this problem? Thanks!
« Last Edit: May 30th, 2011 at 1:44pm by sweetdeath »  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Tree Layout of nodes with many origins and des
Reply #1 - May 30th, 2011 at 11:49am
Print Post  
Hi,

Use LayeredLayout instead of TreeLayout. TreeLayout ignores links that are not part of the graph's spanning tree.

Another option is to use the ArrangeLink delegate to find out which links have been processed by TreeLayout, and call the Route method on all other links so that they avoid crossing nodes.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
sweetdeath
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 18
Joined: Mar 16th, 2011
Re: Tree Layout of nodes with many origins and des
Reply #2 - May 31st, 2011 at 2:22am
Print Post  
Thanks for your reply.
I have tried your two methods, but the LayeredLayout also works not well.
In our project, we need to build a resource flow chart like a tree; it is very obvious for the hierarchical relationship between levels. Therefore, a node would have some origin nodes, and each origin node also have a sub-tree itself. In this situation, if I use the TreeLayout, some unexpected results occur, for example, node overlapping and link cross the node.
How can I use ArrangeLink to avoid this problem? How can I find out which links have been processed by TreeLayout? Thanks!
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Tree Layout of nodes with many origins and des
Reply #3 - May 31st, 2011 at 5:00am
Print Post  
LayeredLayout should work fine in that scenario if you set EnforceLinkFlow to true, so that link origin nodes are always placed above link destination nodes.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint