Module

Data.DotLang

Package
purescript-dotlang
Repository
csicar/purescript-dotlang

#Id Source

type Id = String

type alias for a Nodes Name

#Node Source

data Node

Dot-Node example :

Node "e" [Margin 3, Label "some label"]

is turned into: e [margin=3, label="some label"];

Constructors

Instances

#nodeId Source

nodeId :: Node -> Id

get a nodes id example:

nodeId (Node "e" [Label "foo"]) == "e"

#changeNodeId Source

changeNodeId :: (Id -> Id) -> Node -> Node

change Nodes id to a new one; keeing the old id as the label example: mapNodeId (\a -> a+"!") (Node "e" []) == Node "e!" [Label "e"]

#Edge Source

data Edge

egde from id to id toText $ Edge Forward "a" "b" [] == a -> b [] EdgeType determines the direction of the arrow

Constructors

Instances

#Definition Source

data Definition

definition in a graph

Constructors

Instances

#node Source

node :: Id -> Array Attr -> Definition
node "a" [] -- ∷ Definition

node as a part of a definition

#edge Source

edge :: EdgeType -> Id -> Id -> Array Attr -> Definition
edge Forward "a" "b" [] -- ∷ Definition

edge as a part of a definition. ==> and =*> can also be used for that purpose.

#forwardEdgeWithAttrs Source

#forwardEdge Source

#backwardEdgeWithAttrs Source

#backwardEdge Source

#normalEdgeWithAttrs Source

#normalEdge Source

#(==>) Source

Operator alias for Data.DotLang.forwardEdge (non-associative / precedence 5)

"a" ==> "b" -- :: Definition

Forward edge as as a definition

#(=*>) Source

Operator alias for Data.DotLang.forwardEdgeWithAttrs (non-associative / precedence 5)

"a" =*> "b" $ [ Edge.FillColor red ]
-- toText will be: a -> b [fillcolor="#f44336"];

Forward edge with attributes as a definition

#(<==) Source

Operator alias for Data.DotLang.backwardEdge (non-associative / precedence 5)

"a" <== "b" -- :: Definition

Backward edge as a definition

#(<*=) Source

Operator alias for Data.DotLang.backwardEdgeWithAttrs (non-associative / precedence 5)

"a" <*= "b" $ [ Edge.FillColor red ]

Backward edge with attributes as a definition

#(-==-) Source

Operator alias for Data.DotLang.normalEdge (non-associative / precedence 5)

"a" -==- "b"

Normal edge as definition

#(=*=) Source

Operator alias for Data.DotLang.normalEdgeWithAttrs (non-associative / precedence 5)

"a" =*= "b" $ [ Edge.FillColor red ]

Normal edge with attibutes

#Graph Source

data Graph

graph can either be a graph or digraph

Constructors

Instances

#graphFromElements Source

graphFromElements :: Array (Node) -> Array (Edge) -> Graph

create graph from Nodes and Edges example: graphFromElements [Node "e" [], Node "d" []] [Edge "e" "f"]

#GraphRepr Source

class GraphRepr a  where

a is a type that can be represented by a Dot-Graph

Members