A simple library for graph visualization with Graphviz. It provides a data structure to represent graphs and operations to visualize them.
Author: Michael Hanus
Version: October 2018
dgraph
:: String -> [Node] -> [Edge] -> DotGraph
Constructs a directed graph from a name and a list of nodes and edges. |
ugraph
:: String -> [Node] -> [Edge] -> DotGraph
Constructs an undirected graph from a name and a list of nodes and edges. |
viewDotGraph
:: DotGraph -> IO ()
Visualize a DOT graph with the dotviewcommand
specified in
the rc file of the Curry system.
|
showDotGraph
:: DotGraph -> String
Shows a Dot graph as a string of the DOT language. |
getDotViewCmd
:: IO String
Read the command for viewing dot files from the rc file of the Curry system. |
setDotViewCmd
:: String -> IO ()
Sets the command for viewing dot files in the rc file of the Curry system. |
A Dot graph consists of a name and a list of nodes and edges.
It can be either directed (Graph
) or undirected (UGraph
).
Constructors:
A node of a dot graph consists of a name and a list of attributes for this node.
Constructors:
Node
:: String -> [(String,String)] -> Node
An edge of a dot graph consists of the names of the source and target node and a list of attributes for this edge.
Constructors:
Edge
:: String -> String -> [(String,String)] -> Edge
Constructs a directed graph from a name and a list of nodes and edges.
|
Constructs an undirected graph from a name and a list of nodes and edges.
|
Visualize a DOT graph with the |
Shows a Dot graph as a string of the DOT language. |
Read the command for viewing dot files from the rc file of the Curry system. |
Sets the command for viewing dot files in the rc file of the Curry system. |