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

[80] Setting default graph/node/edge attrs in an existing graph has no effect

Open prmtl opened this issue 9 years ago • 0 comments

Reported by [email protected], 2013-03-01T10:46:07Z

What steps will reproduce the problem?
  1. g = pydot.graph_from_dot_data(""" digraph G { 1 -> 2; } """)
  2. g.set_node_defaults(style="filled", fillcolor="yellow")
  3. g.write_png("simple.yellow.png")
What is the expected output? What do you see instead?

Should see yellow nodes, but nodes are still white.

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

Pydot 1.0.28, Python 2.7.3

Please provide any additional information below.

Default attributes are added to the BOTTOM of the DOT spec, after existing nodes and edges, so they don't take effect. They should be inserted at the TOP of the spec to take effect everywhere.

The attached file demonstrates the problem and the solution. Attached pydot_bug.py (view on Gist) From: https://code.google.com/p/pydot/issues/detail?id=80

prmtl avatar Mar 08 '15 16:03 prmtl