pombreda / pydot

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

set default attributes so following nodes can use this as default #7

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Sorry I did not find a forum or group can send my question so I paste it
here. If not approperiate, please just remove it.

I want to figure out a way to set  default attributes for all fllowing
nodes' shape, but I could not find a method that can generate 'node
[shape='box']' sentense as ususaly seen in Dot file. 

Any tips? 

Original issue reported on code.google.com by bird9...@gmail.com on 5 Feb 2008 at 11:03

GoogleCodeExporter commented 9 years ago
You should be able to obtain that result by adding a node named "node" with the 
desired attributes.

graph.add_node( pydot.Node('node', shape='box') )

The upcoming pydot will have new methods specifically for setting defaults 
(which basically wrap around the 
example I just gave)

Original comment by ero.carr...@gmail.com on 11 Feb 2008 at 5:56