[mcclim-devel] Drawing graphs & scaling
Hello, I would like to be able to scale a graph: (defmethod plot ((object tree) stream) (with-scaling (stream 0.7) (draw-graph (list (root-node object)) #'draw-node-colors :stream stream))) where draw-graph is directly inspired from an example in allegro CLIM manual: (defun draw-graph (root-nodes draw-node-function &rest keys) (apply #'format-graph-from-roots root-nodes #'(lambda (node s) (multiple-value-bind () (with-output-as-presentation (s node 'node) (funcall draw-node-function node s)))) #'(lambda (n) (if (visible-p n) (children n))) keys)) and draw-node-colors draws a node using draw-rectangle*. The problem is that when the scaling factor is not 1 the nodes are not correctly placed (although they are correctly scaled) with respect to arcs. Any ideas ? Thanks. Thibault
Thibault Langlois <tl@di.fc.ul.pt> writes:
I would like to be able to scale a graph: [...] The problem is that when the scaling factor is not 1 the nodes are not correctly placed (although they are correctly scaled) with respect to arcs.
I run across this limitation some time ago: Scaled class graphs with McCLIM's listener http://www.paoloamoroso.it/log/040819.html and ended up not drawing the nodes. Paolo -- Lisp Propulsion Laboratory log - http://www.paoloamoroso.it/log
Paolo Amoroso <amoroso <at> mclink.it> writes:
I run across this limitation some time ago:
Scaled class graphs with McCLIM's listener http://www.paoloamoroso.it/log/040819.html
and ended up not drawing the nodes.
Paolo
I check regularly your blog but I missed this one ... *Maybe* the problem occurs because different transformations are used for drawing nodes and arcs. Then scaling changes distances in a different way for nodes and arcs. Thibault
Thibault Langlois <tl@di.fc.ul.pt> writes:
*Maybe* the problem occurs because different transformations are used for drawing nodes and arcs. Then scaling changes distances in a different way for nodes and arcs.
I'm not sure whether text scaling is supported. Paolo -- Lisp Propulsion Laboratory log - http://www.paoloamoroso.it/log
This should be fixed. Let me know if you have any further problems. On 3/22/05, Thibault Langlois <tl@di.fc.ul.pt> wrote:
Hello,
I would like to be able to scale a graph:
(defmethod plot ((object tree) stream) (with-scaling (stream 0.7) (draw-graph (list (root-node object)) #'draw-node-colors :stream stream)))
where draw-graph is directly inspired from an example in allegro CLIM manual:
(defun draw-graph (root-nodes draw-node-function &rest keys) (apply #'format-graph-from-roots root-nodes #'(lambda (node s) (multiple-value-bind () (with-output-as-presentation (s node 'node) (funcall draw-node-function node s)))) #'(lambda (n) (if (visible-p n) (children n))) keys)) and draw-node-colors draws a node using draw-rectangle*.
The problem is that when the scaling factor is not 1 the nodes are not correctly placed (although they are correctly scaled) with respect to arcs.
Any ideas ?
Thanks.
Thibault
_______________________________________________ mcclim-devel mailing list mcclim-devel@common-lisp.net http://common-lisp.net/cgi-bin/mailman/listinfo/mcclim-devel
Andy Hefner <ahefner@gmail.com> writes:
This should be fixed. Let me know if you have any further problems.
On 3/22/05, Thibault Langlois <tl@di.fc.ul.pt> wrote: [...]
The problem is that when the scaling factor is not 1 the nodes are not correctly placed (although they are correctly scaled) with respect to arcs.
This is fixed, and it is *way* cool... Paolo -- Lisp Propulsion Laboratory log - http://www.paoloamoroso.it/log
On Wed, 2005-04-20 at 23:38 -0400, Andy Hefner wrote:
This should be fixed. Let me know if you have any further problems.
It is fixed ! Thanks a lot. Here is a screenshot: http://www.di.fc.ul.pt/~tl/clim-scaled-graphs.png Thibault
On 3/22/05, Thibault Langlois <tl@di.fc.ul.pt > wrote:
Hello,
I would like to be able to scale a graph:
(defmethod plot ((object tree) stream) (with-scaling (stream 0.7) (draw-graph (list (root-node object)) #'draw-node-colors :stream stream)))
where draw-graph is directly inspired from an example in allegro CLIM manual:
(defun draw-graph (root-nodes draw-node-function &rest keys) (apply #'format-graph-from-roots root-nodes #'(lambda (node s) (multiple-value-bind () (with-output-as-presentation (s node 'node) (funcall draw-node-function node s)))) #'(lambda (n) (if (visible-p n) (children n))) keys)) and draw-node-colors draws a node using draw-rectangle*.
The problem is that when the scaling factor is not 1 the nodes are not correctly placed (although they are correctly scaled) with respect to arcs.
Any ideas ?
Thanks.
Thibault
_______________________________________________ mcclim-devel mailing list mcclim-devel@common-lisp.net http://common-lisp.net/cgi-bin/mailman/listinfo/mcclim-devel
-- Thibault Langlois FCUL / DI tl@di.fc.ul.pt
participants (3)
-
Andy Hefner
-
Paolo Amoroso
-
Thibault Langlois