Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic layout question (Read 2819 times)
KillaChris
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 18
Joined: Apr 25th, 2012
layout question
Jul 20th, 2012 at 10:18am
Print Post  
Hello,
at the moment im using the layerdlayout with a horizontal orientation, i have a Diagramm, in the middle of the Diagramm there is one Node, on the left side there are many nodes, that link to the middlenode and on the right side are many nodes as well, the middle node links to the nodes on the right side. As you can see in the screenshot.
Now lets say every node has a Date, from 1995 to 2010 or so.
Now it would be great if the layout could look like a timeline.
Let's say i have the value 1995 on the left side of the view and the value 2010 on the right side of the view.
Now every node with the date 1995 should be listed under 1995 and so on.
Is there a specific factor which can be set that the layout mechanism puts some nodes more on the left side than other nodes?

On the first screenshot you can see what the layout mechanism produces and on the second screenshot you can see how it should look like.
I hope that there is a value that can be set to get this result.
Perhaps i have to use an other layout to do this?
It would be nice if you can help me.
  

screen.jpg (Attachment deleted)
screentobe.jpg (Attachment deleted)
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: layout question
Reply #1 - Jul 20th, 2012 at 11:45am
Print Post  
Hi,

Try setting layout.EnableCustomLayers and specify each year as a zero-based index assigned to the LayeredLayoutTraits.Layer key of node.LayoutTraits. This is supported only if there are no connected nodes on the same layer. You could also try using SwimlaneLayout with vertical lanes, where each lane represents one year.

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


I Love MindFusion!

Posts: 18
Joined: Apr 25th, 2012
Re: layout question
Reply #2 - Jul 20th, 2012 at 12:09pm
Print Post  
Ok at first thank you.
But i don't exactly understand that.
If i got you right i have to use the node.layouttraits.add method?
So i should add for all nodes, which should be in the 1999 "layer" the 1999 as key?
But in the layouttraits.add method i have to pass two parameters, the key parameter and a value parameter.
I just tried a little bit but i think i'm doing something wrong.
I hope you can tell me how to do this exactly.
Perhaps i have missunderstood you.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: layout question
Reply #3 - Jul 20th, 2012 at 2:16pm
Print Post  
The custom layer indices should start from 0, so you must subtract your earliest year from the node's date to get its layer:

node.LayoutTraits[LayeredLayoutTraits.Layer] = nodeDate.Year - startYear;

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


I Love MindFusion!

Posts: 18
Joined: Apr 25th, 2012
Re: layout question
Reply #4 - Jul 30th, 2012 at 7:31am
Print Post  
Thanks that already helped me a bit.
Now it already puts some nodes in the right layer, but there are as well nodes, which are on the wrong layers.

I solved the problem with the years with a list.
I create a new list of Integer and put each year in this list, because there are some spaces in between, e.g. there are year 1985, 1986 but the next on is 1992, so if u would use your solution with nodedate.year - startyear there would be layer 0 and layer 1 and then there would be nothing till layer 7 or so.
Because of that i build a list of all the years and then use the index out of the list so there are no spaces between the layers.

Now the question:
The first to layers are alright, but then there is the old structure.
Is it perhaps a problem if a at first create the node with the year 2008 and set its layer to perhaps 11 then create the node with 2007 and set its layer to 10 then create the node with year 1986 and set its layer to 0.
Or do i have to start with 1986 and set its layer to 0 and then go forward so that the layers are created in the right order? Or doesnt make that any diffrence?
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: layout question
Reply #5 - Jul 30th, 2012 at 12:53pm
Print Post  
Quote:
The first to layers are alright, but then there is the old structure.


What do you mean by "old structure"? The creation order of nodes should not matter. One requirement when using custom layers is there shouldn't be links between nodes on the same layer. You might get strange results if you don't watch out for this. I suppose SplitLayers might not work well with custom layers too.
  
Back to top
 
IP Logged
 
KillaChris
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 18
Joined: Apr 25th, 2012
Re: layout question
Reply #6 - Jul 30th, 2012 at 1:50pm
Print Post  
Well there are no connections on the same layer.
The first 2 or 3 nodes a placed like they should.
But then there are all nodes under each other. 1998, 2001, 2004, they are all in one "layer", but they have different customlayer values.
But right at the moment I'm trying to solve it with the swimlane-layout. Perhaps that works for me.

I still need a bit until I'm ready, but i let you know if this could solve my problem.

Thanks Smiley

Edit:

Okay with the swimlane layout everything works alright Smiley
Thank you very much for your help!
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint