Python tool to draw graphs in colors.
Start by saving this description file as as example.txt
black Robot
firebrick Battery
blue Actuator A
blue Actuator B
firebrick Power board
black Computer board
black Computer board
darkgreen Sensor A
darkgreen Sensor B
Then run
pip install .
cgraph example.txt --view
A new window should display the graph below
Explore the options using --help
cgraph --help
And learn more about the description file format below.
Parent/child dependency is encoded by indentation.
There are two kinds of entries in the graph description
- Comments are prefixed by one of the following symbol:
//
,#
, these lines are ignored - Nodes are prefixed by the color to display (e.g. red, blue, green, firebrick, darkgreen, etc), invalid colors will throw
You can use the first line to specify custom colors as follows
[power:firebrick, board:black, actuator:blue, sensor:darkgreen]
_ Robot
power Battery
actuator Actuator A
actuator Actuator B
power Power board
black Computer board
black Computer board
sensor Sensor A
sensor Sensor B
this will produce the same output as above, but you might find it easier to maintain.
Deploy by running
python setup.py sdist bdist_wheel
twine upload dist/*
graphviz
will always save a temporary file when asked to render the graph.