4 -- For simple formatted printing
6 local function printf(fmt
, ...)
7 print(string.format(fmt
, ...))
11 -- Get a local reference for frequently used functions (optional)
13 local node
, edge
, subgraph
, cluster
, digraph
, strictdigraph
=
14 gr
.node
, gr
.edge
, gr
.subgraph
, gr
.cluster
, gr
.digraph
, gr
.strictdigraph
19 local g
= digraph
{"G",
21 edge
{"a0", "a1", "a2", "a3"}
24 edge
{"b0", "b1", "b2", "b3"}
33 -- Same graph in dot notation
37 subgraph cluster_c0 {a0 -> a1 -> a2 -> a3;}
38 subgraph cluster_c1 {b0 -> b1 -> b2 -> b3;}
46 -- Print graph as dotfile
47 printf("1. Generated 'dot' format:")
49 printf("2. Source in 'dot' format:\n %s\n", dotsource
)