Nevron Forum

diagram loading and layout performances

https://www.nevron.com/Forum/Topic4441.aspx

By Marco Finizio - Monday, November 8, 2010

Hi, i am using your evaluation version to understand if the nevron diagram API is suitable for displaying large amounts of graph data (nodes and connectors).

However, i see that it is REALLY slow in particular:

1) when adding the NNodes connectors to the view (example: View.Document.ActiveLayer.AddChild(connector)). On a dataset of 5600 1D connectors and 2000 2D nodes it takes more than 1,5 hour just to add all the elements!

2) when calling the Layout method on the NSymmetricalLayout (which is the best layout i have found for our purposes) it is also very slow and finally is unable to layout the graph.

Is there any hint to speedup the adding and layout phases? Should i use different methods or classes?

Thanks and greetings from Italy
By Nevron Support - Wednesday, November 10, 2010

Hi, Marco

Here are some advices on how you can speed up adding shapes to your diagram and layouting them:

 

1.       Disable the automatic generation of unique names for the active layer. It’s faster if you provide names to the shapes using their Name property.

 

document.ActiveLayer.AutoGenerateUniqueNames = false;

 

2.       Put the code that adds your shapes into a document BeginInit(), EndInit() block:

 

document.BeginInit();

 

   // Add your shapes here

 

document.EndInit();

 

3.       Regarding the layout – the symmetrical layout is a force directed layout, so you can use its MaxIterations and MaxTime (specified in milliseconds) properties to control how the amount of work and the time the layout is allowed to perform. Note that decreasing the maximum number of iterations (or time) will make the layout finish faster but the results may not be as good as if it was working longer.

 

By Marco Finizio - Wednesday, November 10, 2010

Thanks, i'll try the suggested points 1 and 3. The point 2 has been already used.

However, which is the fastest layout method for graphs? If the symmetricalLayout is slower than others, we could change it...
By Nevron Support - Friday, November 12, 2010

In general the deterministic graph layouts (such as the NLayeredGraphLayouts) are faster than force directed layouts. But at the end it all depends on the type of graph drawing that you want to generate and the nature of the graph...