Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Split Layers (Read 2890 times)
lorca
YaBB Newbies
*
Offline



Posts: 3
Joined: Jan 24th, 2008
Split Layers
Jan 24th, 2008 at 8:20am
Print Post  
Hi,

First of all let me say how much I like the prodcut. It really does the job for us.

However, I am having some issues witht the split layers functionality.

Here is my code:

Code
Select All
Dim layout As LayeredLayout = New LayeredLayout()
layout.Orientation = MindFusion.Diagramming.Layout.Orientation.Horizontal
layout.SplitLayers = True
layout.LayerDistance = 10
layout.NodeDistance = 15
layout.Direction = Direction.Reversed
layout.Orientation = MindFusion.Diagramming.Layout.Orientation.Vertical
layout.IgnoreNodeSize = False 



And here is the result:



Why hasn't the very wide layer been split up?

My understanding of the SplitLayers property is that when set to true it will break up any layers that are much wider than other layers. I can't seem to get that to happen. Does anybody know what I'm doing wrong?

Many thanks
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Split Layers
Reply #1 - Jan 24th, 2008 at 9:22am
Print Post  
Hi,

Layers are split only for graphs that have more than 50 nodes. Currently that's a hard-coded value, but we will make it a public property in the next version.

Stoyan
  
Back to top
 
IP Logged
 
lorca
YaBB Newbies
*
Offline



Posts: 3
Joined: Jan 24th, 2008
Re: Split Layers
Reply #2 - Jan 24th, 2008 at 9:43am
Print Post  
Thanks for the quick reply!

So if I had more than 50 nodes in that diagram, then I should get split layers?

Unfortunately that's not what I'm seeing; even after adding 200 extra nodes to the wide layer, I still can't make it split.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Split Layers
Reply #3 - Jan 24th, 2008 at 10:29am
Print Post  
This worked in my test:

Code
Select All
for (int i = 0; i < 62; ++i)
	diagram.Factory.CreateShapeNode(10, 10, 10, 10);

diagram.Factory.CreateDiagramLink(
	diagram.Nodes[0], diagram.Nodes[1]);

for (int i = 2; i < 61; ++i)
	diagram.Factory.CreateDiagramLink(
		diagram.Nodes[1], diagram.Nodes[i]);

diagram.Factory.CreateDiagramLink(
	diagram.Nodes[60], diagram.Nodes[61]);

LayeredLayout ll = new LayeredLayout();
ll.SplitLayers = true;
ll.IgnoreNodeSize = true;
ll.Arrange(diagram);

diagram.ResizeToFitItems(5);
 



Could you save your diagram and email it to support@mindfusion.eu?

Stoyan
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Split Layers
Reply #4 - Jan 24th, 2008 at 10:48am
Print Post  
You will notice that even when that works, the result is not pretty, since LayeredLayout cannot arrange so many links in that tight area. You could apply orthogonal layout after the layered one for the sake of arranging the links:

diagram.Nodes[1].Resize(30, 30);
OrthogonalLayout ol = new OrthogonalLayout();
ol.Arrange(diagram);

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



Posts: 3
Joined: Jan 24th, 2008
Re: Split Layers
Reply #5 - Jan 24th, 2008 at 12:03pm
Print Post  
Your code did induce split layers. Thanks for posting that.

However, what you can't tell from my original image is that all my links go the other way.

I altered the code to reflect this:

Code
Select All
for (int i = 0; i < 62; ++i)
   diagram.Factory.CreateShapeNode(10, 10, 10, 10);

diagram.Factory.CreateDiagramLink(diagram.Nodes[1], diagram.Nodes[0]);

for (int i = 2; i < 61; ++i)
   diagram.Factory.CreateDiagramLink(diagram.Nodes[i], diagram.Nodes[1]);

diagram.Factory.CreateDiagramLink(diagram.Nodes[61], diagram.Nodes[60]);

LayeredLayout ll = new LayeredLayout();
ll.SplitLayers = true;
ll.IgnoreNodeSize = true;
ll.Direction = Direction.Reversed;
ll.Arrange(diagram);

diagram.ResizeToFitItems(5); 



And this then did reproduce my error - the wide layer won't split.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Split Layers
Reply #6 - Jan 24th, 2008 at 2:22pm
Print Post  
Ok, apparently splitting the layers is done only in the parent->child direction, and that does not work in your case where there are 60 parents of a single node. Our layout developer will try to fix this for the next release. Meanwhile you could set the HeadShape and BaseShape properties of the links to make them look as if going the other way.

Stoyan
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint