Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Rearrange and Layouts : I can never get it right (Read 7035 times)
yrauma
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 61
Joined: Mar 28th, 2010
Rearrange and Layouts : I can never get it right
Nov 17th, 2011 at 12:54am
Print Post  
Hello Stoyan !

It has been a while since I came here !

I do have problems rearranging my diagram. I have nodes and containers in it !

I use the LayeredLayout as follow :

Code
Select All
_layout = new LayeredLayout();



  _layout.LayerDistance = 40;



  _layout.NodeDistance = 40;



  _layout.SplitLayers = true;



  _layout.KeepRootPosition = false;



  _layout.StraightenLongLinks = true;



  _layout.KeepGroupLayout = true;



  _layout.EnforceLinkFlow = true;



  _layout.LinkType = LayeredLayoutLinkType.Straight;



  _layout.Anchoring = Anchoring.Keep;



  _layout.IgnoreNodeSize = false;



  _layout.EnableCustomLayers = true;



  _layout.LinksCompactFactor = 0.0f;
 



I was using 5.3.5 and I had this :



I tried the 5.7 and saw some improvement :



But this is still not it ! I have weird broken links as you can see on the top of the driagram !
I need this to be the cleanest possible.

I think the issues I have are because we use containers.

Do you have any advice for me so that I can arrange the rearrange ?
Maybe I forgot a parameter or something ?

Thank you !

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Rearrange and Layouts : I can never get it rig
Reply #1 - Nov 17th, 2011 at 8:48am
Print Post  
Hi Amaury,

If you need to remove all link bends, loop over diagram.Links and set links' SegmentCount to 1 after applying the layout.

Stoyan
  
Back to top
 
IP Logged
 
yrauma
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 61
Joined: Mar 28th, 2010
Re: Rearrange and Layouts : I can never get it rig
Reply #2 - Nov 17th, 2011 at 5:29pm
Print Post  
Hello Stoyan !

It is better yes, but still not what I want.

Here is what I have using the segment count after a rearrange :



But this is what I want :



As you can see the reordering makes way more sens and links are not crossed !

I moved it by hand to have this results, but I want it to be done programmatically. The pink container for example should be on the left, I dont get why I have this result !

Do you have any idea what settings I could use or what I need to do ?

Thank you !
  
Back to top
 
IP Logged
 
yrauma
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 61
Joined: Mar 28th, 2010
Re: Rearrange and Layouts : I can never get it rig
Reply #3 - Nov 17th, 2011 at 9:53pm
Print Post  
Actually on a lower scale, this is the problem I am having :

I have this :


and I want this:


No cross link..
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Rearrange and Layouts : I can never get it rig
Reply #4 - Nov 18th, 2011 at 12:33pm
Print Post  
You can't do anything about it if you are using this method:
http://mindfusion.eu/Forum/YaBB.pl?board=fcnet_disc;action=display;num=127351559...

since the outer layout does not receive any information about the containers' children and cannot know if links between them would cross.

If the child nodes will always form a tree as in the images above, and only nodes under the same branch will be grouped in a container, you could try using TreeLayout. Collect all nodes except containers and all links in a DiagramItemCollection, and pass it to the TreeLayout.Arrange(items) method. Then loop over all containers, and call their UpdateBounds method to make the containers fit their children as placed by TreeLayout.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
yrauma
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 61
Joined: Mar 28th, 2010
Re: Rearrange and Layouts : I can never get it rig
Reply #5 - Nov 18th, 2011 at 3:33pm
Print Post  
Hey Stoyan !

Actually not this is just random but users are supposed to do whatever they want.

Am I to understand that there is no solution for my problem ?

If so I am going to have to change mindFusion for another Third Party.
« Last Edit: Nov 18th, 2011 at 7:51pm by yrauma »  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Rearrange and Layouts : I can never get it rig
Reply #6 - Nov 21st, 2011 at 8:54am
Print Post  
Hi,

If you could at least ensure that nodes in the same container are from the same graph layer, then probably this could be implemented with some additional sorting of nodes after LayeredLayout completes.

If the graphs will be completely random, one thing you could try is to run AnnealLayout as outer layout, with its ApproximateLinkLength property set to false. Then it should consider the points where links go out from containers when trying to minimize their lengths, and so connected inner nodes should appear closer to each other in the final layout. However this still won't sort the inner nodes if using a two stage layout.

Otherwise, I have found some modifications of spring layout that could help for that, if you feel like coding layout algorithms you could modify the SpringLayout code to add support for clusters as described here (where clusters will correspond to containers' content):
http://atlas.irit.fr/PIE/VSST/Actes%20VSST'2007%20Marrakech/23-B9-Visualisation-...
http://crpit.com/confpapers/CRPITV60Omote.pdf

Stoyan
« Last Edit: Nov 21st, 2011 at 12:07pm by Stoyo »  
Back to top
 
IP Logged
 
yrauma
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 61
Joined: Mar 28th, 2010
Re: Rearrange and Layouts : I can never get it rig
Reply #7 - Nov 21st, 2011 at 9:49pm
Print Post  
Hello Stoyan !

Unfortunatly it did not work. I tried to play with that a little and never got any good result.

But why does my lines cross exactly ? Is is because the inside of the containers is not move at the same time ?

About creating my own algo, it scares me a bit, I took a look into your codebase, and it is a big load of work to get this work. I dont think I'll have time for this.
Is there a quick way to create or improve an algo that I dont know of ?

Thanks.
Amaury
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Rearrange and Layouts : I can never get it rig
Reply #8 - Nov 22nd, 2011 at 9:45am
Print Post  
Hi Amaury,

The lines cross because of the inner / outer layout separation you are using. The outer layout knows nothing about the inner nodes and links between them, but it only sees the containers. Next when building the internal graph model that represents the diagram, LayeredLayout creates one graph edge to represent all connections between the same couple of containers, and so can't prevent crossing of actual links in any way.

If your graphs won't be completely random but allow some sort of layering as in the sample screenshots above, perhaps you will get nice results by extending LayeredLayout to support multiple edges between nodes instead of replacing repeating connections with a single edge. Then the code that arranges nodes in the same layer could set their order accordingly to the order of edges determined by the inner layout from the previous step.

If your graphs will be completely random, I think the SpringLayout extension is the only option - I could not find anything else on Google.

Unfortunately there's no quick way to create layout algorithms, they usually end up several thousands lines of code. If you decide whether you'd like a LayeredLayout or SpringLayout extension, you could post it as a feature request and our developers will probably implement it in a future release. If you need this urgently, you could contact sales@mindfusion.eu to arrange for our developer to work on this ASAP as a contract job.

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