anytree.gv 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. /* generated by anytree Python tree data library
  2. https://github.com/c0fec0de/anytree
  3. >>> def nodenamefunc(node):
  4. ... return '%s:%s' % (node.name, node.depth)
  5. >>> def edgeattrfunc(node, child):
  6. ... return 'label="%s:%s"' % (node.name, child.name)
  7. >>> def edgetypefunc(node, child):
  8. ... return '--'
  9. >>> from anytree.exporter import DotExporter
  10. >>> for line in DotExporter(root, graph="graph",
  11. ... nodenamefunc=nodenamefunc,
  12. ... nodeattrfunc=lambda node: "shape=box",
  13. ... edgeattrfunc=edgeattrfunc,
  14. ... edgetypefunc=edgetypefunc):
  15. ... print(line)
  16. */
  17. graph tree {
  18. "root:0" [shape=box];
  19. "sub0:1" [shape=box];
  20. "sub0B:2" [shape=box];
  21. "sub0A:2" [shape=box];
  22. "sub1:1" [shape=box];
  23. "sub1A:2" [shape=box];
  24. "sub1B:2" [shape=box];
  25. "sub1C:2" [shape=box];
  26. "sub1Ca:3" [shape=box];
  27. "root:0" -- "sub0:1" [label="root:sub0"];
  28. "root:0" -- "sub1:1" [label="root:sub1"];
  29. "sub0:1" -- "sub0B:2" [label="sub0:sub0B"];
  30. "sub0:1" -- "sub0A:2" [label="sub0:sub0A"];
  31. "sub1:1" -- "sub1A:2" [label="sub1:sub1A"];
  32. "sub1:1" -- "sub1B:2" [label="sub1:sub1B"];
  33. "sub1:1" -- "sub1C:2" [label="sub1:sub1C"];
  34. "sub1C:2" -- "sub1Ca:3" [label="sub1C:sub1Ca"];
  35. }