Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Nodes Overlapping Problem (Read 5075 times)
anu
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 17
Location: Bhopal
Joined: Jan 27th, 2012
Nodes Overlapping Problem
Jan 9th, 2013 at 6:35am
Print Post  
Hi,
There is one problem with the resulted diagram (resulted digram is attached), that nodes are overlapping to each other. I have tried to apply following layout to solve it
Code (Java)
Select All
private void performLayout(ShapeNode root)
	{
		TreeLayout tl = new TreeLayout();
		tl.setRoot(root);
		tl.setType(TreeLayoutType.Radial);
		tl.setLevelDistance(100);
		tl.setLinkStyle(TreeLayoutLinkType.Cascading3);
		tl.arrange(diag);
	} 



after performing layout i have also use resizeToFitItems() method

diag.resizeToFitItems(countNodes+10);

But i m unable to overcome this overlapping problem. Is there another option that can solve this problem.Thanks for any help.
  

overlap.png (Attachment deleted)
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Nodes Overlapping Problem
Reply #1 - Jan 9th, 2013 at 8:39am
Print Post  
Hi,

Radial layout does not consider node sizes and node positions depend only on on the the LevelDistance value, so you might try increasing it. If you prefer the smaller level distance, run a few iterations of SpringLayout after TreeLayout to pull the nodes apart:

Code
Select All
SpringLayout sl = new SpringLayout();
sl.setIterations(150);
sl.arrange(diagram); 



This shows radial layout followed by spring layout:



You might also try FractalLayout; it arranges trees in radial manner too, considers node sizes and you might like its arrangements better:



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


I Love MindFusion!

Posts: 17
Location: Bhopal
Joined: Jan 27th, 2012
Re: Nodes Overlapping Problem
Reply #2 - Jan 9th, 2013 at 11:57am
Print Post  
Thanks FractalLayout is working well.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint