Module ShowDotGraph

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: December 2018

Summary of exported operations:

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.

Exported datatypes:


DotGraph

A Dot graph consists of a name and a list of nodes and edges. It can be either directed (DGraph) or undirected (UGraph).

Constructors:


Node

A node of a dot graph consists of a name and a list of attributes for this node.

Constructors:

  • Node :: String -> [(String,String)] -> Node

Edge

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

Exported operations:

dgraph :: String -> [Node] -> [Edge] -> DotGraph   

Constructs a directed graph from a name and a list of nodes and edges.

Further infos:
  • solution complete, i.e., able to compute all solutions

ugraph :: String -> [Node] -> [Edge] -> DotGraph   

Constructs an undirected graph from a name and a list of nodes and edges.

Further infos:
  • solution complete, i.e., able to compute all solutions

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.