def dag(self, file_name='dag', file_format='svg'):
'''Create a dag of this node and its children'''
try:
import graphviz as gv
except ImportError:
# todo: add a warning to a log file here
# silently return if graphviz bindings are not installed
return
try:
graph = gv.Digraph(format=file_format)
except ValueError:
raise GenerationError(
"unsupported graphviz file format '{0}' provided".
format(file_format))
self.dag_gen(graph)
graph.render(filename=file_name)
评论列表
文章目录