I would like the xlabel="4" label to be displayed to the top right of node C instead of top left.
Is there a way to accomplish this? Please note that the position of nodes is important for my application and as I understand, position will be respected only under fdp, neato and nop engines.
Added explicit xlp values (xlp | Graphviz)
I guessed at the correct values, but they could be calculated, based on the node pos, height, and width.
digraph D {
scale = 1.000000;
A[pos="250.00,60.00!"]
B[pos="0.00,0.00!" xlabel="4" xlp="25,16"]
C[pos="500.00,0.00!" xlabel="4" xlp="530,12"]
B -> A
A -> C
}
There’s no code to do that, but according to the comments, the sweet spot seems to be xladjust. One could introduce an attribute to control the order of the search, instead of hardwiring it.
Wonder how this would work. Make a colon-separated list, similar to colorList but with compass points? N:NE:E:SE:S:SW:W:NW? (To be forgiving in the spirit of Postel’s law, allow any punctuation.)
What if the client doesn’t specify all 8 compass points - should they all be tried before failure? Or, not, just keep searching in the specified direction? Here’s where I have to admit I don’t really understand the xlabel algorithm in detail.