changelog shortlog graph tags branches changeset files revisions annotate raw help

Mercurial > org > notes / 20231124.org

changeset 2: 04e86b94ef1a
parent: 87b04952fb18
child: 812feca5a874
author: Richard Westhaver <ellis@rwest.io>
date: Thu, 06 Jun 2024 23:16:37 -0400
permissions: -rw-r--r--
description: style update
1 #+setupfile: ../clean.theme
2 * cl-dot examples
3 #+begin_src lisp
4 (defmethod cl-dot:graph-object-node ((graph (eql 'example)) (object cons))
5  (make-instance 'cl-dot:node
6  :attributes '(:label "cell \\N"
7  :shape :box)))
8 (defmethod cl-dot:graph-object-points-to ((graph (eql 'example)) (object cons))
9  (list (car object)
10  (make-instance 'cl-dot:attributed
11  :object (cdr object)
12  :attributes '(:weight 3))))
13 ;; Symbols
14 (defmethod cl-dot:graph-object-node ((graph (eql 'example)) (object symbol))
15  (make-instance 'cl-dot:node
16  :attributes `(:label ,object
17  :shape :hexagon
18  :style :filled
19  :color :black
20  :fillcolor "#ccccff")))
21 (let* ((data '(a b c #1=(b z) c d #1#))
22  (dgraph (cl-dot:generate-graph-from-roots 'example (list data)
23  '(:rankdir "LR" :layout "twopi" :labelloc "t"))))
24  (cl-dot:dot-graph dgraph "test-lr.svg" :format #+nil :x11 :svg))
25 #+end_src
26 
27 #+RESULTS:
28 
29 #+begin_src lisp
30 (let* ((data '(a b))
31  (dgraph (cl-dot:generate-graph-from-roots 'example (list data)
32  '(:rankdir "LR"))))
33  (cl-dot:print-graph dgraph))
34 #+end_src