Did you know ... Search Documentation:
Pack callgraph -- prolog/library/dot.pl
PublicShow source

Produces .dot language graphs from relational and functional schemata.

Graph strucure is as follows:

digraph  ---> digraph(Name:term, G:list(element)).
subgraph ---> subgraph(Name:term, G:list(element)).
element  ---> subgraph
            ; option
            ; node_opts(list(option))
            ; edge_opts(list(option))
            ; with_opts(element, list(option))
            ; arrow(term,term)   % directed edge
            ; line(term,term)    % undirected edge
            ; node(term).
option   ---> opt_name=opt_value.
opt_name  == atom
opt_value == phrase

Graph, node and edge labels can be terms and are written using write/1 for writing in the dot file.


Samer Abdallah Centre for Digital Music, Queen Mary, University of London, 2007 Department of Computer Science, UCL, 2014

 dotrun(+Method:graphviz_method, +Fmt:atom, G:digraph, +File:atom) is det
Method determines which GraphViz programs are used to render the graph:
graphviz_method ---> dot ; neato; fdp ; sfdp ; circo ; twopi
                   ; unflatten
                   ; unflatten(list(unflatten_opt)).
unflatten_opt   ---> l(N:natural)   % -l<N>
                   ; fl(N:natural)  % -f -l<N>
                   ; c(natural).    % -c<N>

The unflatten method attempts to alleviate the problem of very wide graphs, and implies that dot is used to render the graph. The default option list is empty.

Fmt can be any format supported by Graphviz under the -T option, including ps, eps, pdf, svg, png.

See man page for unflatten for more information. TODO: Could add more options for dot.

 graph_dot(+G:digraph, +File:atom) is det