Producing graphs with graphviz.
For examples see here
In [13]:
from simpleRM.core import DataProvider
from pprint import pprint
ROOT = '../requirements/simpleSE.yml'
dp = DataProvider(ROOT)
pprint(dp.requirements)
In [24]:
from graphviz import Digraph
dot = Digraph(comment='dependencies', format='svg')
dot.node('ROOT','root',color='red',style='filled')
# requirements
for req in dp.requirements.values():
dot.node(req.tag,req.tag,URL='foo')
if req.parent =='ROOT':
dot.edge('ROOT',req.tag)
# dependencies
for req in dp.requirements.values():
if req.children is not None:
for child in req.children:
dot.edge(req.tag, child)
dot.render('test')
#print(dot.source)
dot
Out[24]: