Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Cancel during layout.arrange() method (Read 934 times)
Mindfusion User
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 11
Joined: Apr 26th, 2022
Cancel during layout.arrange() method
Aug 23rd, 2022 at 6:58am
Print Post  
Hi,

We are using the LayeredLayout.arrange() method to arrange our graphs.
Our graphs are made through a back-end program, and thus it is possible that the graph can be very large.
In that case, calling the LayeredLayout.arrange() method takes more than 3 minutes.
We use the arrange() method in this way:
        var layout = new LayeredLayout();
        layout.nodeDistance = 10;
        layout.layerDistance = 30;
        layout.direction = MindFusion.Graphs.LayoutDirection.LeftToRight;
        layout.multipleGraphsPlacement = MindFusion.Graphs.MultipleGraphsPlacement.Vertical;
        layout.siftingRounds = 4;
        diagram.arrange(layout);

In the case that the diagram.arrange() method takes too long, is there a way to fasten the arrange method?
Or can we cancel the arrange() method while executing?

Kind regards,
M.U.


  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3153
Joined: Oct 19th, 2005
Re: Cancel during layout.arrange() method
Reply #1 - Aug 23rd, 2022 at 10:23am
Print Post  
Hi,

You can make it faster by setting smaller siftingRounds value. Cancelling layouts is not supported at this time. If your diagram contains multiple subgraphs not connected to each other, you could try adding them to temporary ContainerNodes, calling container.arrange(layout) and letting users cancel after each container.

Kind regards,
Slavcho
Mindfusion
  
Back to top
 
IP Logged
 
Mindfusion User
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 11
Joined: Apr 26th, 2022
Re: Cancel during layout.arrange() method
Reply #2 - Aug 24th, 2022 at 11:40am
Print Post  
Hi Slavcho,

Good. Thanks for the information!

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