module Data.Graph.Analysis.Visualisation where
import Data.Graph.Analysis.Types
import Data.Graph.Analysis.Utils
import Data.Graph.Inductive.Graph
import Data.GraphViz
graphviz :: (Graph g, Show a, Ord b) => String -> g a b -> DotGraph
graphviz t g = graphToDot g attrs nattrs eattrs
where
attrs = [Label t]
nattrs (_,a) = [Label (show a)]
eattrs _ = []
graphvizClusters :: (Graph g, Show c, ClusterLabel a c, Ord b) =>
String -> g a b -> DotGraph
graphvizClusters t g = clusterGraphToDot g atts assignCluster catts natts eatts
where
atts = [Label t]
catts c = [Label (show c)]
natts (_,a) = [Label (nodelabel a)]
eatts _ = []