Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Link routing overlapping nodes (Read 3862 times)
ChrisPatrick
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 2
Joined: Mar 4th, 2012
Link routing overlapping nodes
Mar 5th, 2012 at 12:30am
Print Post  
I've made some great progress in creating the chart we're after, however I'm coming across a situation where the routing between nodes seems to go haywire. This only happens rarely and mainly in very large charts (1000+ nodes) formatted as a tree layout.

The route seems to get confused, and what should take 2 or 3 segments, ends up looping around, or overlapping, nodes and taking 5-6 segments. I've attached screen shots.

My program flow is as such:
  • Create and size all nodes. Node size is calculated manually, set, and then refined using "ResizeToFitText" maintaining node width.
  • Next, all links are created. If the destination node is a leaf, then the link to the parent node is attached to an anchor in the bottom left corner of the parent. All other nodes are set to their default anchor (bottom middle).
  • After that, I compact the nodes vertically and "stack" the leaf nodes. After the node is moved I call link.route.
  • Finally, I create the TreeLayout with the following parameters:

TreeLayout layout = new TreeLayout();
layout.NodeDistance = 35f;
layout.LevelDistance = 35f;
layout.Anchoring = Anchoring.Keep;
layout.EnableAssistants = true;
layout.LinkStyle = TreeLayoutLinkType.Cascading3;

layout.Arrange(diagram1);

Code can be posted or emailed if needed.

Thank you!!
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Link routing overlapping nodes
Reply #1 - Mar 5th, 2012 at 7:08am
Print Post  
Hi,

It seems you forgot to attach the images.

Quote:
After the node is moved I call link.route. Finally, I create the TreeLayout with the following parameters...


I think in that case the routes set by link.Route() will be replaced by whatever shapes are specified in TreeLayout.LinkStyle. However if the diagram isn't a strict tree (each node except the root has exactly one parent), some links will be ignored and their intermediate control points left unchanged. You might call Route on such links after applying TreeLayout, or use LayeredLayout instead.

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


I Love MindFusion!

Posts: 2
Joined: Mar 4th, 2012
Re: Link routing overlapping nodes
Reply #2 - Mar 6th, 2012 at 2:54am
Print Post  
Odd that the images didn't stick. I've uploaded them to a web site here: http://imgur.com/a/1t9d8

I added a diagram.RouteAllLinks() call after arranging the tree, but that didn't impact the final result. This is a strict tree in the sense that each node has at most one parent.

I'll look into using a LayeredLayout.

Thanks!
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Link routing overlapping nodes
Reply #3 - Mar 6th, 2012 at 7:15am
Print Post  
Could you try setting Transparent = false for all nodes to check if they overlap? In that case, auto-routing might fail to find a path or find only some longer/winding paths. You might have to set larger NodeDistance and LevelDistance values to avoid overlapping when there are large nodes in the tree.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint