microsoft / microsoft/automatic-graph-layout
Control port entry/exit direction in RectilinearEdgeRouter?
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 1.5k
- Forks
- 319
- Avg merge
- 38m
- Merged PRs (30d)
- 1
Description
Hello,
I have a graph of nodes containing 'input' and 'output' ports, and I'd like to use the RectilinearEdgeRouter to route the edges. I have a basic version of this working
var rectRouter = new RectilinearEdgeRouter(this, 10, 3, true, true);
rectRouter.RouteToCenterOfObstacles = false;
rectRouter.Run();
However, I would like to ensure that edges always connect to inputs/top-ports by going 'up' and to outputs/bottom-ports by going 'down'. Or perhaps in other words, I would like to minimize, or ideally completely prevent edges overlapping with nodes...
You can see an example of how it looks like without this constraint below. I browsed through the code and directions seem to be handled explicitly, so I believe this should be tweakable, I just don't know how to do it...

Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the RectilinearEdgeRouter entry point and the direction-handling code mentioned in the issue, then reproduce the provided routing setup. Trace how port sides and obstacle avoidance are selected; done means input/top ports route upward and output/bottom ports route downward without edges overlapping nodes, with coverage for the behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- computer-graphics
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100