Page 169 Table of Contents Index Page 171
Chapters
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30
A, B, C, D, E



CHAPTER 18. GRAPH FORMATTING




Figure 18.1: Example of graph formatting.


18.1 Graph Formatting Functions

=> format-graph-from-roots root-objects object-printer inferior-producer &key stream orienta-
tion cutoff-depth merge-duplicates duplicate-key duplicate-test generation-separation within-generation-
separation center-nodes arc-drawer arc-drawing-options graph-type (move-cursor
t) [Function]
Draws a graph whose roots are specified by the sequence root-objects. The nodes of the graph
are displayed by calling the function object-printer, which takes two arguments, the node to
display and a stream. inferior-producer is a function of one argument that is called on each
node to produce a sequence of inferiors (or nil if there are none). Both object-printer and
inferior-producer have dynamic extent.

The output from graph formatting takes place in a normalized +y-downward coordinate system.
The graph is placed so that the upper left corner of its bounding rectangle is at the current text
cursor position of stream. If the boolean move-cursor is true (the default), then the text cursor
will be moved so that it immediately follows the lower right corner of the graph.

The returned value is the output record corresponding to the graph.

stream is an output recording stream to which output will be done. It defaults to *standard-
output*
.

orientation may be either :horizontal (the default) or :vertical. It specifies which way the
graph is oriented. CLIM implementations are permitted to extend the values of orientation, for
example, adding :right or :left to distinguish between left-to-right or right-to-left layouts.

cutoff-depth specifies the maximum depth of the graph. It defaults to nil, meaning that there is
no cutoff depth. Otherwise it must be an integer, meaning that no nodes deeper than cutoff-depth
will be formatted or displayed.

If the boolean merge-duplicates is true, then duplicate objects in the graph will share the same
node in the display of the graph. That is, when merge-duplicates is true, the resulting graph
will be a tree. If merge-duplicates is false (the default), then duplicate objects will be displayed
in separate nodes. duplicate-key is a function of one argument that is used to extract the node


Page 169 Table of Contents Index Page 171
Chapters
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30
A, B, C, D, E