(args (list dot
:graph-visitor
(lambda (dot-graph)
- (setf (dot-attribute :bb g)
+ (setf (dot-attribute-value :bb g)
(graphviz:graph-bounding-box dot-graph)))
:node-visitor
;; TODO search-for-vertex is sloooow, use a hashtable or
;; introduce an graph-find-element-by-id-mixin, or similar
(let ((vertex (find-vertex-by-id g (graphviz:node-name node))))
- (setf (dot-attribute :pos vertex) pos)
- (setf (dot-attribute :width vertex) width)
- (setf (dot-attribute :height vertex) height))))
+ (setf (dot-attribute-value :pos vertex) pos
+ (dot-attribute-value :width vertex) width
+ (dot-attribute-value :height vertex) height))))
:edge-visitor
(lambda (edge)
;; (graphviz:bezier-points bezier))
(dolist (el (graphviz:bezier-points bezier))
(push el bezier-points))))
- (setf (dot-attribute :pos real-edge) (nreverse bezier-points))))))))
+ (setf (dot-attribute-value :pos real-edge)
+ (nreverse bezier-points))))))))
(when algorithm-provided-p
(nconc args (list :algorithm algorithm)))
(apply 'graphviz:layout-dot-format args))
(defclass* dot-edge-mixin (dot-attributes-mixin) ()
(:export-p t))
-(defclass* dot-graph (graph-container dot-graph-mixin)
+(defclass* dot-graph (dot-graph-mixin graph-container)
()
(:default-initargs
:vertex-class 'dot-vertex
:undirected-edge-class 'dot-edge)
(:export-p t))
-(defclass* dot-vertex (graph-container-vertex dot-vertex-mixin) ()
+(defclass* dot-vertex (dot-vertex-mixin graph-container-vertex) ()
(:export-p t))
-(defclass* dot-edge (graph-container-edge dot-edge-mixin) ()
+(defclass* dot-edge (dot-edge-mixin graph-container-edge) ()
(:export-p t))
-(defclass* dot-directed-edge (directed-edge-mixin dot-edge) ()
+(defclass* dot-directed-edge (dot-edge directed-edge-mixin) ()
(:export-p t))
-(defmethod (setf dot-attribute) :before (value (attr symbol) (thing dot-attributes-mixin))
+(defmethod (setf dot-attribute-value) :before (value (attr symbol) (thing dot-attributes-mixin))
(ensure-valid-dot-attribute attr thing))
-(defmethod (setf dot-attribute) (value (attr symbol) (thing dot-attributes-mixin))
+(defmethod (setf dot-attribute-value) (value (attr symbol) (thing dot-attributes-mixin))
(setf (getf (dot-attributes thing) attr) value))
(defmethod dot-attribute-value ((attr symbol) (thing dot-attributes-mixin))
(princ el str)
(setf first nil)))
(princ "\"" str)))
- ((member spline bounding-box)
+ ((member spline)
(with-output-to-string (str)
(princ "\"" str)
(let ((first t))
(princ (second el) str)
(setf first nil)))
(princ "\"" str)))
+ ((member bounding-box)
+ (with-output-to-string (str)
+ (princ "\"" str)
+ (let ((first t))
+ (dolist (el value)
+ (unless first
+ (princ ", " str))
+ (princ (first el) str)
+ (princ "," str)
+ (princ (second el) str)
+ (setf first nil)))
+ (princ "\"" str)))
((member integer)
(unless (typep value 'integer)
(error "Invalid value for ~S: ~S is not an integer"
#:dot-vertex
#:dot-edge
#:dot-attributes
+ #:layout-graph-with-graphviz
+ #:dot-attribute-value
#:connected-graph-p
#:find-connected-components
#:target-vertex
#:source-vertex
- #:layout-graph-with-graphviz
- #:dot-attribute-value
- #:dot-attribute
-
#:add-edge ; graph edge
#:delete-edge ; graph edge