digraph.pl 607 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
:- module(
  digraph,
  [
    digraph/1
  ]
).

:- use_module('../graphviz').

digraph(TargetFilename) :-
  agopen('test', directed, Graph),
  agattr(Graph, graph, size, '7.5,11', _),
  agattr(Graph, graph, ratio, fill, _),
  agnode(Graph, 'a', true, NodeA),
  agnode(Graph, 'b', true, NodeB),
  agnode(Graph, 'reaction_0', true, Reaction_0),
  agedge(Graph, NodeA, Reaction_0, 'a -> reaction_0', true, _Edge0),
  agedge(Graph, Reaction_0, NodeB, 'reaction_0 -> b', true, _Edge1),
  agattr(Graph, node, shape, circle, _),
  agset(Reaction_0, shape, box),
  agwrite(Graph, TargetFilename),
  agclose(Graph).