Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic about SpringLayout (Read 1426 times)
silencezry
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 1
Joined: Apr 21st, 2011
about SpringLayout
Apr 21st, 2011 at 8:23am
Print Post  
    In my project, there could be thousands of DiagramNodes or DiagramLinks in a diagram. Arranging diagrams like this by invoking SpringLayout.Arrange() seems time-cosuming and may block UI from responding.
    I tried to set SpringLayout.IterationCount to 1, but it didn't help. Any ideas?
    Thanks.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: about SpringLayout
Reply #1 - Apr 21st, 2011 at 9:40am
Print Post  
To show the user something, you could use the SpringLayout's Progress delegate to update a progressbar, or run iterations from a timer as shown in the SpringLayout sample project.

Since it is of polynomial complexity, SpringLayout will work very slow if you have more than a few hundred nodes. For the next release we are preparing a partitioning algorithm that applies layouts on smaller parts of the diagram and then treats each part as a separate node to arrange the full diagram.

For example, that arranges a graphs of 900 nodes by applying a layout on each 30-nodes subgraph and then arranges the whole diagram as each of the subgraphs was a node (so again 30 nodes). This arranges everything in 6-7 seconds. If you are interested in this, I can send you our work in progress to play with.

Stoyan
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint