I want to create a simple graph using graphviz which has
- two nodes (b, c) in the same rank and another single node (a)
- node b and c each has an unidirectional edge to node a
- node b and c have an bidirectional edge to each other of which ports are both on the left side ("w")
digraph {
graph [
charset = "UTF-8";
rankdir = LR,
];
b -> a;
c -> a;
b:w -> c:w;
{rank = same; b; c}
}
But I got this graph which the bidirectional edge became unidirectional.
I am new to dot language and I don't know why this happened. Can anyone help me? Thanks!
Update
I'm very sorry my first question was so stupid I forgot to include [dir = both]
... But actually it was not the real problem.
Actually there were labels with all edges. So the code was
digraph {
graph [
charset = "UTF-8";
rankdir = LR
];
b -> a [label = 1];
c -> a [label = 2];
b:w -> c:w [dir = both, label = 3];
{rank = same; b; c}
}
And this code produces the following graph which the bidirectional edge is changed to unidirectional.
But if I remove all labels from edges ([label = ...]
), the edge becomes bidirectional. The edge also becomes bidirectional if I remove both port arguments (:w
).
I appreciate if anyone could figure out what is going on here. Thank you again in advance.