Maintainer | [email protected] |
---|
Data.GraphViz
Description
This is the top-level module for the graphviz library. It provides
functions to convert Graph
s into
the Dot language used by the GraphViz program (as well as a
limited ability to perform the reverse operation).
Information about GraphViz and the Dot language can be found at: http://graphviz.org/
- graphToDot :: (Ord b, Graph gr) => gr a b -> [Attribute] -> (LNode a -> [Attribute]) -> (LEdge b -> [Attribute]) -> DotGraph
- clusterGraphToDot :: (Ord c, Ord b, Graph gr) => gr a b -> [Attribute] -> (LNode a -> NodeCluster c a) -> (c -> [Attribute]) -> (LNode a -> [Attribute]) -> (LEdge b -> [Attribute]) -> DotGraph
- graphToGraph :: (Ord b, Graph gr) => gr a b -> [Attribute] -> (LNode a -> [Attribute]) -> (LEdge b -> [Attribute]) -> IO (gr (AttributeNode a) (AttributeEdge b))
- dotizeGraph :: (DynGraph gr, Ord b) => gr a b -> gr (AttributeNode a) (AttributeEdge b)
- data NodeCluster c a
- = N (LNode a)
- | C c (NodeCluster c a)
- type AttributeNode a = ([Attribute], a)
- type AttributeEdge b = ([Attribute], b)
- module Data.GraphViz.Types
- module Data.GraphViz.Attributes
- module Data.GraphViz.Commands
Documentation
graphToDot :: (Ord b, Graph gr) => gr a b -> [Attribute] -> (LNode a -> [Attribute]) -> (LEdge b -> [Attribute]) -> DotGraphSource
Convert a graph to GraphViz's Dot format.
clusterGraphToDot :: (Ord c, Ord b, Graph gr) => gr a b -> [Attribute] -> (LNode a -> NodeCluster c a) -> (c -> [Attribute]) -> (LNode a -> [Attribute]) -> (LEdge b -> [Attribute]) -> DotGraphSource
Convert a graph to Dot format, using the specified clustering function to group nodes into clusters. Clusters can be nested to arbitrary depth.
graphToGraph :: (Ord b, Graph gr) => gr a b -> [Attribute] -> (LNode a -> [Attribute]) -> (LEdge b -> [Attribute]) -> IO (gr (AttributeNode a) (AttributeEdge b))Source
Run the graph via dot to get positional information and then combine that information back into the original graph. Note that this doesn't support graphs with clusters.
dotizeGraph :: (DynGraph gr, Ord b) => gr a b -> gr (AttributeNode a) (AttributeEdge b)Source
Pass the plain graph through graphToGraph
. This is an IO
action,
however since the state doesn't change it's safe to use unsafePerformIO
to convert this to a normal function.
data NodeCluster c a Source
Define into which cluster a particular node belongs. Nodes can be nested to arbitrary depth.
Constructors
N (LNode a) | |
C c (NodeCluster c a) |
Instances
(Show c, Show a) => Show (NodeCluster c a) |
type AttributeNode a = ([Attribute], a)Source
type AttributeEdge b = ([Attribute], b)Source
module Data.GraphViz.Types
module Data.GraphViz.Attributes
module Data.GraphViz.Commands