changelog shortlog graph tags branches changeset files revisions annotate raw help

Mercurial > org > notes / 20231124.org

changeset 10: 8aa1ba03bc89
parent: 4839b0675118
author: Richard Westhaver <ellis@rwest.io>
date: Wed, 14 Aug 2024 22:19:38 -0400
permissions: -rw-r--r--
description: midweek updates
1 * cl-dot examples
2 :PROPERTIES:
3 :ID: c5f4f25c-071b-4a2d-85bc-08676eacce5d
4 :END:
5 #+begin_src lisp
6 (defmethod cl-dot:graph-object-node ((graph (eql 'example)) (object cons))
7  (make-instance 'cl-dot:node
8  :attributes '(:label "cell \\N"
9  :shape :box)))
10 (defmethod cl-dot:graph-object-points-to ((graph (eql 'example)) (object cons))
11  (list (car object)
12  (make-instance 'cl-dot:attributed
13  :object (cdr object)
14  :attributes '(:weight 3))))
15 ;; Symbols
16 (defmethod cl-dot:graph-object-node ((graph (eql 'example)) (object symbol))
17  (make-instance 'cl-dot:node
18  :attributes `(:label ,object
19  :shape :hexagon
20  :style :filled
21  :color :black
22  :fillcolor "#ccccff")))
23 (let* ((data '(a b c #1=(b z) c d #1#))
24  (dgraph (cl-dot:generate-graph-from-roots 'example (list data)
25  '(:rankdir "LR" :layout "twopi" :labelloc "t"))))
26  (cl-dot:dot-graph dgraph "test-lr.svg" :format #+nil :x11 :svg))
27 #+end_src
28 
29 #+RESULTS:
30 
31 #+begin_src lisp
32 (let* ((data '(a b))
33  (dgraph (cl-dot:generate-graph-from-roots 'example (list data)
34  '(:rankdir "LR"))))
35  (cl-dot:print-graph dgraph))
36 #+end_src