You are looking at historical revision 29580 of this page. It may differ significantly from its current revision.
graphviz
Some Graphviz abstractions
default-width
[parameter] default-width → 1600(define default-width (make-parameter 1600))
write-dot-preamble
[procedure] (write-dot-preamble) → unspecified[procedure] (write-dot-preamble width height font-size) → unspecified
Write a dot preamble.
- width
- Width in pixels
- height
- Height in pixels
- font-size
- Font-size in pt
(define write-dot-preamble
(case-lambda
(()
(write-dot-preamble (default-width) (default-height) (default-font-size)))
((width height font-size)
(display "digraph G {")
(unless
(null? (default-graph-attributes))
(format
#t
"graph [~a];"
(attributes->string (default-graph-attributes))))
(unless
(null? (default-node-attributes))
(format #t "node [~a];" (attributes->string (default-node-attributes))))
(unless
(null? (default-edge-attributes))
(format #t "edge [~a];" (attributes->string (default-edge-attributes))))
(if (and width height)
(begin
(format #t "graph [fontsize=~a, ratio=fill];" font-size)
(let ((width-in-inches (px->in width))
(height-in-inches (px->in height)))
(format
#t
"graph [viewport=\"~a,~a\", size=\"~a,~a!\"];"
(in->dot width-in-inches)
(in->dot height-in-inches)
width-in-inches
height-in-inches)))))))
write-dot-postscript
[procedure] (write-dot-postscript) → unspecifiedWrite the dot postscript
(define (write-dot-postscript) (display "}"))
write-node
[procedure] (write-node label) → unspecified[procedure] (write-node label attributes) → unspecified
Write a node
- label
- The node's label
- attributes
- Other attributes of the node
(define write-node
(case-lambda
((label) (write-node label '()))
((label attributes)
(format #t "~a [~a];" label (attributes->string attributes)))))
write-edge
[procedure] (write-edge whence whither) → unspecified[procedure] (write-edge whence whither attributes) → unspecified
Write an edge
- whence
- The label whence
- whither
- The lable whither
- attributes
- Other attributes of the edge
(define write-edge
(case-lambda
((whence whither) (write-edge whence whither '()))
((whence whither attributes)
(format
#t
"~a -> ~a [~a];"
whence
whither
(attributes->string attributes)))))
About this egg
Author
Colophon
Documented by cock.