[mcclim-devel] question about curves and formatting graphs

Andy Hefner ahefner at gmail.com
Wed May 25 00:21:26 UTC 2005


On 5/19/05, rpgoldman at real-time.com <rpgoldman at real-time.com> wrote:
> 
> If one wanted to draw curvy lines in McCLIM, is there any way of doing
> this?  I had assumed, foolish me, that this could be done using Bezier
> curves, but now I see that those were an Allegro extension to the
> standard, and not part of CLIM 2.0....

Lacking any better ideas, I'd break the curves down into line segments
and draw them as such.

> Also, has anyone been thinking about the possibility of dynamic
> graphs?  I.e., graphs where one might want to enter leaves?  Or the
> possibility of having a fixed graph where a user might move the nodes
> around to make the graph more readable.  CLIM doesn't have any sort of
> "smart link" object that would support this, does it?

I don't have any thoughts on dynamic graphs, but 'adjustable' graphs
are a fine idea. I've been interested in such a thing for a while now,
but lacked any real immediate need for it. Now that someone else has
mentioned it, I've been inspired to take a little time to bash out an
implementation.

I started with Tim Moore's dragndrop example, extending the basic ide
aby implementing draggable presentations via a new
draggable-presentation and a command and translator to invoke the
dragging. Adding :record-type 'draggable-presentation in calls to
clim:present makes presentaitons draggable. This allowed me to drag
presentations within graph nodes around, but with no knowledge of the
graph edges. Clearly some work on the graph formatter is need. (this
code is attached as draggable-presentations.lisp)

To remedy this, I've attached an experimental patch which refactors
graph edge layout and incorporates the needed bookkeeping to associate
a graph node with its edges. This allowed my second attempt, also
attached, to drag graph nodes around, updating the edges correctly.

Perhaps this is of some interest.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: graph-edge-tracking.patch
Type: text/x-patch
Size: 4476 bytes
Desc: not available
URL: <https://mailman.common-lisp.net/pipermail/mcclim-devel/attachments/20050524/2428a38d/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: draggable-presentations.lisp
Type: application/octet-stream
Size: 1559 bytes
Desc: not available
URL: <https://mailman.common-lisp.net/pipermail/mcclim-devel/attachments/20050524/2428a38d/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: draggable-graph-1.lisp
Type: application/octet-stream
Size: 3364 bytes
Desc: not available
URL: <https://mailman.common-lisp.net/pipermail/mcclim-devel/attachments/20050524/2428a38d/attachment-0001.obj>


More information about the mcclim-devel mailing list