FDG v0.0.4 FDG.Parsers.Graphviz
Parses FDG AST into Graphviz (.dot) syntax, and allows for exporting to Various image formats using Graphviz.
Examples
iex> FDG.Parsers.Graphviz.to_dot([{:node, [label: "A", children: []]}])
"digraph G { a [label=\"A\"]; }"
Summary
Functions
Turns FDG ast
tuples into a dot-syntax string, ready to
be parsed into a graph using Graphviz
Turns dot syntax into something else using Graphviz. The format
attribute can accept anything that Graphviz can. A non-exhausted
list being
Turns FDG dot_syntax
string into a PNG digraph, using Graphviz's
dot
command. Returns the filename of the output file output_filename
Turns FDG dot_syntax
string into an SVG digraph, using Graphviz's
dot
command. Returns the filename of the output file output_filename
Functions
Specs
to_dot([FDG.Parser.node_tuple]) :: String.t
Turns FDG ast
tuples into a dot-syntax string, ready to
be parsed into a graph using Graphviz.
Examples
iex> FDG.Parsers.Graphviz.to_dot([{:node, [label: "A", children: []]}])
"digraph G { a [label=\"A\"]; }"
Turns dot syntax into something else using Graphviz. The format
attribute can accept anything that Graphviz can. A non-exhausted
list being:
ps
(PostScript)svg
andsvgz
(Structured Vector Graphics)fig
(XFIG Graphics)png
andgif
(Bitmap Graphics)imap
andcmapx
Examples
iex> FDG.Parsers.Graphviz.to_dot([{:node, [label: "A", children: []]}])
...> |> FDG.Parsers.Graphviz.to_graphviz("ps", "graph")
{:ok, "graph.ps"}
Turns FDG dot_syntax
string into a PNG digraph, using Graphviz's
dot
command. Returns the filename of the output file output_filename
.
Examples
iex> FDG.Parsers.Graphviz.to_dot([{:node, [label: "A", children: []]}])
...> |> FDG.Parsers.Graphviz.to_png("graph")
{:ok, "graph.png"}
Turns FDG dot_syntax
string into an SVG digraph, using Graphviz's
dot
command. Returns the filename of the output file output_filename
.
Examples
iex> FDG.Parsers.Graphviz.to_dot([{:node, [label: "A", children: []]}])
...> |> FDG.Parsers.Graphviz.to_svg("graph")
{:ok, "graph.svg"}