diagrams / diagrams-graphviz

Graph layout and drawing with GraphViz and diagrams
BSD 3-Clause "New" or "Revised" License
9 stars 4 forks source link

Support self-loops #8

Open santolucito opened 5 years ago

santolucito commented 5 years ago

This graph will render correctly: let g = mkGraph [0,1] [(0,1,())] but let g = mkGraph [0,1] [(0,0,())] wil fail with the scale by zero! Halp! error message.

The right thing is to do is probably add support for self-loops, but a quick fix would be to add a check to mkGraph and throw and runtime error on self loops, or filter them out.