Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Bug in Layout.Arrange(Diagram, DiagramItemColl...? (Read 2651 times)
mr.brick
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 4
Joined: Dec 16th, 2008
Bug in Layout.Arrange(Diagram, DiagramItemColl...?
Dec 18th, 2008 at 3:27pm
Print Post  
Hello,

I'm using spring layout, when arranging using the method Layout.Arrange(Diagram) everything works as expected.

However when the method Layout.Arrange(Diagram, DiagramItemCollection) is used with a set of diagram items to be arranged, the results are wrongly different. The items are not laid out as expected.

Sample follows.
[code]
SpringLayout layout = new SpringLayout();
layout.IterationCount = 1000;
layout.EnableClusters = true;
layout.MinimizeCrossings = true;
layout.MultipleGraphsPlacement = MultipleGraphsPlacement.Vertical;
layout.NodeDistance = 50f;

// works
layout.Arrange(Diagram);

// this doesn't work
//layout.Arrange(Diagram, diagramItems);
[/code]

Thanks!
Hynek Cihlar
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Bug in Layout.Arrange(Diagram, DiagramItemColl
Reply #1 - Dec 18th, 2008 at 4:08pm
Print Post  
Hi,

You must also add the links to diagramItems. Have you done that?

If you need the layout to keep some nodes at their initial positions, instead of using Arrange(DiagramItemCollection), consider setting node.LayoutTraits[SpringLayoutTraits.Frozen] = true for such nodes. That will make SpringLayout consider the repulsion forces applied by them to the rest of the nodes.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
mr.brick
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 4
Joined: Dec 16th, 2008
Re: Bug in Layout.Arrange(Diagram, DiagramItemColl
Reply #2 - Jan 7th, 2009 at 1:37pm
Print Post  
Thanks for replying and for the tip to keep nodes at their initial positions when laying out with the spring layout.

Yes, I tried to add the diagram links to the collection as well. Unfortunately with the sane effect.

Hynek Cihlar
BoldBrick, s.r.o.

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Bug in Layout.Arrange(Diagram, DiagramItemColl
Reply #3 - Jan 7th, 2009 at 2:49pm
Print Post  
Quote:
The items are not laid out as expected.


Like they don't look as arranged by SpringLayout, or the items from the collection are arranged, but overlap with the ones that are not in the collection? The latter would be the expected result, unless you also specify LayoutArea that does not contain the ignored items.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint