separate Graph.hs out of BoxDiagram.hs