Closed hyanwong closed 1 year ago
The positioning rules would probably be hard to generalize across many ARGs as the force layout isn't recognizing the presence of edge crossovers so doesn't know how to avoid them. If you were to play with the repelling and attracting forces, you could probably find a balance for this specific ARG, but I think that would be a pretty unique combination of forces.
Also for reference, here are the starting and ending positions if you use graphviz to set initial node positions:
Not fully equivalent, but a more approachable solution could be stylizing edge overlaps in a way that makes them more clear to users. With edge_type="ortho"
, edges have a thicker white line beneath them to give the appearance that they are crossing overtop one another but not connected (see connection from Node 26 to Node 22 or Node 18/19 from this other tree sequence).
This is not implemented in edge_type="line"
because of some ugliness near node connections, but something similar might help with your tree sequence... thoughts?
Closing this for now and will open different issue specifically about stylizing edge crosses.
This might be too tricky, but for the following tree sequence:
The default layout means the nodes on the far left have overlapping edges (which is a bit misleading in the case of 14->6, I think):
If node 14 is dragged to the right, a more sensible edge arrangement is displayed:
It may be that this doesn't generalise easily, though, and an algorithm to get it to work in the general case is tricky or impossible. If so, just close this issue, I reckon.