1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
|
{-# LANGUAGE OverloadedStrings #-}
{-# OPTIONS_HADDOCK hide #-}
{- |
Module : Data.GraphViz.Commands.Available
Description : Available command-line programs
Copyright : (c) Ivan Lazar Miljenovic
License : 3-Clause BSD-style
Maintainer : Ivan.Miljenovic@gmail.com
These are the known programs that read in Dot graphs.
-}
module Data.GraphViz.Commands.Available where
import Data.GraphViz.Parsing
import Data.GraphViz.Printing
-- -----------------------------------------------------------------------------
-- | The available Graphviz commands. The following directions are
-- based upon those in the Graphviz man page (available online at
-- <http://graphviz.org/pdf/dot.1.pdf>, or if installed on your
-- system @man graphviz@). Note that any command can be used on
-- both directed and undirected graphs.
--
-- When used with the 'Layout' attribute, it overrides any actual
-- command called on the dot graph.
data GraphvizCommand = Dot -- ^ For hierachical graphs (ideal for
-- directed graphs).
| Neato -- ^ For symmetric layouts of graphs
-- (ideal for undirected graphs).
| TwoPi -- ^ For radial layout of graphs.
| Circo -- ^ For circular layout of graphs.
| Fdp -- ^ Spring-model approach for
-- undirected graphs.
| Sfdp -- ^ As with Fdp, but ideal for large
-- graphs.
| Osage -- ^ Filter for drawing clustered graphs,
-- requires Graphviz >= 2.28.0.
| Patchwork -- ^ Draw clustered graphs as treemaps,
-- requires Graphviz >= 2.28.0.
deriving (Eq, Ord, Bounded, Enum, Show, Read)
instance PrintDot GraphvizCommand where
unqtDot Dot = text "dot"
unqtDot Neato = text "neato"
unqtDot TwoPi = text "twopi"
unqtDot Circo = text "circo"
unqtDot Fdp = text "fdp"
unqtDot Sfdp = text "sfdp"
unqtDot Osage = text "osage"
unqtDot Patchwork = text "patchwork"
instance ParseDot GraphvizCommand where
parseUnqt = stringValue [ ("dot", Dot)
, ("neato", Neato)
, ("twopi", TwoPi)
, ("circo", Circo)
, ("fdp", Fdp)
, ("sfdp", Sfdp)
, ("osage", Osage)
, ("patchwork", Patchwork)
]
|