vacuum-graphviz-2.1.0.1: A library for transforming vacuum graphs into GraphViz output

Portabilitynon-portable (GHC only)
Stabilityexperimental
Maintainermad.one@gmail.com
Safe HaskellNone

GHC.Vacuum.GraphViz

Contents

Description

This module exports a simple, high level interface for exporting vacuum graphs to GraphViz dot output, and rendering them to PNG/SVG files. It also contains various helpers if you wish to customize the output yourself in some manner.

For this module to work, you will need to have graphviz installed, and the dot utility should be available somewhere in your $PATH.

The simplest possible usage of this module is like so:

 vacuumToPng "list" [1..10]

This will output a 'list.png' file, which contains a pretty graph visualization of the expression [1..10]. You may alternatively use vacuumToSvg in the same manner, to export a graph to an SVG file. This is more than sufficient for many use cases.

Synopsis

Simple API

vacuumToPng :: FilePath -> a -> IO FilePathSource

vacuumToPng foo e renders a graph representation of the expression e (which can be any expression what-so-ever) to the file "foo.png" for later viewing.

vacuumToSvg :: FilePath -> a -> IO FilePathSource

vacuumToSvg foo e renders a graph representation of the expression e (which can be any expression what-so-ever) to the file "foo.svg" for later viewing.

Lower level API allowing more output control

graphToDot :: Ord a => [(a, [a])] -> DotGraph aSource

graphToDotParams :: (Ord a, Ord cl) => GraphvizParams a () () cl l -> [(a, [a])] -> DotGraph aSource

GraphViz attributes