Most graph layouts supported by Mathematica use straight lines for edges; or at least something that only depends on the coordinates of the two adjacent vertices of the edge and nothing else.
A special exception is the layered embedding for directed acyclic graphs:
Graph@{1 -> 11, 2 -> 7, 3 -> 19, 4 -> 10, 4 -> 11, 4 -> 14, 4 -> 19,
5 -> 10, 5 -> 18, 6 -> 1, 6 -> 12, 6 -> 16, 6 -> 19, 8 -> 10,
9 -> 2, 9 -> 7, 9 -> 12, 9 -> 18, 10 -> 11, 10 -> 15, 11 -> 2,
11 -> 7, 13 -> 19, 13 -> 20, 14 -> 15, 15 -> 3, 15 -> 9, 16 -> 14,
17 -> 3, 17 -> 4, 18 -> 12, 19 -> 9, 19 -> 11, 20 -> 6}
This layout generator can do advanced edge routing.
Now suppose I have my own layout generator and I want to apply it to a Mathematica Graph
. In most cases all I need to do is to set the VertexCoordinates
property. But what can I do if I also have edge routing information? How can I store this information in the graph object? When using the "LayeredEmbedding", such information does seem to be present because the EdgeShapeFunction
receives not only the endpoints for drawing the lines, but also intermediate ones. So note that the routing is not done by the EdgeShapeFunction
; it is instead precomputed and stored as a set of points which are then converted to graphics objects by this function.
Can I manually specify the points along which the edges will run?
GraphComputation
context? Perhaps there is something useful in there. No time to spelunk right now $\endgroup$