drasil-printers-0.1.10.0: A framework for code and document generation for scientific software - Printers SubPackage
Safe HaskellSafe-Inferred
LanguageHaskell2010

Language.Drasil.DOT.Print

Description

Defines printer types and functions for generating traceability graphs (as .dot files).

Synopsis

Types

type Colour = String Source #

Type synonym for clarity.

type Label = String Source #

Type synonym for clarity.

data NodeFamily Source #

A node family contains a list of UIDs, their display labels, general subgraph label, and colour.

Constructors

NF 

Fields

  • nodeUIDs :: [UID]

    Node UIDs.

  • nodeLabels :: [Label]

    Display labels for nodes. We use the reference addresses from the UIDs.

  • nfLabel :: Label

    Individual subgraph labels. These labels do not show on the final generated pdf or png files.

  • nfColour :: Colour

    Gives the ability to change colours of bubbles within the graph.

data GraphInfo Source #

Holds all important and relevant information for generating a traceability graph. Includes nodes, graph edges, and node family information.

Constructors

GI 

Fields

Functions

Main Outputs

outputDot :: FilePath -> GraphInfo -> IO () Source #

Creates the directory for output, gathers all individual graph output functions and calls them.

mkOutputAvsA :: GraphInfo -> IO () Source #

Output function for assumptions dependent on assumptions.

mkOutputAvsAll :: GraphInfo -> IO () Source #

Output function for definitions, models, requirements, and changes dependent on assumptions.

mkOutputRefvsRef :: GraphInfo -> IO () Source #

Output function for definitions and models that are dependent on other definitions and models.

mkOutputAllvsR :: GraphInfo -> IO () Source #

Output function for goals and requirements dependent on definitions, models, and other requirements.

mkOutputAllvsAll :: GraphInfo -> IO () Source #

Output function for definitions, models, requirements, goals, and changes that are dependent on one another.

Helpers

mkOutput :: GraphInfo -> String -> (GraphInfo -> [(UID, [UID])]) -> [GraphInfo -> NodeFamily] -> IO () Source #

General output function for making a traceability graph. Takes in the graph information, title, edge generator functions, and node family functions.

outputSub :: Handle -> [(UID, [UID])] -> [NodeFamily] -> IO () Source #

Graph output helper. Takes in the file handle, edges, and node families.

mkDirections :: Handle -> (UID, [UID]) -> IO () Source #

Prints graph edges (directions) onto a given file handle.

mkNodes :: Handle -> NodeFamily -> IO () Source #

Prints graph nodes (labels) onto a given file handle.

mkSubgraph :: Handle -> Label -> [UID] -> IO () Source #

Helper that only makes a subgraph if there are elements in the subgraph. Otherwise, it returns nothing.

filterAndGI :: GraphInfo -> [GraphInfo -> NodeFamily] -> [NodeFamily] Source #

Gets graph labels.

filterInvalidChars :: String -> String Source #

Helper to remove invalid characters.