Nudge edge ports to avoid overlapping vertical edge segments.
If an edge starts at the same column as another edge finishes, there is a risk they could be drawn overlapping.
This avoids the issue by moving the in port one column away (and we make the assumption that there is space
for that).
╭─────╮ ╭─────╮ ╭─────╮ ╭─────╮
│ A │ │ B │ │ A │ │ B │
╰─┬─┬─╯ ╰─┬─┬─╯ ╰─┬─┬─╯ ╰─┬─┬─╯
│ │ │ │ │ │ │ │
│ ╰─────┼ │ vs │ ╰─────┼╮│
│ ╭─────╯ │ │ ╭────╯││
│ │ │ │ │ │ ││
v v v v v v vv
╭─────╮ ╭─────╮ ╭─────╮ ╭─────╮
│ X │ │ Y │ │ X │ │ Y │
╰─────╯ ╰─────╯ ╰─────╯ ╰─────╯
Some of the overlaps can be avoided by ordering the edge rows, but not if the overlaps cause a cycle,
as in the case above. Ideally, we would just nudge just enough vertices to break the cycle, and
let edge ordering handle the rest, but at the moment we nudge everything.
Nudge edge ports to avoid overlapping vertical edge segments.
If an edge starts at the same column as another edge finishes, there is a risk they could be drawn overlapping. This avoids the issue by moving the in port one column away (and we make the assumption that there is space for that).
╭─────╮ ╭─────╮ ╭─────╮ ╭─────╮ │ A │ │ B │ │ A │ │ B │ ╰─┬─┬─╯ ╰─┬─┬─╯ ╰─┬─┬─╯ ╰─┬─┬─╯ │ │ │ │ │ │ │ │ │ ╰─────┼ │ vs │ ╰─────┼╮│ │ ╭─────╯ │ │ ╭────╯││ │ │ │ │ │ │ ││ v v v v v v vv ╭─────╮ ╭─────╮ ╭─────╮ ╭─────╮ │ X │ │ Y │ │ X │ │ Y │ ╰─────╯ ╰─────╯ ╰─────╯ ╰─────╯
Some of the overlaps can be avoided by ordering the edge rows, but not if the overlaps cause a cycle, as in the case above. Ideally, we would just nudge just enough vertices to break the cycle, and let edge ordering handle the rest, but at the moment we nudge everything.