Nevron Forum

Prevent edge/line corners from touching

https://www.nevron.com/Forum/Topic5653.aspx

By Nick Walker - Tuesday, October 4, 2011

In the attached image, the automatic layout engine is creating two edges that both have a 90 degree bend in them where the corners appear to touch (circled in red).  From the rendering, it is not obvious whether the lines cross or if there are two 90 degree corners.  I would like to create a small gap between these corners so it is apparent to the end user which line goes where.  Here is the code for the layout engine:

Dim layout As NLayeredTreeLayout = New NLayeredTreeLayout()
layout.Direction = LayoutDirection.TopToBottom
layout.OrthogonalEdgeRouting = True
layout.UseSingleBus = True
layout.VertexSpacing = 75
layout.LayerSpacing = 60
layout.BusBetweenLayers = True
layout.CompactBreadth = True
layout.ParentPlacement.Anchor = ParentAnchor.FirstChildCenter

 

I tried changing the padding on the shape when the edge is created, but that didn't have any affect.  How can I accomplish this?

Thanks,

--nick

By Nevron Support - Friday, October 7, 2011

Hi Nick,

We recommend that you set the LayoutAlignment of the layout to Near. This will move the nodes up in your case and resolve the edge overlapping issue. Here’s the code you use to initialize the layout, just add the line in bold:

'Set up our layout engine
Dim layout As NLayeredTreeLayout = New NLayeredTreeLayout()
layout.Direction = LayoutDirection.TopToBottom
layout.OrthogonalEdgeRouting = True
layout.LayerAlignment = RelativeAlignment.Near
layout.UseSingleBus = True
layout.VertexSpacing = 75
layout.LayerSpacing = 60
layout.BusBetweenLayers = True