cudadog / pydot

Automatically exported from code.google.com/p/pydot
MIT License
0 stars 0 forks source link

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

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
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.

Original issue reported on code.google.com by zvi.ta...@gmail.com on 1 Mar 2013 at 9:46

Attachments: