Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Link padding with no auto layout? (Read 127 times)
Joel D.
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 43
Location: Vancouver, Canada
Joined: Feb 6th, 2017
Link padding with no auto layout?
Jul 13th, 2026 at 8:38pm
Print Post  
I'm laying out the DiagramNodes on my Diagram myself by using my own logic and setting the node positions using the .Move() function.  Then I use diagram.RouteAllLinks() to let the links get placed automatically. There aren't really any obstacles for the links to route around, so they end up bunching more or less altogether (see attachment). Presumably this is because of the default pattern router's "ADR0.5 TRR ADR1 TRL ADR0.5" pattern.

Is there a way maybe to get the links to turn corners at different times so that they're spread out a little more? Or is there some kind of padding or spacing that can be added to the link routing mechanism?  Most of the settings I've found to play around with seem to be related to routing around nodes/obstacles, not keeping away from other links.

Thanks!
  

Screenshot_2026-07-13_133449.png ( 29 KB | 12 Downloads )
Screenshot_2026-07-13_133449.png
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3502
Joined: Oct 19th, 2005
Re: Link padding with no auto layout?
Reply #1 - Jul 14th, 2026 at 9:30am
Print Post  
Assuming you are using default CompositeRouter (which routes using PatternRouter -> GridRouter sequence), overlapping links would get pulled apart within a hard-coded 1cm range. We'll have in mind exposing that as a property for next release. If you are building the library from code, you could try passing larger range from these lines in CompositeRouter.cs (same code is called from two methods):

Code
Select All
var unit = diagram.MeasureUnit;
float range = (float)MeasureUnit.
    Millimeter.Convert(10, unit, null);

var distributor = new LinkDistributor(diagram, range); 



You could also try calling diagram.Arrange(new OrthogonalRouter()); That's actually a layout class (like TreeLayout, LayeredLayout, etc) but only for links. It's from before we implemented current link auto-routing system / RouteAllLinks method, and we never had the time to migrate OrthogonalRouter to it.

Regards,
Slavcho
Mindfusion
  
Back to top
 
IP Logged
 
Joel D.
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 43
Location: Vancouver, Canada
Joined: Feb 6th, 2017
Re: Link padding with no auto layout?
Reply #2 - Jul 14th, 2026 at 9:29pm
Print Post  
The OrthogonalRouter does a pretty good job so I'll go with that for now. And later on when I have some more time, I'll compile the source code with your suggestion to see how that looks, too.

Thanks so much for the help!
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint