1gv(3guile) gv(3guile)
2
3
4
6 gv_guile - graph manipulation in guile
7
8
10 (load-extension "./libgv.so" "SWIG_init")
11
12
15 gv_guile is a dynamically loaded extension for guile that provides ac‐
16 cess to the graph facilities of graphviz.
17
18
20 New graphs
21
22 New empty graph
23 graph_handle gv.graph (name);
24 graph_handle gv.digraph (name);
25 graph_handle gv.strictgraph (name);
26 graph_handle gv.strictdigraph (name);
27
28 New graph from a dot-syntax string or file
29 graph_handle gv.readstring (string);
30 graph_handle gv.read (string filename);
31 graph_handle gv.read (channel);
32
33 Add new subgraph to existing graph
34 graph_handle gv.graph (graph_handle, name);
35
36 New nodes
37
38 Add new node to existing graph
39 node_handle gv.node (graph_handle, name);
40
41 New edges
42
43 Add new edge between existing nodes
44 edge_handle gv.edge (tail_node_handle, head_node_handle);
45
46 Add a new edge between an existing tail node, and a named head node
47 which will be induced in the graph if it doesn't already exist
48 edge_handle gv.edge (tail_node_handle, head_name);
49
50 Add a new edge between an existing head node, and a named tail node
51 which will be induced in the graph if it doesn't already exist
52 edge_handle gv.edge (tail_name, head_node_handle);
53
54 Add a new edge between named tail and head nodes which will be induced
55 in the graph if they don't already exist
56 edge_handle gv.edge (graph_handle, tail_name, head_name);
57
58 Setting attribute values
59
60 Set value of named attribute of graph/node/edge - creating attribute if
61 necessary
62 string gv.setv (graph_handle, attr_name, attr_value);
63 string gv.setv (node_handle, attr_name, attr_value);
64 string gv.setv (edge_handle, attr_name, attr_value);
65
66 Set value of existing attribute of graph/node/edge (using attribute
67 handle)
68 string gv.setv (graph_handle, attr_handle, attr_value);
69 string gv.setv (node_handle, attr_handle, attr_value);
70 string gv.setv (edge_handle, attr_handle, attr_value);
71
72 Getting attribute values
73
74 Get value of named attribute of graph/node/edge
75 string gv.getv (graph_handle, attr_name);
76 string gv.getv (node_handle, attr_name);
77 string gv.getv (edge_handle, attr_name);
78
79 Get value of attribute of graph/node/edge (using attribute handle)
80 string gv.getv (graph_handle, attr_handle);
81 string gv.getv (node_handle, attr_handle);
82 string gv.getv (edge_handle, attr_handle);
83
84 Obtain names from handles
85 string gv.nameof (graph_handle);
86 string gv.nameof (node_handle);
87 string gv.nameof (attr_handle);
88
89 Find handles from names
90 graph_handle gv.findsubg (graph_handle, name);
91 node_handle gv.findnode (graph_handle, name);
92 edge_handle gv.findedge (tail_node_handle, head_node_handle);
93 attribute_handle gv.findattr (graph_handle, name);
94 attribute_handle gv.findattr (node_handle, name);
95 attribute_handle gv.findattr (edge_handle, name);
96
97 Misc graph navigators returning handles
98 node_handle gv.headof (edge_handle);
99 node_handle gv.tailof (edge_handle);
100 graph_handle gv.graphof (graph_handle);
101 graph_handle gv.graphof (edge_handle);
102 graph_handle gv.graphof (node_handle);
103 graph_handle gv.rootof (graph_handle);
104
105 Obtain handles of proto node/edge for setting default attribute values
106 node_handle gv.protonode (graph_handle);
107 edge_handle gv.protoedge (graph_handle);
108
109 Iterators
110
111 Iteration termination tests
112 bool gv.ok (graph_handle);
113 bool gv.ok (node_handle);
114 bool gv.ok (edge_handle);
115 bool gv.ok (attr_handle);
116
117 Iterate over subgraphs of a graph
118 graph_handle gv.firstsubg (graph_handle);
119 graph_handle gv.nextsubg (graph_handle, subgraph_handle);
120
121 Iterate over supergraphs of a graph (obscure and rarely useful)
122 graph_handle gv.firstsupg (graph_handle);
123 graph_handle gv.nextsupg (graph_handle, subgraph_handle);
124
125 Iterate over edges of a graph
126 edge_handle gv.firstedge (graph_handle);
127 edge_handle gv.nextedge (graph_handle, edge_handle);
128
129 Iterate over outedges of a graph
130 edge_handle gv.firstout (graph_handle);
131 edge_handle gv.nextout (graph_handle, edge_handle);
132
133 Iterate over edges of a node
134 edge_handle gv.firstedge (node_handle);
135 edge_handle gv.nextedge (node_handle, edge_handle);
136
137 Iterate over out-edges of a node
138 edge_handle gv.firstout (node_handle);
139 edge_handle gv.nextout (node_handle, edge_handle);
140
141 Iterate over head nodes reachable from out-edges of a node
142 node_handle gv.firsthead (node_handle);
143 node_handle gv.nexthead (node_handle, head_node_handle);
144
145 Iterate over in-edges of a graph
146 edge_handle gv.firstin (graph_handle);
147 edge_handle gv.nextin (node_handle, edge_handle);
148
149 Iterate over in-edges of a node
150 edge_handle gv.firstin (node_handle);
151 edge_handle gv.nextin (graph_handle, edge_handle);
152
153 Iterate over tail nodes reachable from in-edges of a node
154 node_handle gv.firsttail (node_handle);
155 node_handle gv.nexttail (node_handle, tail_node_handle);
156
157 Iterate over nodes of a graph
158 node_handle gv.firstnode (graph_handle);
159 node_handle gv.nextnode (graph_handle, node_handle);
160
161 Iterate over nodes of an edge
162 node_handle gv.firstnode (edge_handle);
163 node_handle gv.nextnode (edge_handle, node_handle);
164
165 Iterate over attributes of a graph
166 attribute_handle gv.firstattr (graph_handle);
167 attribute_handle gv.nextattr (graph_handle, attr_handle);
168
169 Iterate over attributes of an edge
170 attribute_handle gv.firstattr (edge_handle);
171 attribute_handle gv.nextattr (edge_handle, attr_handle);
172
173 Iterate over attributes of a node
174 attribute_handle gv.firstattr (node_handle);
175 attribute_handle gv.nextattr (node_handle, attr_handle);
176
177 Remove graph objects
178 bool gv.rm (graph_handle);
179 bool gv.rm (node_handle);
180 bool gv.rm (edge_handle);
181
182 Layout
183
184 Annotate a graph with layout attributes and values using a specific
185 layout engine
186 bool gv.layout (graph_handle, string engine);
187
188 Render
189
190 Render a layout into attributes of the graph
191 bool gv.render (graph_handle);
192
193 Render a layout to stdout
194 bool gv.render (graph_handle, string format);
195
196 Render to an open file
197 bool gv.render (graph_handle, string format, channel fout);
198
199 Render a layout to an unopened file by name
200 bool gv.render (graph_handle, string format, string filename);
201
202 Render to a string result
203 string gv.renderresult (graph_handle ing, string format);
204 gv.renderresult (graph_handle, string format, string outdata);
205
206 Render to an open channel
207 bool gv.renderchannel (graph_handle, string format, string chan‐
208 nelname);
209
210 Render a layout to a malloc'ed string, to be free'd by the caller
211
212 (deprecated - too easy to leak memory)
213
214 (still needed for "eval [gv::renderdata $G tk]" )
215 string gv.renderdata (graph_handle, string format);
216
217 Writing graph back to file
218 bool gv.write (graph_handle, string filename);
219 bool gv.write (graph_handle, channel);
220
221 Graph transformation tools
222 bool gv.tred (graph_handle);
223
224
226 graph, dot, neato, fdp, circo, twopi, guile.
227
228
229
230
231 26 May 2021 gv(3guile)