1 import "Visualization/Graphviz"
3 include "Visualization/Graphviz/Property"
5 data GGraph a e = GGraph Graph (MMap.T a Node) (a -> <e> [Property])
7 newGGraph :: [Property] -> (a -> <e> [Property]) -> <Proc> GGraph a e
8 newGGraph properties f = GGraph (newGraph properties) (MMap.create ()) f
11 toNode :: GGraph a e -> a -> <e,Proc> Node
12 toNode (GGraph graph nodeMap f) r =
13 match MMap.get nodeMap r with
16 n = newNode graph (f r)
20 newGEdge :: GGraph a e -> a -> a -> [Property] -> <e,Proc> Edge
21 newGEdge graph r1 r2 properties = edge
23 edge = newEdge (toNode graph r1) (toNode graph r2) properties
25 newGNode :: GGraph a e -> a -> <e,Proc> Node
28 showGGraph :: GGraph a e -> <Proc> ()
29 showGGraph (GGraph graph _ _) = showGraph graph
31 showGGraphWithAlgorithm :: String -> GGraph a e -> <Proc> ()
32 showGGraphWithAlgorithm algorithm (GGraph graph _ _) = showGraphWithAlgorithm graph algorithm