63712529f020

Add digraph.dot:*vertex-shape*
[view raw] [browse files]
author Steve Losh <steve@stevelosh.com>
date Tue, 24 Aug 2021 21:15:58 -0400
parents 4518e61a96c6
children 91b9b04d6914
branches/tags (none)
files package.dot.lisp src/dot.lisp

Changes

--- a/package.dot.lisp	Mon Apr 05 22:03:42 2021 -0400
+++ b/package.dot.lisp	Tue Aug 24 21:15:58 2021 -0400
@@ -1,3 +1,3 @@
 (defpackage :digraph.dot
   (:use :cl :digraph :digraph.quickutils)
-  (:export :draw))
+  (:export :draw :*vertex-shape*))
--- a/src/dot.lisp	Mon Apr 05 22:03:42 2021 -0400
+++ b/src/dot.lisp	Tue Aug 24 21:15:58 2021 -0400
@@ -19,11 +19,13 @@
 
 
 (defparameter *current-digraph* nil)
+(defparameter *vertex-shape* :circle
+  "The shape to use for vertex nodes.  Must be a valid cl-dot :shape node attribute.")
 
 
 (defmethod cl-dot:graph-object-node ((graph (eql 'digraph)) (vertex t))
   (make-instance 'cl-dot:node
-    :attributes `(:label ,(format nil "~A" vertex) :shape :circle)))
+    :attributes `(:label ,(format nil "~A" vertex) :shape ,*vertex-shape*)))
 
 (defmethod cl-dot:graph-object-points-to ((graph (eql 'digraph)) (vertex t))
   (successors *current-digraph* vertex))