changelog shortlog graph tags branches changeset file revisions annotate raw help

Mercurial > org > notes / 20231124.org

revision 15: 45ac54093c09
parent 14: a04ca5a66178
child 16: a63dfd1affed
     1.1--- a/20231124.org	Tue Aug 27 21:35:44 2024 -0400
     1.2+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.3@@ -1,36 +0,0 @@
     1.4-* cl-dot examples
     1.5-:PROPERTIES:
     1.6-:ID:       c5f4f25c-071b-4a2d-85bc-08676eacce5d
     1.7-:END:
     1.8-#+begin_src lisp
     1.9-(defmethod cl-dot:graph-object-node ((graph (eql 'example)) (object cons))
    1.10-  (make-instance 'cl-dot:node
    1.11-                 :attributes '(:label "cell \\N"
    1.12-                               :shape :box)))
    1.13-(defmethod cl-dot:graph-object-points-to ((graph (eql 'example)) (object cons))
    1.14-  (list (car object)
    1.15-        (make-instance 'cl-dot:attributed
    1.16-                       :object (cdr object)
    1.17-                       :attributes '(:weight 3))))
    1.18-;; Symbols
    1.19-(defmethod cl-dot:graph-object-node ((graph (eql 'example)) (object symbol))
    1.20-  (make-instance 'cl-dot:node
    1.21-                 :attributes `(:label ,object
    1.22-                               :shape :hexagon
    1.23-                               :style :filled
    1.24-                               :color :black
    1.25-                               :fillcolor "#ccccff")))
    1.26-(let* ((data '(a b c #1=(b z) c d #1#))
    1.27-       (dgraph (cl-dot:generate-graph-from-roots 'example (list data)
    1.28-                                                 '(:rankdir "LR" :layout "twopi" :labelloc "t"))))
    1.29-  (cl-dot:dot-graph dgraph "test-lr.svg" :format #+nil :x11 :svg))
    1.30-#+end_src
    1.31-
    1.32-#+RESULTS:
    1.33-
    1.34-#+begin_src lisp
    1.35-(let* ((data '(a b))
    1.36-       (dgraph (cl-dot:generate-graph-from-roots 'example (list data)
    1.37-                                                 '(:rankdir "LR"))))
    1.38-          (cl-dot:print-graph dgraph))
    1.39-#+end_src