Page Index Toggle Pages: [1] 2 3 ... 5 Send TopicPrint
Very Hot Topic (More than 25 Replies) Link routing - supperposition + arrow orientation (Read 32463 times)
marie
Full Member
***
Offline



Posts: 147
Joined: Nov 11th, 2008
Link routing - supperposition + arrow orientation
Feb 4th, 2009 at 4:55pm
Print Post  
Hi Stoyan,

The links in my graphs are ugly. I was wondering if you could help me with that. If possible, I don't want the user to be able to manually change the links. I don't use automatic node layout.

I have the following routing options:
Code
Select All
this.diagram.RoutingOptions.Anchoring = MindFusion.Diagramming.Anchoring.Keep;
this.diagram.RoutingOptions.CrossingCost = ((byte)(15));
this.diagram.RoutingOptions.EndOrientation = MindFusion.Diagramming.Orientation.Horizontal;
this.diagram.RoutingOptions.GridSize = 16F;
this.diagram.RoutingOptions.NodeVicinitySize = 8F;
this.diagram.RoutingOptions.StartOrientation = MindFusion.Diagramming.Orientation.Horizontal; 



My two main problems are that sometimes my links are overlapping (making it unclear to know where the links are going) and that the arrow is placed vertically (it should always be horizontal to make sure that the origin/destination is visually clear).

I'll send by email two files (Saved with diagram.SaveToXml) that show those problems. I used the entity sample again (from a fresh start) to demonstrate/try/reproduce my problem.

Thanks!
Marie
« Last Edit: May 11th, 2009 at 12:26pm by marie »  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Link routing - supperposition + arrow orientat
Reply #1 - Feb 5th, 2009 at 6:22am
Print Post  
Hi Marie,

At this time the auto-routing algorithm does calculations for crossing / overlapping links only for LinkStyle = Cascading. Instead of using Bezier links, try Cascading links with rounded corners:

Code
Select All
diagram.LoadFromXml(@"C:\FlowChart.NET\Support\Marie\diagramSupperposedLines.xml");
foreach (DiagramLink link in diagram.Links)
	link.Style = LinkStyle.Cascading;

diagram.RoundedLinks = true;
diagram.RoundedLinksRadius = 10;

diagram.RouteAllLinks();
 



I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
marie
Full Member
***
Offline



Posts: 147
Joined: Nov 11th, 2008
Re: Link routing - supperposition + arrow orientat
Reply #2 - Feb 5th, 2009 at 1:30pm
Print Post  
Hi Stoyan,

Thanks for your proposition.

Do you know if I can do something about the arrows pointing vertically even if EndOrientation & StartOrientation are set to Horizontal?

Thanks,
Marie
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Link routing - supperposition + arrow orientat
Reply #3 - Feb 5th, 2009 at 2:05pm
Print Post  
Hi Marie,

With that code I couldn't see vertical links after loading both files from your email. Have you tried it?

Stoyan
  
Back to top
 
IP Logged
 
marie
Full Member
***
Offline



Posts: 147
Joined: Nov 11th, 2008
Re: Link routing - supperposition + arrow orientat
Reply #4 - Feb 5th, 2009 at 2:47pm
Print Post  
Yes, I tried it and it fails... It's annoying because in my real case I have many outputs and sometimes it looks like the link comes from 1 output below or above even if it doesn't...

I was using my old flowchart version. I could try it with the new beta 5.2
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Link routing - supperposition + arrow orientat
Reply #5 - Feb 5th, 2009 at 6:04pm
Print Post  
Ok, I didn't set any RoutingOptions and it worked fine with the defaults. Now I've copied your RoputingOptions settings and can see the problem. Since you are using pixels as unit, you might have to scale the other distance attributes from RoutingOptions too (such as NodeVicinitySize) by 4 or 5, and not just GridSize.

Stoyan
  
Back to top
 
IP Logged
 
marie
Full Member
***
Offline



Posts: 147
Joined: Nov 11th, 2008
Re: Link routing - supperposition + arrow orientat
Reply #6 - Feb 5th, 2009 at 6:48pm
Print Post  
Hi,

I tried that (also tried modifying RoutingOptions.GridSize), but now it's even worst...

Could it be caused by something else? Why does SmartPolylineEnds, StartOrientation & EndOrientation are not respected?

Thanks,
Marie
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Link routing - supperposition + arrow orientat
Reply #7 - Feb 6th, 2009 at 9:27am
Print Post  
Hi,

Have you tried it with the default settings, without changing anything in RoutingOptions? Routing worked fine in my test using the default values. The last screenshot you've emailed me shows that paths were not found at all, probably because of RoutingOptions.GridSize being too large. Not finding a path might lead to resetting the link to some default state with vertical segments, depending on the options of the connected nodes. If you need to change something in RoutingOptions, you could load the file into the Routing sample project, and there play with the settings to find ones that work for pixels.

Stoyan
  
Back to top
 
IP Logged
 
marie
Full Member
***
Offline



Posts: 147
Joined: Nov 11th, 2008
Re: Link routing - supperposition + arrow orientat
Reply #8 - Feb 6th, 2009 at 2:36pm
Print Post  
Hi Stoyan,

It works much better! I didn't change any length settings and it's fine now.

The problem seems to be with the Anchoring.Keep property that doesn't do as I expected. What does it do exactly? In the documentation, it says
Quote:
Anchoring: Gets or sets a value indicating whether to align link ends to the anchor points of nodes.
Keep:Links are aligned to their original anchor points.

Does it mean that if it is set to Ignore, some links could be away from my anchor points? Or that links could jump to another anchor point?

When I turn it on (with default properties except for End & Start Orientation set to Horizontal), it seems to try to remove overlapping of 2 links going to the same output. It then results in a vertical arrow. Why?

Thanks a lot!
Marie
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Link routing - supperposition + arrow orientat
Reply #9 - Feb 6th, 2009 at 6:11pm
Print Post  
Quote:
When I turn it on (with default properties except for End & Start Orientation set to Horizontal), it  seems to try to remove overlapping of 2 links going to the same output. It then results in a vertical arrow. Why?


Perhaps the CrossingCost from RoutingOptions takes precedence over the NodeVicinity cost. And it seems the problem is amplified with these tables since the link end points ar not on the table border but inside the cells. So, you could try that with higher NodeVicinityCost value, which would make the routing algorithms choose the links to overlap for a few millimeters near their ends instead of bending inside the tables. Or it could be easier to explicitly set the end pairs of points in ControlPoints after calling Route() for links that share an anchor point.

Stoyan
  
Back to top
 
IP Logged
 
marie
Full Member
***
Offline



Posts: 147
Joined: Nov 11th, 2008
Re: Link routing - supperposition + arrow orientat
Reply #10 - Feb 9th, 2009 at 2:40pm
Print Post  
Hi Stoyan,

I'm not using the same nodes that I sent you (they were just tableNodes) and in my case the links are on the table border. It should be easier.

I'll keep playing with the parameters as you suggested.

Thanks,
Marie
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Link routing - supperposition + arrow orientat
Reply #11 - Mar 18th, 2009 at 2:23pm
Print Post  
Hi Marie,

Check the version from the PM page. It adds RoutingOptions.EndPointsOffset property, specifying the number of routing grid pieces from the table border where the first bend would be allowed. This lets you avoid links going along the border when there's more than one link starting from the same point.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
marie
Full Member
***
Offline



Posts: 147
Joined: Nov 11th, 2008
Re: Link routing - supperposition + arrow orientat
Reply #12 - Mar 19th, 2009 at 3:23pm
Print Post  
Hi Stoyan,

This is really helping the speed (almost twice faster) Cheesy

I encountered a crash while routing nodes with a EndPointsOffset = 15 (doing tests to find the perfect value):
Code
Select All
'System.IndexOutOfRangeException': Index was outside the bounds of the array.
   at MindFusion.Layout.xf04e61527b110650.x39adfecc61da6fd2(Byte[,] x3040c866fac95193, Point& x10aaa7cdfa38f254, Int32 x9488dccada4a6aaf, Point& xca09b6c2b5b18485, Int32 x2894e30202ea4010, Int32 x8e9e10337ba63c4d, Int32 xaa1eb5e30dc50ab1, RoutingOptions xf880fd3cd1e615e7)
   at MindFusion.Layout.xf04e61527b110650.x316b6250e36bf536(x20f78b8226aded3c xbd2f940ea4f1d446)
   at MindFusion.Diagramming.DiagramLink.x7ad5b2ddb80d9c00(Boolean x5113d1e6ef8a0405, ConnectionPoint x97530273d342b6f8, ConnectionPoint xdc3523bf52410ca4, Boolean xd7e6563b6d99ef1f, DiagramItemCollection xe4c3200aa4f42cb0)
   at MindFusion.Diagramming.DiagramLink.x7ad5b2ddb80d9c00(Boolean x5113d1e6ef8a0405, Boolean x9ae6a5d81c16a985, DiagramItemCollection xe4c3200aa4f42cb0)
   at MindFusion.Diagramming.DiagramLink.Route() 



Thanks a lot to you and your team!
Marie
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Link routing - supperposition + arrow orientat
Reply #13 - Mar 20th, 2009 at 9:13am
Print Post  
Hi Marie,

Please check the new build from the PM page, it should work fine with large EndPointsOffset.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
marie
Full Member
***
Offline



Posts: 147
Joined: Nov 11th, 2008
Re: Link routing - supperposition + arrow orientat
Reply #14 - Mar 31st, 2009 at 2:13pm
Print Post  
Hi Stoyan,

I don't have the crash anymore, thanks a lot for the quick update (sorry it took time to answer, I refactored my code therefore I wasn't able to run nor test the build).

To route my links, I start with a gridsize=40. Then, I route links that start vertically with a gridsize=20. Thirdly, I route links that are still vertical with a gridsize=7. I finish by forcing the beginning points of the remaining vertical links.

Using EndPointsOffset = 0, I have less outgoing vertical links (49/5/0 instead of 74/36/4) and it's faster (about twice as fast as I mentionned before).

If I use a different EndPointsOffset, it's still fast, but I have the same amount of vertical links (or more) and the links are even uglier.

In both cases (with EndPointsOffset=0 or bigger by example 1, 5 or 7), my links are uglier than they used do, meaning that they do unecessary turns, overlap each other more & sometimes even cross nodes.

I also have a strange behavior. I have two nodes linked with each other. They are both contained within a container node. When I click and hold the left-button of the mouse on the container, the link is not drawn the same way that it used to. When I release the button, the link is back where it used to be.

I'll send you pictures of all those problems by email.

Many thanks!
Marie
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: [1] 2 3 ... 5
Send TopicPrint