Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Speed Up the GridLayout Method (Read 4711 times)
unisnk
Junior Member
**
Offline


D'Oh!

Posts: 59
Joined: Sep 3rd, 2008
Speed Up the GridLayout Method
Oct 7th, 2008 at 10:05am
Print Post  
Hi,

There is a way to speed up the GridLayout elaboration?
Currently I use these commands:

Code
Select All
procedure GridLayoutArrange;
var gl: GridLayout;
begin
     gl := CoGridLayout.Create();
     gl.GridSize := 80;
     gl.ArrowAnchoring := ancReassign;
     screen.Cursor := crHourGlass;
     flowChartMain.ArrangeDiagram(gl);
     flowChartMain.ZoomToFit;
     flowChartMain.FitDocToObjects(10);
     screen.Cursor := crDefault;
end; 



I checked the numiteration property, what can be the best number to have a good result? Or there is a better way to speed up? (Often nodes >500 and arrows>1000)

This can be a good deal while we wait for the new "progress" method.

Thank you.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Speed Up the GridLayout Method
Reply #1 - Oct 7th, 2008 at 12:34pm
Print Post  
Hi,

Setting StartNode and EndNode could speed it up a bit. Otherwise, setting a smaller NumIterations value is the only way to decrease the algorithm running time. We have recently optimized GridLayout in the .NET version of the control; we'll see if the optimizations can be applied to the ActiveX version too.

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


D'Oh!

Posts: 59
Joined: Sep 3rd, 2008
Re: Speed Up the GridLayout Method
Reply #2 - Oct 7th, 2008 at 3:58pm
Print Post  
I show you a real case:



this is a chart drawn taking data from a database and arranged via GridLayout method. It took nearly 5 minutes with default options (probably less with NumIterations := 500).

The problem is that those charts could be significant larger (up to 3000 nodes and 3000 arrows).

Is there a method to implement a similar layout with less time cost?

Also it would be great if GridSize could be divided into "horizontal" and "vertical" so we can differentiate the spacing and draw different type of nodes (ex. rectangles instead of squares).

Any hints?
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Speed Up the GridLayout Method
Reply #3 - Oct 7th, 2008 at 4:17pm
Print Post  
Could you save that flowchart to a file and email it to support@mindfusion.eu for our developer to test with?
  
Back to top
 
IP Logged
 
unisnk
Junior Member
**
Offline


D'Oh!

Posts: 59
Joined: Sep 3rd, 2008
Re: Speed Up the GridLayout Method
Reply #4 - Oct 7th, 2008 at 4:26pm
Print Post  
okay, let me do a prototype without "sensitive" informations and I'll send you via email.

Is it okay if I export it with SaveToFile Method?

thank you very much.  Smiley
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Speed Up the GridLayout Method
Reply #5 - Oct 7th, 2008 at 4:29pm
Print Post  
sure, use SaveToFile.
  
Back to top
 
IP Logged
 
unisnk
Junior Member
**
Offline


D'Oh!

Posts: 59
Joined: Sep 3rd, 2008
Re: Speed Up the GridLayout Method
Reply #6 - Oct 7th, 2008 at 4:46pm
Print Post  
mail sent  8)
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Speed Up the GridLayout Method
Reply #7 - Oct 8th, 2008 at 3:33pm
Print Post  
Click the link at the top of the page to open the PM page. Download the updated dll from there and copy it over the one in your system32 folder. Now each iteration should be a bit faster, and there is a new GridLayout property, RouteArrows, which you can set to false to make the layout even faster. This code arranges the 3000+3000 graph for two and a half minutes and the results are not that bad -

Dim gl As New GridLayout
gl.RouteArrows = False
gl.NumIterations = 20
fcx.ArrangeDiagram gl

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


D'Oh!

Posts: 59
Joined: Sep 3rd, 2008
Re: Speed Up the GridLayout Method
Reply #8 - Oct 9th, 2008 at 8:37am
Print Post  
great! there was a significant improvement. For the perfection we wait for the "end of rearrangement" event.

Thank you very much for your support. More questions are coming  Wink
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint