Skip to content
This repository has been archived by the owner on Nov 19, 2018. It is now read-only.

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

Open
prmtl opened this issue Mar 8, 2015 · 0 comments

Comments

@prmtl
Copy link
Contributor

prmtl commented Mar 8, 2015

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant