Closed Leepay closed 1 year ago
But the expected output should be a digraph with only one node, which is 'A', isn't it?
No. DOT-building methods such as .node()
and .edge()
precisely add node-statements and edge-statements to the DOT instance (not sure if this should be more explicit in the documentation).
graphviz.Graph
and graphviz.Digraph
do not track the semantics of the statements added (e.g. which nodes have been added): Their sole purpose is to simply to generate DOT source line by line.
P.S.: If you are looking for a more complete OoO interface to all of Graphviz' semantics, maybe check out some of the alternatives: https://github.com/xflr6/graphviz#see-also
my code are:
Output is:
But the expected output should be a digraph with only one node, which is 'A', isn't it?
My environment: