Pokus o vytvoření giga kurzu propojeného grafem https://ksp.vsq.cz/grafik
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

30 lines
593 B

  1. import sys
  2. import json
  3. # pokus se naimportovat graphviz
  4. try:
  5. from graphviz import Digraph
  6. except ModuleNotFoundError as e:
  7. print("ERROR: Nainstaluj si graphviz - `pip install graphviz`", file=sys.stderr)
  8. exit(1)
  9. # nacist definici grafu
  10. with open("tasks.json", "r") as f:
  11. definition = json.load(f)
  12. dot = Digraph(comment='The Round Table')
  13. # nodes
  14. for task in definition["tasks"]:
  15. dot.node(task["id"], task["id"])
  16. # edges
  17. for task in definition["tasks"]:
  18. for req in task["requires"]:
  19. dot.edge(req, task['id'])
  20. dot.render('out/round-table.gv', view=True)