A simple library for graph visualization with Graphviz. It provides a data structure to represent graphs and operations to visualize them.
There is a convenient operation viewDotGraph
which visualizes
a graph with the dotviewcommand
specified in the rc file of
the Curry system. Thus, the value of the dotviewcommand
field
in the rc file (e.g., ~/.pakcsrc
in case of PAKCS) should be
correctly defined. Here are some reasonable settings of this field:
dotviewcommand=dot -Tpdf > /tmp/dotxxx.pdf && xdg-open /tmp/dotxxx.pdf dotviewcommand=neato -Tpdf > /tmp/dotxxx.pdf && xdg-open /tmp/dotxxx.pdf dotviewcommand=circo -Tpdf > /tmp/dotxxx.pdf && xdg-open /tmp/dotxxx.pdf dotviewcommand=fdp -Tpdf > /tmp/dotxxx.pdf && xdg-open /tmp/dotxxx.pdf
Author: Michael Hanus
Version: May 2023
dgraph
:: String -> [Node] -> [Edge] -> DotGraph
Constructs a directed graph from a name and a list of nodes and edges. |
dgraphWithAttrs
:: String -> [(String,String)] -> [Node] -> [Edge] -> DotGraph
Constructs a directed graph from a name, a list of attributes, and lists of nodes and edges. |
ugraph
:: String -> [Node] -> [Edge] -> DotGraph
Constructs an undirected graph from a name and a list of nodes and edges. |
ugraphWithAttrs
:: String -> [(String,String)] -> [Node] -> [Edge] -> DotGraph
Constructs an undirected graph from a name, a list of attributes, and lists of nodes and edges. |
showDotGraph
:: DotGraph -> String
Shows a Dot graph as a string of the DOT language. |
showDotGraphWithAttrs
:: String -> DotGraph -> String
Deprecated. |
viewDotGraph
:: DotGraph -> IO ()
Visualize a DOT graph with the dotviewcommand
specified in
the rc file of the Curry system.
|
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, a list of graph attributes,
and lists of nodes and edges.
It can be either directed (DGraph
) 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 a directed graph from a name, a list of attributes,
and lists of nodes and edges.
The attributes are graph attributes of the DOT language, e.g.,
|
Constructs an undirected graph from a name and a list of nodes and edges.
|
Constructs an undirected graph from a name, a list of attributes,
and lists of nodes and edges.
The attributes are graph attributes of the DOT language, e.g.,
|
Shows a Dot graph as a string of the DOT language. |
Deprecated. Use |
Visualize a DOT graph with the |
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. |