Routing links

I have following problem:

  • Node1: A node with three ports on top of each other on the right side
    - Node2: A node with three ports on top of each other on the left side
    - Node1 is on the left side of Node2
    - The three ports are linked orthogonal
    => GoDiagram standard: The links are placed on each other (at the middle between the nodes)

    => But I like to get them automatically parallel to each other, like this:

    Links should not be placed above each other.
    Is this possible?
    Thanks for your help.

I’m sorry, but I don’t think anyone can see the images that are on your personal machine. You need to put them on a web server, or send them to me by e-mail.

Hello Walter,
can you give me your e-mail address please?


The simple answer is no, not at this time. We’re working on this feature for a future release (after 2.5). We actually tried for 2.5, but I wasn’t happy with the results, so we need to try again.
I assume you realize that users are able to manually adjust the paths of the links.
Furthermore you can override GoLink.GetMidOrthoPosition and return different values for different links, instead of the default middle. The Links in OrgCharter do that, to specify a constant distance from the “manager” node.

If you set different EndSegmentLength value for the aligned ports, you may separate the overlapped segments. This may be a workaround. I am waiting for a better solution, because this workaround causes other problems in my development.

I have uploaded a new beta 2.5 kit that does what you are looking for, as long as you are connecting either GoGeneralNodes or GoBoxNodes with GoBoxNode.LinkPointsSpread. 1
It does NOT address the more general issue of trying to avoid link overlaps, so more complicated routings can still have overlapping segments. It just handles the simple cases locally at a GoGeneralNode or GoBoxNode.

walter, I found that in the new beta 2.5 GoDiagram EndSegmentLength is actually used to seperate overlapped links (the same idea on my previous post ). But I don’t know why there are some limitations for this to work, which is written in the document.

By the way, by increasing/decreasing EndSegmentLength along one side of a node, a new problem will come out, which is how to minimize the number of crosses between links.

For example, if EndSegmentLength increasing along one side of a node and all the links (Orthogonal) from/to these ports go down, there will be a lot of crosses. In this situation, EndSegmentLength should be set in reverse order.

I come up with a solution(not very efficient) for both of these problems.

Basically, whenever the number of ports changes or the node position changes, I recalculate the ports’ EngSegmentLength based on:

  1. Their position
  2. The first turn direction of the links (I’m using Orthogonal links only)

I defined two arrays, one for ports with going down link(array one), another one for ports with going up link (array two).

And then I set EndSegmentLength of ports in array one decreasingly (or increasingly in reverse order) and I set those in array two increasingly. Every port has different EndSegmentLength.

This solution works great for my development except an amount of penalty of speed loss. It’s obvious in my work because in some nodes, there are about 20 links, and when node is moved, I need to recalculate the paths of the links.

The next baselevel, which might be a release candidate, has this functionality also working for GoMultiTextNodes.