Generate GraphViz from CBD Models¶
Useful drawing function to easily draw a CBD model in Graphviz.
- pyCBD.converters.CBDDraw.gvDraw(cbd, filename, rankdir='LR', colors=None)[source]¶
Outputs a
CBDas a GraphViz script to filename.For instance, drawing the CBD given in the Hierarchical Even Number Generator example, the following figure can be obtained:
Note
The resulting Graphviz file might look “clunky” and messy when rendering with the standard
dotengine. Theneato,twopiandcircoengines might provide a cleaner and more readable result.- Parameters
cbd (CBD) – The
CBDto draw.filename (str) – The name of the dot-file.
rankdir (str) – The GraphViz rankdir of the plot. Must be either
TBorLR.colors (dict) – An optional dictionary of
blockname -> color.