graphviz-2999.6.0.0: GraphViz bindings for Haskell.

MaintainerIvan.Miljenovic@gmail.com

Data.GraphViz.Commands

Description

This module defines functions to call the various GraphViz commands.

Most of these functions were from version 0.5 of Graphalyze:

http://hackage.haskell.org/cgi-bin/hackage-scripts/package/Graphalyze-0.5

Synopsis

Documentation

data GraphvizCommand Source

The available Graphviz commands.

Constructors

Dot 
Neato 
TwoPi 
Circo 
Fdp 

dirCommand :: GraphvizCommandSource

The default command for directed graphs.

undirCommand :: GraphvizCommandSource

The default command for undirected graphs.

commandFor :: DotGraph a -> GraphvizCommandSource

The appropriate (default) GraphViz command for the given graph.

data GraphvizOutput Source

The possible Graphviz outputs, obtained by running dot -Txxx. Note that it is not possible to choose between output variants, and that not all of these may be available on your system.

This will probably be improved in future. For now, more information is available from: http://graphviz.org/doc/info/output.html

Instances

runGraphviz :: PrintDot n => DotGraph n -> GraphvizOutput -> FilePath -> IO BoolSource

Run the recommended Graphviz command on this graph, saving the result to the file provided (note: file extensions are not checked). Returns True if successful, False otherwise.

runGraphvizCommand :: PrintDot n => GraphvizCommand -> DotGraph n -> GraphvizOutput -> FilePath -> IO BoolSource

Run the chosen Graphviz command on this graph, saving the result to the file provided (note: file extensions are not checked). Returns True if successful, False otherwise.

graphvizWithHandle :: (PrintDot n, Show a) => GraphvizCommand -> DotGraph n -> GraphvizOutput -> (Handle -> IO a) -> IO (Maybe a)Source

Run the chosen Graphviz command on this graph, but send the result to the given handle rather than to a file. The Handle -> IO a function should close the Handle once it is finished.

The result is wrapped in Maybe rather than throwing an error.