Paolo Amoroso's weblog. Main interests: Lisp, astronomy (Moon), space exploration (Apollo and early manned programs) | Calendar of past entries | Related links |
![]() |
Scaled class graphs with McCLIM's listener |
|
I have always liked those cool, AI-ish looking graphs often seen in screen shots of Lisp Machines software. See for example this NoteCards screen at Rainer Joswig's site, particularly the thumbnail view at the left. So, I have hacked the CLIM Listener that comes with McCLIM to also draw similar scaled class hierarchy graphs.
This patch
against the current revision of
Apps/Listener/dev-commands.lisp
in the source tree
implements the functionality. It adds keyword arguments :Scale
X
and :Scale Y
to the listener's Show Class
Subclasses
and Show Class Superclasses
commands.
The modified syntax looks like this (user input emphasized):
Show Class Subclasses (class) class-name (keywords):Scale X (scale x[1]) x-scale-factor :Scale Y (scale y[1]) y-scale-factor
Below are screen shots of scaled graphs. The first shows the
subclasses of clim:gadget
, first at full size and then
reduced. The second is my favorite McCLIM stress test and generates a
monster graph at full size: it shows the subclasses of t
,
i.e. the whole class hierarchy (it may take a while on a slow
machine). This shot only shows the reduced version.
![]() |
Graph of
subclasses of |
![]() |
Graph of
subclasses of |
The patch adds scale parameters to
clim-listener::class-grapher
, and wraps the call to
clim:format-graph-from-roots
within a scaling
transformation with appropriate arguments. Since McCLIM does
not scale text, when the scale is reduced (i.e. x or y scale factor <
1), I pass a dummy function to
clim:format-graph-from-roots
that doesn't draw the node
-- it would look tiny anyway. The patch also adds keyword arguments to
the Show Class Superclasses
and Show Class
Subclasses
listener commands, and passes the arguments to
clim-listener::class-grapher
.
Note that this is just a quick hack with some limitations:
Copyright © 2004 by Paolo Amoroso
amoroso@mclink.it
Created with BlogMax |
|
About Lisp | Practical Common Lisp (learn Lisp) | Planet Lisp (blog agregator) | Common Lisp Directory (software and resources) | Why Lisp? |