[cl-graph-devel] Graph failed to render
Gary King
gwking at metabang.com
Mon Mar 6 17:43:26 UTC 2006
Hi Joel,
How are you generating the DOT file? If you use the dot-attributes
stuff (found in graphviz-support.lisp), then the output is OK for
integer weights and an error is generated for non-integer weights.
> ;; gotta fix this mixin disease
> (defclass foolish-directed-edge
> (dot-edge-mixin
> directed-edge-mixin
> weighted-edge-mixin
> graph-container-edge)
> ())
>
> (let ((g (make-container 'dot-graph
> :directed-edge-class 'foolish-directed-edge
> :default-edge-type :directed)))
> (add-edge-between-vertexes g :a :b :weight 10 :dot-attributes
> '(:weight 10))
> (graph->dot g t))
>
> digraph G {
> graph [];
1 [];
0 [];
0->1 [weight=10];
}
#<DOT-GRAPH 2 #x7584BD6>
?
On the other hand, this is kludgy because the weight of the edge must
be specified twice (once for the slot, once for the dot-attribute
(ugh!).
Since GraphViz's restriction on weights is artificial, I think that
the right way of handling this is to expose enough machinery so that
the person creating the DOT file can specify how to translate a
weight into an integer and to arrange things so that the dot-
attribute classes use the edge weight from weighted-edge (if it is
there) instead of overriding it.
Does that make sense?
On Mar 6, 2006, at 12:23 PM, Joel Reymont wrote:
> Thank you Gary! Please let me know when I can download the patches.
>
> On Mar 6, 2006, at 5:04 PM, Gary King wrote:
>
>> Hi Joel,
>>
>> There first problem was that GraphViz didn't like the Lisp double
>> float notation (e.g., 1.0d0). Removing all of those leads to the
>> second problem: GraphViz wants all of the weights to be integers.
>
> --
> http://wagerlabs.com/
>
>
>
>
>
--
Gary Warren King
metabang.com
http://www.metabang.com/
More information about the cl-graph-devel
mailing list