| Maintainer | Ivan.Miljenovic@gmail.com |
|---|---|
| Safe Haskell | Safe-Infered |
Data.Graph.Analysis.Reporting
Description
This module defines the report framework used.
- data Document = Doc {}
- class DocumentGenerator dg where
- createDocument :: dg -> Document -> IO (Maybe FilePath)
- docExtension :: dg -> String
- data Location
- data DocElement
- = Section DocInline [DocElement]
- | Paragraph [DocInline]
- | Enumeration [DocElement]
- | Itemized [DocElement]
- | Definitions [(DocInline, DocInline)]
- | GraphImage DocGraph
- data DocInline
- data GraphSize
- data DocGraph = DG {}
- data VisParams = VParams {}
- data VisProperties = VProps {}
- addLegend :: FilePath -> FilePath -> VisProperties -> Document -> IO Document
- today :: IO String
- tryCreateDirectory :: FilePath -> IO Bool
- createGraph :: VisParams -> DocGraph -> IO DocElement
- createSize :: Double -> GraphSize
- unDotPath :: FilePath -> FilePath
Document representation
Document is the simplified representation of a document. Note
that this just specifies a document layout, and not an
implementation. To actually create a "physical" document,
you must use an instance of DocumentGenerator.
Representation of a document. The document is to be stored in
the directory rootDirectory, and the main file is to have a
filename of , where fileFront <.> (docExtension dg)dg is an
instance of DocumentGenerator.
Constructors
| Doc | |
Fields
| |
class DocumentGenerator dg whereSource
Represents the class of document generators.
Methods
createDocument :: dg -> Document -> IO (Maybe FilePath)Source
Convert idealised Document values into actual documents,
returning the document file created.
docExtension :: dg -> StringSource
The extension of all document-style files created. Note that this doesn't preclude the creation of other files, e.g. images.
Instances
Representation of a location, either on the internet or locally.
data DocElement Source
Elements of a document.
Constructors
| Section DocInline [DocElement] | |
| Paragraph [DocInline] | |
| Enumeration [DocElement] | |
| Itemized [DocElement] | |
| Definitions [(DocInline, DocInline)] | |
| GraphImage DocGraph |
Instances
Inline elements of a document.
Specify the size the DotGraph should be at.
Constructors
| GivenSize Point | Specify the size to use. |
| DefaultSize | Let GraphViz choose an appropriate size. |
Specify the DotGraph to turn into an image, its filename (sans
extension) and its caption. The DotGraph should not have a
Size set.
Constructors
| DG | |
Defines the parameters used for creating visualisations of graphs.
Constructors
| VParams | |
Fields
| |
data VisProperties Source
A specification on how to visualise a DocGraph.
Constructors
| VProps | |
Fields
| |
Helper functions
Utility functions to help with document creation.
addLegend :: FilePath -> FilePath -> VisProperties -> Document -> IO DocumentSource
Create the legend section and add it to the document proper.
Return today's date as a string, e.g. "Monday 1 January, 2000". This arbitrary format is chosen as there doesn't seem to be a way of determining the correct format as per the user's locale settings.
tryCreateDirectory :: FilePath -> IO BoolSource
Attempts to create the specified directly, returning True
if successful (or if the directory already exists), False
if an error occurred.
Arguments
| :: VisParams | Visualisation parameters. |
| -> DocGraph | |
| -> IO DocElement |
Attempts to create image files (with the given filename in the
given directory) from the graph. If the second VisProperties
not Nothing, then the first image links to the second. The
whole result is wrapped in a Paragraph. unDotPath is applied
to the filename in the DocGraph.
If saveDot is true, then it is assumed that the format isn't
Canon, DotOutput or XDot (because of filename clashes).
createSize :: Double -> GraphSizeSource
Using a 6:4 ratio, create the given Point representing
width,height from the width.