diagrams / diagrams-graphviz

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

Scale by zero for random graph #7

Open GregorySchwartz opened 5 years ago

GregorySchwartz commented 5 years ago

Running this code through diagram-builder gives

diagrams-builder-cairo: scale by zero!  Halp!
CallStack (from HasCallStack):
  error, called at src/Diagrams/Core/Transform.hs:425:11 in diagrams-core-1.4.1.1-K28WMLqu11XFyUMvGB0HVd:Diagrams.Core.Transform

Random graph from graph-generators.

import Diagrams.TwoD.GraphViz
import Data.Graph.Generators.Random.BarabasiAlbert
import Data.Graph.Generators.FGL
import Data.GraphViz
import Data.GraphViz.Commands

g = barabasiAlbertGraph' 10 2

dia = g >>= (simpleGraphDiagram Neato . graphInfoToUGr)
santolucito commented 5 years ago

I ran into a similar error. This might be due to a lack of support for self-loops, as mentioned in issue #8

L0neGamer commented 2 years ago

I ran into this issue earlier with graphs that have self loops.