Page Index Toggle Pages: 1 Send TopicPrint
Hot Topic (More than 10 Replies) Horizontal Distribution of nodes (Read 4253 times)
Bala
Full Member
***
Offline


I love YaBB 1G - SP1!

Posts: 156
Joined: Apr 21st, 2009
Horizontal Distribution of nodes
Jun 19th, 2009 at 4:16pm
Print Post  
Hi Stoyan,
I want to distribute nodes in Horizontal and Vertical manner for UnConnected nodes(Nodes which have no link in between them).

I have used following code for vertical. Please let me know about the possible solution.


Code
Select All
TreeLayout treeLayout = new TreeLayout();
				    treeLayout.KeepGroupLayout = true;
				    treeLayout.Type = TreeLayoutType.Cascading;
				    treeLayout.Direction = TreeLayoutDirections.TopToBottom;
				    treeLayout.MultipleGraphsPlacement = MultipleGraphsPlacement.Vertical;
				    treeLayout.Balance = TreeLayoutBalance.RightHeavy;
				    treeLayout.KeepRootPosition = true;
				    treeLayout.LayoutNode = LayoutNodeHandler;
				    treeLayout.Arrange(diagram, items); 




where items is the collection of all nodes of the diagram.


Thanks in advance,
Bala
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Horizontal Distribution of nodes
Reply #1 - Jun 22nd, 2009 at 5:51am
Print Post  
Hi,

Does this code work as you expect it in vertical direction? If it does, you can change the Direction and MultipleGraphsPlacement properties respectively to LeftToRight and Horizontal. The images you had emailed us did not show unconnected nodes, but if you are happy with how the connected ones are arranged, you could add some temporary links between the single nodes so the layout processes them as a connected graph.

Stoyan
  
Back to top
 
IP Logged
 
Bala
Full Member
***
Offline


I love YaBB 1G - SP1!

Posts: 156
Joined: Apr 21st, 2009
Re: Horizontal Distribution of nodes
Reply #2 - Jun 22nd, 2009 at 12:35pm
Print Post  
Hi Stoyan,

No this dode is not working as I am expecting.

Quote:
if you are happy with how the connected ones are arranged, you could add some temporary links between the single nodes so the layout processes them as a connected graph.


Add some temporary links will increase the overhead in application and performance will be degraded.Is there any other way to do this.

Please help me out to solve this.

Regards,
Bala
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Horizontal Distribution of nodes
Reply #3 - Jun 22nd, 2009 at 2:48pm
Print Post  
I don't even know how you want these unconnected nodes arranged; the images you emailed showed a fully connected graph.

Do you need all unconnected nodes arranged in their own grid, placed near the other graph components? If so, you could add them to a collection, loop over it and set the nodes' positions using code similar to the post here:
http://mindfusion.eu/Forum/YaBB.pl?board=fcnet_disc;action=display;num=123610226...

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Horizontal Distribution of nodes
Reply #4 - Jun 23rd, 2009 at 11:14am
Print Post  
https://mindfusion.eu/_beta/wpfdiag_sortgraphs.zip

This version adds the HorizontalSortDescending member (and a few others) to the MultipleGraphsPlacement enumeration. You can assign it to the layout.MultipleGraphsPlacement property to have all unconnected nodes placed together at the right side of the diagram as in your _Needed images.

Stoyan
  
Back to top
 
IP Logged
 
Bala
Full Member
***
Offline


I love YaBB 1G - SP1!

Posts: 156
Joined: Apr 21st, 2009
Re: Horizontal Distribution of nodes
Reply #5 - Jun 25th, 2009 at 11:37am
Print Post  
Hi Stoyan,

I have tried with the dll's given by you but problem is still same.

1) In case of unconnected node, when I go for Distribute Vertically all nodes change their x and y position and arrange vertically.In this case x position should not change
2). In case of Connected node,
i) Nodes are changing their both position(x and y).
ii) If I set KeepRootPosition=true; in that case, all child nodes(attached expand node) which have some incoming links, changes their position even if they are locked.
3). I have used treeLayout.Arrange(diagram) method because I want to perform this operation for all nodes of diagram(selected, unselected,connected or disconnected). Is it ok?

I am sending a sample application to you, to see the actual problem.Please help us to solve this problem as soon as possible.

Many thanks in advance,
Bala
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Horizontal Distribution of nodes
Reply #6 - Jun 26th, 2009 at 6:34am
Print Post  
In all these distribution posts, did you mean preserving the horizontal / vertical positions of the nodes while placing them at equal distances respectively in vertical / horizontal direction? I don't see how TreeLayout can help you with that, but sorting the nodes and moving them according to their sorted position should do as you mentioned in the vertical distribution topic.
  
Back to top
 
IP Logged
 
Bala
Full Member
***
Offline


I love YaBB 1G - SP1!

Posts: 156
Joined: Apr 21st, 2009
Re: Horizontal Distribution of nodes
Reply #7 - Jul 2nd, 2009 at 10:43am
Print Post  
Hi Stoyan,

I have solved Horizontal and Vertical layout problem by using sorting but I am unable to find out the logic behind Hierarchical and Compact. I have sent sample images to your support ID.Please have a look into them and give your valuable suggestion to us.

Thanks,
Bala
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Horizontal Distribution of nodes
Reply #8 - Jul 2nd, 2009 at 12:23pm
Print Post  
Compact_Getting.JPG

Compact_Needed.JPG

Hierarchical_Getting.JPG

Hierarchical_Needed.JPG


From what I can see in these images, you mostly need to move the unconnected nodes to the right? We added the Sort- members of MultipleGraphsPlacement last week to let you do that. If the problem is the orientation of the bigger subgraph, you can set that using the LayeredLayout.Orientation property.

Stoyan
  
Back to top
 
IP Logged
 
Anshul
Senior Member
****
Offline


I love YaBB 1G - SP1!

Posts: 316
Joined: Apr 3rd, 2009
Re: Horizontal Distribution of nodes
Reply #9 - Nov 21st, 2009 at 5:29am
Print Post  
Hi Stoyan,

I want to ask a very small question.
In case of LayeredLayout and GridLayout what is the default style of link? Is it PolyLine or Cascading?

Regards,
Anshul
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Horizontal Distribution of nodes
Reply #10 - Nov 21st, 2009 at 8:46am
Print Post  
Hi Anshul,

LayeredLayout sets the links Style to Polyline, and  GridLayout preserves their original style.

Regards,
Stoyan
  
Back to top
 
IP Logged
 
Anshul
Senior Member
****
Offline


I love YaBB 1G - SP1!

Posts: 316
Joined: Apr 3rd, 2009
Re: Horizontal Distribution of nodes
Reply #11 - Nov 21st, 2009 at 8:50am
Print Post  
Thanks Stoyan Smiley
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint