| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
DotParse
Contents
Description
Parser & Printer for the dot language of graphviz
See DotParse.Examples for usage.
Synopsis
- data DotConfig = DotConfig {}
- defaultDotConfig :: DotConfig
- class DotParse a where
- testDotParser :: DotParse a => Proxy a -> DotConfig -> ByteString -> IO ()
- runDotParser :: DotParse a => ByteString -> a
- data Graph = Graph {
- strict :: Last Strict
- directed :: Last Directed
- graphid :: Last ID
- nodeAttributes :: Map ID ID
- graphAttributes :: Map ID ID
- edgeAttributes :: Map ID ID
- globalAttributes :: Map ID ID
- nodes :: [NodeStatement]
- edges :: [EdgeStatement]
- subgraphs :: [SubGraphStatement]
- defaultGraph :: Graph
- attL :: AttributeType -> ID -> Lens' Graph (Maybe ID)
- gattL :: ID -> Lens' Graph (Maybe ID)
- processDot :: Directed -> ByteString -> IO ByteString
- processDotWith :: Directed -> [String] -> ByteString -> IO ByteString
- processGraph :: Graph -> IO Graph
- processGraphWith :: DotConfig -> Graph -> IO Graph
- data Strict
- defStrict :: Last Strict -> Strict
- data Directed
- defDirected :: Last Directed -> Directed
- data ID
- label :: ID -> String
- data Compass
- newtype Port = Port {}
- data AttributeType
- data AttributeStatement = AttributeStatement {}
- data NodeStatement = NodeStatement {}
- data EdgeID
- data EdgeOp
- fromDirected :: Directed -> EdgeOp
- data EdgeStatement = EdgeStatement {}
- edgeID :: EdgeID -> Maybe ID
- edgeIDs :: EdgeStatement -> [(Maybe ID, Maybe ID)]
- edgeIDsNamed :: EdgeStatement -> [(ID, ID)]
- data Statement
- addStatement :: Statement -> Graph -> Graph
- addStatements :: [Statement] -> Graph -> Graph
- data SubGraphStatement = SubGraphStatement {
- subgraphID :: Maybe ID
- subgraphStatements :: [Statement]
- graphToChartWith :: ChartConfig -> (ID -> Text) -> Graph -> ChartOptions
- graphToChart :: Graph -> ChartOptions
- data ChartConfig = ChartConfig {}
- defaultChartConfig :: ChartConfig
- toStatements :: Directed -> Graph ByteString -> [Statement]
- toDotGraph :: Graph ByteString -> Graph
- toDotGraphWith :: Directed -> Graph -> Graph ByteString -> Graph
Documentation
printing options, for separators.
Constructors
| DotConfig | |
Fields | |
Instances
defaultDotConfig :: DotConfig Source #
default separators
class DotParse a where Source #
A parser & printer class for a graphviz graph and components of its dot language
Instances
| DotParse AttributeStatement Source # | |
Defined in DotParse.Types Methods dotPrint :: DotConfig -> AttributeStatement -> ByteString Source # | |
| DotParse AttributeType Source # | |
Defined in DotParse.Types Methods dotPrint :: DotConfig -> AttributeType -> ByteString Source # | |
| DotParse Compass Source # | |
| DotParse Directed Source # | |
| DotParse EdgeID Source # | |
| DotParse EdgeOp Source # | |
| DotParse EdgeStatement Source # | |
Defined in DotParse.Types Methods dotPrint :: DotConfig -> EdgeStatement -> ByteString Source # | |
| DotParse GlobalAttributeStatement Source # | |
Defined in DotParse.Types Methods dotPrint :: DotConfig -> GlobalAttributeStatement -> ByteString Source # | |
| DotParse Graph Source # | |
| DotParse ID Source # | |
| DotParse NodeStatement Source # | |
Defined in DotParse.Types Methods dotPrint :: DotConfig -> NodeStatement -> ByteString Source # | |
| DotParse Port Source # | |
| DotParse Statement Source # | |
| DotParse Strict Source # | |
| DotParse SubGraphStatement Source # | |
Defined in DotParse.Types Methods dotPrint :: DotConfig -> SubGraphStatement -> ByteString Source # | |
| DotParse (Point Double) Source # | |
| DotParse (Rect Double) Source # | |
| DotParse (Map ID ID) Source # | Attribute collections A given entity can have multiple attribute lists. For simplicity, these are mconcat'ed on parsing. |
| DotParse (ID, ID) Source # | Attribute key-value pair of identifiers |
testDotParser :: DotParse a => Proxy a -> DotConfig -> ByteString -> IO () Source #
dotParse and then dotPrint:
- pretty printing error on failure.
- This is not an exact parser/printer, so the test re-parses the dotPrint, which should be idempotent
runDotParser :: DotParse a => ByteString -> a Source #
run a dotParse erroring on leftovers, Fail or Err
Representation of a full graphviz graph, as per the dot language specification
Constructors
| Graph | |
Fields
| |
Instances
| Monoid Graph Source # | |||||
| Semigroup Graph Source # | |||||
| Generic Graph Source # | |||||
Defined in DotParse.Types Associated Types
| |||||
| Show Graph Source # | |||||
| DotParse Graph Source # | |||||
| Eq Graph Source # | |||||
| type Rep Graph Source # | |||||
Defined in DotParse.Types type Rep Graph = D1 ('MetaData "Graph" "DotParse.Types" "dotparse-0.1.3.0-IDgixl6IbIRGmpQU5Pfi1E" 'False) (C1 ('MetaCons "Graph" 'PrefixI 'True) (((S1 ('MetaSel ('Just "strict") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Last Strict)) :*: S1 ('MetaSel ('Just "directed") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Last Directed))) :*: (S1 ('MetaSel ('Just "graphid") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Last ID)) :*: (S1 ('MetaSel ('Just "nodeAttributes") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Map ID ID)) :*: S1 ('MetaSel ('Just "graphAttributes") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Map ID ID))))) :*: ((S1 ('MetaSel ('Just "edgeAttributes") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Map ID ID)) :*: S1 ('MetaSel ('Just "globalAttributes") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Map ID ID))) :*: (S1 ('MetaSel ('Just "nodes") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [NodeStatement]) :*: (S1 ('MetaSel ('Just "edges") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [EdgeStatement]) :*: S1 ('MetaSel ('Just "subgraphs") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [SubGraphStatement])))))) | |||||
defaultGraph :: Graph Source #
Directed graph of size 1.
>>>BS.putStr $ dotPrint defaultDotConfig defaultGraph <> "\n"digraph { node [height=0.5;shape=circle] graph [overlap=false;size="1!";splines=spline] edge [arrowsize=0.5] rankdir="TB" }
processDot :: Directed -> ByteString -> IO ByteString Source #
run a dot string through graphviz, collecting the augmented dot string output
processDotWith :: Directed -> [String] -> ByteString -> IO ByteString Source #
run a dot string through graphviz, supplying arguments and collecting stdout
MergeEdges (strict)
Constructors
| MergeEdges | |
| NoMergeEdges |
Directed (digraph | graph)
Constructors
| Directed | |
| UnDirected |
Identifier as per the dot language specifications.
>>>runDotParser "0" :: IDIDInt 0
>>>runDotParser "-.123" :: IDIDDouble (-0.123)
>>>runParser dotParse "apple_1'" :: Result Error IDOK (ID "apple_1") "'"
>>>:set -XQuasiQuotes>>>runParser dotParse "\"hello\"" :: Result Error IDOK (IDQuoted "hello") ""
>>>runDotParser "<The <font color='red'><b>foo</b></font>,<br/> the <font point-size='20'>bar</font> and<br/> the <i>baz</i>>" :: IDIDHtml "<The <font color='red'><b>foo</b></font>,<br/> the <font point-size='20'>bar</font> and<br/> the <i>baz</i>>"
>>>runDotParser "shape=diamond" :: (ID,ID)(ID "shape",ID "diamond")
>>>runDotParser "fontname=\"Arial\"" :: (ID,ID)(ID "fontname",IDQuoted "Arial")
>>>runDotParser "[shape=diamond; color=blue] [label=label]" :: Map.Map ID IDfromList [(ID "color",ID "blue"),(ID "label",ID "label"),(ID "shape",ID "diamond")]
Constructors
| ID ByteString | |
| IDInt Int | |
| IDDouble Double | |
| IDQuoted ByteString | |
| IDHtml ByteString |
Instances
| Generic ID Source # | |||||
Defined in DotParse.Types Associated Types
| |||||
| Show ID Source # | |||||
| DotParse ID Source # | |||||
| Eq ID Source # | |||||
| Ord ID Source # | |||||
| DotParse (Map ID ID) Source # | Attribute collections A given entity can have multiple attribute lists. For simplicity, these are mconcat'ed on parsing. | ||||
| DotParse (ID, ID) Source # | Attribute key-value pair of identifiers | ||||
| type Rep ID Source # | |||||
Defined in DotParse.Types type Rep ID = D1 ('MetaData "ID" "DotParse.Types" "dotparse-0.1.3.0-IDgixl6IbIRGmpQU5Pfi1E" 'False) ((C1 ('MetaCons "ID" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ByteString)) :+: C1 ('MetaCons "IDInt" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int))) :+: (C1 ('MetaCons "IDDouble" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Double)) :+: (C1 ('MetaCons "IDQuoted" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ByteString)) :+: C1 ('MetaCons "IDHtml" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ByteString))))) | |||||
label :: ID -> String Source #
ID as the equivalent plain String
note that the dot language identifier equivalence law is:
x == y if label x == label y
Compass instructions which are optionally associated with an identifier
Constructors
| CompassN | |
| CompassNE | |
| CompassE | |
| CompassSE | |
| CompassS | |
| CompassSW | |
| CompassW | |
| CompassNW | |
| CompassC | |
| Compass_ |
Instances
| Generic Compass Source # | |||||
Defined in DotParse.Types Associated Types
| |||||
| Show Compass Source # | |||||
| DotParse Compass Source # | |||||
| Eq Compass Source # | |||||
| type Rep Compass Source # | |||||
Defined in DotParse.Types type Rep Compass = D1 ('MetaData "Compass" "DotParse.Types" "dotparse-0.1.3.0-IDgixl6IbIRGmpQU5Pfi1E" 'False) (((C1 ('MetaCons "CompassN" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "CompassNE" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "CompassE" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "CompassSE" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "CompassS" 'PrefixI 'False) (U1 :: Type -> Type)))) :+: ((C1 ('MetaCons "CompassSW" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "CompassW" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "CompassNW" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "CompassC" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Compass_" 'PrefixI 'False) (U1 :: Type -> Type))))) | |||||
Port instructions which are optionally associated with an identifier
data AttributeType Source #
Category of attribute
Instances
| Generic AttributeType Source # | |||||
Defined in DotParse.Types Associated Types
| |||||
| Show AttributeType Source # | |||||
Defined in DotParse.Types Methods showsPrec :: Int -> AttributeType -> ShowS # show :: AttributeType -> String # showList :: [AttributeType] -> ShowS # | |||||
| DotParse AttributeType Source # | |||||
Defined in DotParse.Types Methods dotPrint :: DotConfig -> AttributeType -> ByteString Source # | |||||
| Eq AttributeType Source # | |||||
Defined in DotParse.Types Methods (==) :: AttributeType -> AttributeType -> Bool # (/=) :: AttributeType -> AttributeType -> Bool # | |||||
| type Rep AttributeType Source # | |||||
Defined in DotParse.Types type Rep AttributeType = D1 ('MetaData "AttributeType" "DotParse.Types" "dotparse-0.1.3.0-IDgixl6IbIRGmpQU5Pfi1E" 'False) (C1 ('MetaCons "GraphType" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "NodeType" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "EdgeType" 'PrefixI 'False) (U1 :: Type -> Type))) | |||||
data AttributeStatement Source #
Top-level attribute statement
>>>runDotParser "graph [overlap=false, splines=spline, size=\"1!\"];" :: StatementStatementAttribute (AttributeStatement {attributeType = GraphType, attributes = fromList [(ID "overlap",ID "false"),(ID "size",IDQuoted "1!"),(ID "splines",ID "spline")]})
Constructors
| AttributeStatement | |
Fields
| |
Instances
| Generic AttributeStatement Source # | |||||
Defined in DotParse.Types Associated Types
Methods from :: AttributeStatement -> Rep AttributeStatement x # to :: Rep AttributeStatement x -> AttributeStatement # | |||||
| Show AttributeStatement Source # | |||||
Defined in DotParse.Types Methods showsPrec :: Int -> AttributeStatement -> ShowS # show :: AttributeStatement -> String # showList :: [AttributeStatement] -> ShowS # | |||||
| DotParse AttributeStatement Source # | |||||
Defined in DotParse.Types Methods dotPrint :: DotConfig -> AttributeStatement -> ByteString Source # | |||||
| Eq AttributeStatement Source # | |||||
Defined in DotParse.Types Methods (==) :: AttributeStatement -> AttributeStatement -> Bool # (/=) :: AttributeStatement -> AttributeStatement -> Bool # | |||||
| type Rep AttributeStatement Source # | |||||
Defined in DotParse.Types type Rep AttributeStatement = D1 ('MetaData "AttributeStatement" "DotParse.Types" "dotparse-0.1.3.0-IDgixl6IbIRGmpQU5Pfi1E" 'False) (C1 ('MetaCons "AttributeStatement" 'PrefixI 'True) (S1 ('MetaSel ('Just "attributeType") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 AttributeType) :*: S1 ('MetaSel ('Just "attributes") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Map ID ID)))) | |||||
data NodeStatement Source #
Node statement
>>>runDotParser "A [shape=diamond; color=blue]" :: StatementStatementNode (NodeStatement {nodeID = ID "A", port = Nothing, nodeAttrs = fromList [(ID "color",ID "blue"),(ID "shape",ID "diamond")]})
Instances
| Generic NodeStatement Source # | |||||
Defined in DotParse.Types Associated Types
| |||||
| Show NodeStatement Source # | |||||
Defined in DotParse.Types Methods showsPrec :: Int -> NodeStatement -> ShowS # show :: NodeStatement -> String # showList :: [NodeStatement] -> ShowS # | |||||
| DotParse NodeStatement Source # | |||||
Defined in DotParse.Types Methods dotPrint :: DotConfig -> NodeStatement -> ByteString Source # | |||||
| Eq NodeStatement Source # | |||||
Defined in DotParse.Types Methods (==) :: NodeStatement -> NodeStatement -> Bool # (/=) :: NodeStatement -> NodeStatement -> Bool # | |||||
| type Rep NodeStatement Source # | |||||
Defined in DotParse.Types type Rep NodeStatement = D1 ('MetaData "NodeStatement" "DotParse.Types" "dotparse-0.1.3.0-IDgixl6IbIRGmpQU5Pfi1E" 'False) (C1 ('MetaCons "NodeStatement" 'PrefixI 'True) (S1 ('MetaSel ('Just "nodeID") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ID) :*: (S1 ('MetaSel ('Just "port") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Port)) :*: S1 ('MetaSel ('Just "nodeAttrs") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Map ID ID))))) | |||||
An edge can be specified in as a NodeID or as a SubGraph
Constructors
| EdgeID ID (Maybe Port) | |
| EdgeSubGraph SubGraphStatement |
Instances
| Generic EdgeID Source # | |||||
Defined in DotParse.Types Associated Types
| |||||
| Show EdgeID Source # | |||||
| DotParse EdgeID Source # | |||||
| Eq EdgeID Source # | |||||
| type Rep EdgeID Source # | |||||
Defined in DotParse.Types type Rep EdgeID = D1 ('MetaData "EdgeID" "DotParse.Types" "dotparse-0.1.3.0-IDgixl6IbIRGmpQU5Pfi1E" 'False) (C1 ('MetaCons "EdgeID" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ID) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Port))) :+: C1 ('MetaCons "EdgeSubGraph" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 SubGraphStatement))) | |||||
An edgeop is -> in directed graphs and -- in undirected graphs.
Constructors
| EdgeDirected | |
| EdgeUndirected |
fromDirected :: Directed -> EdgeOp Source #
generate an EdgeOp given the type of graph.
data EdgeStatement Source #
Edge statement
>>>runDotParser "A -> B [style=dashed, color=grey]" :: StatementStatementEdge (EdgeStatement {edgeOp = EdgeDirected, leftEdge = EdgeID (ID "A") Nothing, rightEdges = EdgeID (ID "B") Nothing :| [], edgeAttrs = fromList [(ID "color",ID "grey"),(ID "style",ID "dashed")]})
Constructors
| EdgeStatement | |
Instances
| Generic EdgeStatement Source # | |||||
Defined in DotParse.Types Associated Types
| |||||
| Show EdgeStatement Source # | |||||
Defined in DotParse.Types Methods showsPrec :: Int -> EdgeStatement -> ShowS # show :: EdgeStatement -> String # showList :: [EdgeStatement] -> ShowS # | |||||
| DotParse EdgeStatement Source # | |||||
Defined in DotParse.Types Methods dotPrint :: DotConfig -> EdgeStatement -> ByteString Source # | |||||
| Eq EdgeStatement Source # | |||||
Defined in DotParse.Types Methods (==) :: EdgeStatement -> EdgeStatement -> Bool # (/=) :: EdgeStatement -> EdgeStatement -> Bool # | |||||
| type Rep EdgeStatement Source # | |||||
Defined in DotParse.Types type Rep EdgeStatement = D1 ('MetaData "EdgeStatement" "DotParse.Types" "dotparse-0.1.3.0-IDgixl6IbIRGmpQU5Pfi1E" 'False) (C1 ('MetaCons "EdgeStatement" 'PrefixI 'True) ((S1 ('MetaSel ('Just "edgeOp") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 EdgeOp) :*: S1 ('MetaSel ('Just "leftEdge") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 EdgeID)) :*: (S1 ('MetaSel ('Just "rightEdges") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (NonEmpty EdgeID)) :*: S1 ('MetaSel ('Just "edgeAttrs") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Map ID ID))))) | |||||
edgeIDs :: EdgeStatement -> [(Maybe ID, Maybe ID)] Source #
list of edges in a given EdgeStatement, including anonymous SugGraphs
edgeIDsNamed :: EdgeStatement -> [(ID, ID)] Source #
edge IDs
A dot statement as per the dot language specification.
Constructors
| StatementNode NodeStatement | |
| StatementEdge EdgeStatement | |
| StatementGlobalAttribute GlobalAttributeStatement | |
| StatementAttribute AttributeStatement | |
| StatementSubGraph SubGraphStatement |
Instances
| Generic Statement Source # | |||||
Defined in DotParse.Types Associated Types
| |||||
| Show Statement Source # | |||||
| DotParse Statement Source # | |||||
| Eq Statement Source # | |||||
| type Rep Statement Source # | |||||
Defined in DotParse.Types type Rep Statement = D1 ('MetaData "Statement" "DotParse.Types" "dotparse-0.1.3.0-IDgixl6IbIRGmpQU5Pfi1E" 'False) ((C1 ('MetaCons "StatementNode" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 NodeStatement)) :+: C1 ('MetaCons "StatementEdge" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 EdgeStatement))) :+: (C1 ('MetaCons "StatementGlobalAttribute" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 GlobalAttributeStatement)) :+: (C1 ('MetaCons "StatementAttribute" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 AttributeStatement)) :+: C1 ('MetaCons "StatementSubGraph" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 SubGraphStatement))))) | |||||
data SubGraphStatement Source #
A subgraph statement.
Note: each subgraph must have a unique name
>>>runDotParser "subgraph A {A, B, C}" :: StatementStatementSubGraph (SubGraphStatement {subgraphID = Just (ID "A"), subgraphStatements = [StatementNode (NodeStatement {nodeID = ID "A", port = Nothing, nodeAttrs = fromList []}),StatementNode (NodeStatement {nodeID = ID "B", port = Nothing, nodeAttrs = fromList []}),StatementNode (NodeStatement {nodeID = ID "C", port = Nothing, nodeAttrs = fromList []})]})
Constructors
| SubGraphStatement | |
Fields
| |
Instances
| Generic SubGraphStatement Source # | |||||
Defined in DotParse.Types Associated Types
Methods from :: SubGraphStatement -> Rep SubGraphStatement x # to :: Rep SubGraphStatement x -> SubGraphStatement # | |||||
| Show SubGraphStatement Source # | |||||
Defined in DotParse.Types Methods showsPrec :: Int -> SubGraphStatement -> ShowS # show :: SubGraphStatement -> String # showList :: [SubGraphStatement] -> ShowS # | |||||
| DotParse SubGraphStatement Source # | |||||
Defined in DotParse.Types Methods dotPrint :: DotConfig -> SubGraphStatement -> ByteString Source # | |||||
| Eq SubGraphStatement Source # | |||||
Defined in DotParse.Types Methods (==) :: SubGraphStatement -> SubGraphStatement -> Bool # (/=) :: SubGraphStatement -> SubGraphStatement -> Bool # | |||||
| type Rep SubGraphStatement Source # | |||||
Defined in DotParse.Types type Rep SubGraphStatement = D1 ('MetaData "SubGraphStatement" "DotParse.Types" "dotparse-0.1.3.0-IDgixl6IbIRGmpQU5Pfi1E" 'False) (C1 ('MetaCons "SubGraphStatement" 'PrefixI 'True) (S1 ('MetaSel ('Just "subgraphID") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe ID)) :*: S1 ('MetaSel ('Just "subgraphStatements") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Statement]))) | |||||
Conversion
graphToChartWith :: ChartConfig -> (ID -> Text) -> Graph -> ChartOptions Source #
convert a Graph processed via the graphviz commands to a ChartOptions
graphToChart :: Graph -> ChartOptions Source #
convert a Graph processed via the graphviz commands to a ChartOptions using the default ChartConfig.
data ChartConfig Source #
Various configutaion parameters for the chart-svg Chart
Constructors
| ChartConfig | |
Fields
| |
Instances
| Generic ChartConfig Source # | |||||
Defined in DotParse.Types Associated Types
| |||||
| Show ChartConfig Source # | |||||
Defined in DotParse.Types Methods showsPrec :: Int -> ChartConfig -> ShowS # show :: ChartConfig -> String # showList :: [ChartConfig] -> ShowS # | |||||
| Eq ChartConfig Source # | |||||
Defined in DotParse.Types | |||||
| type Rep ChartConfig Source # | |||||
Defined in DotParse.Types type Rep ChartConfig = D1 ('MetaData "ChartConfig" "DotParse.Types" "dotparse-0.1.3.0-IDgixl6IbIRGmpQU5Pfi1E" 'False) (C1 ('MetaCons "ChartConfig" 'PrefixI 'True) (((S1 ('MetaSel ('Just "chartHeight") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Double) :*: S1 ('MetaSel ('Just "chartScale") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Double)) :*: (S1 ('MetaSel ('Just "edgeSize") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Double) :*: (S1 ('MetaSel ('Just "nodeBorderSize") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Double) :*: S1 ('MetaSel ('Just "chartColor") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Colour)))) :*: ((S1 ('MetaSel ('Just "chartBackgroundColor") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Colour) :*: (S1 ('MetaSel ('Just "backupNodeHeight") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Double) :*: S1 ('MetaSel ('Just "backupNodeWidth") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Double))) :*: (S1 ('MetaSel ('Just "chartVshift") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Double) :*: (S1 ('MetaSel ('Just "textSize") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Double) :*: S1 ('MetaSel ('Just "escapeText") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 EscapeText)))))) | |||||
defaultChartConfig :: ChartConfig Source #
default parameters
toStatements :: Directed -> Graph ByteString -> [Statement] Source #
create Statements from a (no edge label) algebraic graph
toDotGraph :: Graph ByteString -> Graph Source #
Convert an algebraic graph to a dotparse graph, starting with the defaultGraph.
toDotGraphWith :: Directed -> Graph -> Graph ByteString -> Graph Source #
Convert an algebraic graph to a dotparse graph.