pydot-ng icon indicating copy to clipboard operation
pydot-ng copied to clipboard

[70] Nodes not identified in graph

Open prmtl opened this issue 9 years ago • 2 comments

Reported by [email protected], 2012-04-09T20:11:41Z

What steps will reproduce the problem?
  1. Create this dot file:
graph condiments {
    ketchup -- mayonnaise -- tartar -- lemon
    ketchup -- bbq
}
  1. Create and run this python script:
impot sys
import pydot

# first arg is the dot file
if len(sys.argv) < 2:
    exit()

g = pydot.graph_from_dot_file(sys.argv[1])

print g.get_node_list()
What is the expected output? What do you see instead?

The output is an empty list, I expected a list of nodes (ketchup, bbq, etc.)

What version of the product are you using? On what operating system?

pydot-1.0.28 with Python 2.7.1, OS X

Please provide any additional information below.

From: https://code.google.com/p/pydot/issues/detail?id=70

prmtl avatar Mar 08 '15 16:03 prmtl

Comment by [email protected], 2012-04-18T21:54:55Z

+1.

If you have nodes implicitly defined, like:

a; a -> b -> c -> d; c;

Only the "explicitly" defined nodes (the ones given their own lines) will be accessible. It really shouldn't work this way.

prmtl avatar Mar 08 '15 16:03 prmtl

Comment by [email protected], 2012-05-07T06:11:37Z

Graphviz uses implicitly defined nodes as well. It would be useful to have a lib acting the same way.

prmtl avatar Mar 08 '15 16:03 prmtl