Page Index Toggle Pages: [1] 2  Send TopicPrint
Hot Topic (More than 10 Replies) Diagram arranging (Read 6594 times)
monkeydll
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 41
Joined: Jun 27th, 2016
Diagram arranging
Aug 9th, 2016 at 2:15pm
Print Post  
I am currently using OrthogonalRouter to route my links.
When I have around 20 nodes and about 40 links in the diagram it gets confusing.
My question:
Is there any other way to auto arrange my links besides the functions that i found here on the forum.
The main problem is when I have a node with links that go from and to that same node, some links are right from that node and it looks like the link is not connected to the node.
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3152
Joined: Oct 19th, 2005
Re: Diagram arranging
Reply #1 - Aug 9th, 2016 at 4:20pm
Print Post  
Could you attach a saved diagram file showing the problem?
  
Back to top
 
IP Logged
 
monkeydll
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 41
Joined: Jun 27th, 2016
Re: Diagram arranging
Reply #2 - Aug 10th, 2016 at 6:35am
Print Post  
In the attachment is a picture of my diagram. The problem is in the node where the text is Start state, as you will see.
This is just a small example. It gets worse when I have more nodes and links.
  

Example.png ( 20 KB | 82 Downloads )
Example.png
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3152
Joined: Oct 19th, 2005
Re: Diagram arranging
Reply #3 - Aug 10th, 2016 at 8:41am
Print Post  
Are there several self-loop links connected to the start-state node? The additional links should be drawn as larger concentric rectangles around the innermost self-loop, so I guess that's a bug.
  
Back to top
 
IP Logged
 
monkeydll
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 41
Joined: Jun 27th, 2016
Re: Diagram arranging
Reply #4 - Aug 10th, 2016 at 8:48am
Print Post  
Yes they are connected to the start node.
When I draw them in the editor it is like rectangles one around another, but if I save the diagram and open the form again this happens.
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3152
Joined: Oct 19th, 2005
Re: Diagram arranging
Reply #5 - Aug 10th, 2016 at 9:30am
Print Post  
Quote:
but if I save the diagram and open the form again this happens


Are you using any of the built-in SaveTo* methods to save the diagram, and reloading it when the form opens again?
  
Back to top
 
IP Logged
 
monkeydll
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 41
Joined: Jun 27th, 2016
Re: Diagram arranging
Reply #6 - Aug 10th, 2016 at 11:41am
Print Post  
No, I just copy the contents from the copy (that i modify when the editor is open) to my original (including the diagram) through my viewModel.
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3152
Joined: Oct 19th, 2005
Re: Diagram arranging
Reply #7 - Aug 10th, 2016 at 12:44pm
Print Post  
Are you applying OrthogonalRouter again after rebuilding the diagram from view-model, or saving and reloading control-point coordinates of links?
  
Back to top
 
IP Logged
 
monkeydll
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 41
Joined: Jun 27th, 2016
Re: Diagram arranging
Reply #8 - Aug 10th, 2016 at 2:20pm
Print Post  
Yes I am applying new OrthogonalRouter().Arrange(Diagram) after I have all my nodes and links in the diagram.
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3152
Joined: Oct 19th, 2005
Re: Diagram arranging
Reply #9 - Aug 10th, 2016 at 6:19pm
Print Post  
Could you call SaveToXml right after rebuilding the diagram from view-model but before calling OrthogonalRouter, and attach the file here?
  
Back to top
 
IP Logged
 
monkeydll
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 41
Joined: Jun 27th, 2016
Re: Diagram arranging
Reply #10 - Aug 11th, 2016 at 7:36am
Print Post  
Check the attachment
  

diagramProbe.txt ( 16 KB | 90 Downloads )
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3152
Joined: Oct 19th, 2005
Re: Diagram arranging
Reply #11 - Aug 11th, 2016 at 10:27am
Print Post  
This file contains only two links and they aren't self-loops. If you are creating self-loops at a later point, please attach save-file created after it.

Maybe also verify that when rebuilding from the model you are actually connecting both ends of all links to a node. E.g. you might have some validation code that checks if nodes are already connected and prevents new connections, leaving newly created links unconnected? OrtogonalRouter ignores unconnected links in my test.
  
Back to top
 
IP Logged
 
monkeydll
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 41
Joined: Jun 27th, 2016
Re: Diagram arranging
Reply #12 - Aug 11th, 2016 at 11:00am
Print Post  
Sorry my bad. I attached the wrong file.
In the attachment is now a screenshot of the diagram and the saved xml as txt file.
When I delete the node that is not connected to anything and then do save, then again open the form, everything is arranged nicely.
With the extra node something goes wrong.
  

diagramProbe_001.txt ( 16 KB | 79 Downloads )
secondProbe.png ( 12 KB | 84 Downloads )
secondProbe.png
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3152
Joined: Oct 19th, 2005
Re: Diagram arranging
Reply #13 - Aug 11th, 2016 at 12:12pm
Print Post  
diagramProbe_001.txt is still the same file as diagramProbe.txt Undecided I've tried to reproduce that by drawing the same diagram from picture, but it still seems to work correctly. I'm only calling the Arrange method as below, are you setting any properties of the router class?

new OrthogonalRouter().Arrange(diagram);
  
Back to top
 
IP Logged
 
monkeydll
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 41
Joined: Jun 27th, 2016
Re: Diagram arranging
Reply #14 - Aug 11th, 2016 at 1:04pm
Print Post  
Excuse me for being a klutz. Now There is a corresponding file(I hope so) Smiley
  

SecondProbe.txt ( 26 KB | 82 Downloads )
Back to top
 
IP Logged
 
Page Index Toggle Pages: [1] 2 
Send TopicPrint