dotgen-0.4.1: A simple interface for building .dot graph files.

Portabilityportable
Stabilityunstable
MaintainerAndy Gill <andygill@ku.edu>

Text.Dot

Contents

Description

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.

Synopsis

Dot

data Dot a Source

Instances

Nodes

node :: [(String, String)] -> Dot NodeIdSource

node takes a list of attributes, generates a new node, and gives a NodeId.

data NodeId Source

Instances

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

edge :: NodeId -> NodeId -> [(String, String)] -> Dot ()Source

edge generates an edge between two NodeIds, with attributes.

edge' :: NodeId -> Maybe String -> NodeId -> Maybe String -> [(String, String)] -> Dot ()Source

edge generates an edge between two NodeIds, with optional node sub-labels, and attributes.

Showing a graph

Other combinators

scope :: Dot a -> Dot aSource

.->. generates an edge between two NodeIds.

scope groups a subgraph together; in dot these are the subgraphs inside { and }.

attribute :: (String, String) -> Dot ()Source

attribute gives a attribute to the current scope.

share :: [(String, String)] -> [NodeId] -> Dot ()Source

share is when a set of nodes share specific attributes. Usually used for layout tweaking.

same :: [NodeId] -> Dot ()Source

same provides a combinator for a common pattern; a set of NodeIds with the same rank.

cluster :: Dot a -> Dot (NodeId, a)Source

cluster builds an explicit, internally named subgraph (called cluster).

Simple netlist generation

netlistGraphSource

Arguments

:: Ord a 
=> (b -> [(String, String)])

Attributes for each node

-> (b -> [a])

Out edges leaving each node

-> [(a, b)]

The netlist

-> Dot () 

netlistGraph generates a simple graph from a netlist.