You are looking at historical revision 29454 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 title) → unspecified

Write a dot preamble.

width
Width in pixels
height
Height in pixels
font-size
Font-size in pt
title
Title of the graph
(define write-dot-preamble
  (case-lambda
    (()
     (write-dot-preamble
       (default-width)
       (default-height)
       (default-font-size)
       (default-title)))
    ((width height font-size title)
     (display "digraph G {")
     (display "node [style=filled, fontname=monospace, shape=circle];")
     (display "edge [fontname=monospace, dir=none];")
     (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) → unspecified

Write the dot postscript

(define (write-dot-postscript) (display "}"))

write-node

[procedure] (write-node label x y color) → unspecified

Write a node

label
The node's label
x
The x-coordinate of the node
y
The y-coordinate of the node
(define (write-node label x y color)
  (format
    #t
    "~a [pos=\"~a,~a\", color=~a];"
    label
    (* x (linear-scale))
    (* y (linear-scale))
    color))

write-edge

[procedure] (write-edge whence whither) → unspecified

Write an edge

whence
The label whence
whither
The lable whither
(define (write-edge whence whither) (format #t "~a -> ~a;" whence whither))

About this egg

Author

Peter Danenberg

Colophon

Documented by cock.