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