In the case that some nodes flow top-down, and some nodes flow left-to-right, the existing layout approach will give undesirable results as it assumes the whole graph is laid out in a particular direction.
We should probably do something like the following:
- Remove edges that connect nodes with different flow directions.
- Collect the SCCs on the remaining graph.
- Layout each SCC independently.
- Determine the bounding boxes for the resulting SCC layouts.
- Connect the SCCs that were previously connected before edge removal.
- Layout the outer graph of SCCs using their bounding boxes.
- Not sure how to pick a direction preference here? Make it optional I guess?