Portability | portable |
---|---|
Stability | unstable |
Maintainer | Andy Gill <andygill@ku.edu> |
Safe Haskell | Safe-Infered |
This module provides a simple interface for building .dot graph files, for input into the dot and graphviz tools. It includes a monadic interface for building graphs.
- data Dot a
- node :: [(String, String)] -> Dot NodeId
- data NodeId
- userNodeId :: Int -> NodeId
- userNode :: NodeId -> [(String, String)] -> Dot ()
- edge :: NodeId -> NodeId -> [(String, String)] -> Dot ()
- showDot :: Dot a -> String
- scope :: Dot a -> Dot a
- attribute :: (String, String) -> Dot ()
- nodeAttributes :: [(String, String)] -> Dot ()
- edgeAttributes :: [(String, String)] -> Dot ()
- graphAttributes :: [(String, String)] -> Dot ()
- share :: [(String, String)] -> [NodeId] -> Dot ()
- same :: [NodeId] -> Dot ()
- cluster :: Dot a -> Dot (NodeId, a)
- data Record a
- field :: String -> Record a
- portField :: a -> String -> Record a
- hcat :: [Record a] -> Record a
- hcat' :: [String] -> Record a
- vcat :: [Record a] -> Record a
- vcat' :: [String] -> Record a
- record :: Record a -> [(String, String)] -> Dot (NodeId, [(a, NodeId)])
- record' :: Record a -> [(String, String)] -> Dot (NodeId, [NodeId])
- record_ :: Record a -> [(String, String)] -> Dot NodeId
- mrecord :: Record a -> [(String, String)] -> Dot (NodeId, [(a, NodeId)])
- mrecord' :: Record a -> [(String, String)] -> Dot (NodeId, [NodeId])
- mrecord_ :: Record a -> [(String, String)] -> Dot NodeId
Dot
Nodes
userNodeId :: Int -> NodeIdSource
userNodeId
allows a user to use their own (Int-based) node id's, without needing to remap them.
userNode :: NodeId -> [(String, String)] -> Dot ()Source
userNode
takes a NodeId, and adds some attributes to that node.
Edges
Showing a graph
Other combinators
nodeAttributes :: [(String, String)] -> Dot ()Source
nodeAttributes
sets attributes for all the following nodes in the scope.
edgeAttributes :: [(String, String)] -> Dot ()Source
edgeAttributes
sets attributes for all the following edges in the scope.
graphAttributes :: [(String, String)] -> Dot ()Source
graphAttributes
sets attributes for current graph.
share :: [(String, String)] -> [NodeId] -> Dot ()Source
share
is when a set of nodes share specific attributes. Usually used for layout tweaking.
cluster :: Dot a -> Dot (NodeId, a)Source
cluster
builds an explicit, internally named subgraph (called cluster).
Record specification
Specifies the construction of a record; i.e., mentions all fields possibly together with ports and their horizontal and vertical nesting. (see: record shapes in the DOT documentation.)
portField :: a -> String -> Record aSource
A field together with a port which can be used to create direct edges to this field. Note that you can use any type to identify the ports. When creating a record node you will get back an association list between your record identifiers and their concrete node ids.
hcat' :: [String] -> Record aSource
Concatenate a list strings interpreted as simple fields horizontally.
vcat' :: [String] -> Record aSource
Concatenate a list strings interpreted as simple fields vertically.
Record node construction
record :: Record a -> [(String, String)] -> Dot (NodeId, [(a, NodeId)])Source
Create a record node with the given attributes. It returns the node-id of the created node together with an association list mapping the port idenfiers given in the record to their corresponding node-ids. This list is ordered according to a left-to-rigth traversal of the record description.
record' :: Record a -> [(String, String)] -> Dot (NodeId, [NodeId])Source
A variant of record ignoring the port identifiers.
record_ :: Record a -> [(String, String)] -> Dot NodeIdSource
A variant of record ignoring the port to node-id association list.
mrecord :: Record a -> [(String, String)] -> Dot (NodeId, [(a, NodeId)])Source
Like record, but creates record nodes with rounded corners; i.e. uses the "Mrecord" shape instead of the "record" shape.