This renderer exploits graphviz to render graphs from Prolog data. It takes two representations. The first is a straightforward term Program(String), e.g.,
dot("digraph G {Hello->World}")
The second takes a Prolog term as input. The dot language is represented as follows:
Graph := graph(Statements) | graph(Options, Statements) | digraph(Statements) | digraph(Options, Statements) Options := ID | [ID] | [strict, ID] Statements := List of statements Statement := NodeStm | EdgeStm | AttrStm | Name = Value | SubGraph NodeStm := NodeID | node(NodeID, AttrList) NodeID := ID | ID:Port | ID:Port:CompassPT CompassPT := n | ne | e | se | s | sw | w | nw | c | _ EdgeStm := (NodeID|SubGraph) (EdgeOp (NodeID|SubGraph))+ EdgeStm | edge(NodeID|SubGraph) (EdgeOp (NodeID|SubGraph))+), AttrList) EdgeOp := - | -> AttrStm := graph(AttrList) | node(AttrList) | edge(AttrList) AttrList := List of attributes Attribute := Name = Value | Name(Value) SubGraph := subgraph(ID, Statements)
inline
(default) or object
, rendering the SVG using
an HTML <object> element.