cleaned code
This commit is contained in:
parent
ef5131928c
commit
0097800eba
@ -1,17 +1,12 @@
|
||||
(define (declare-node node-text node-generation)
|
||||
(string-append ;; "node"
|
||||
(number->string node-generation)
|
||||
(string-append (number->string node-generation)
|
||||
"[label=\""
|
||||
node-text
|
||||
"\"];\n"))
|
||||
"\"];"))
|
||||
|
||||
(define (make-link previous-node current-node)
|
||||
(string-append ;; "node"
|
||||
(number->string previous-node)
|
||||
" -- "
|
||||
;; "node"
|
||||
(number->string current-node)
|
||||
";\n"))
|
||||
(string-append (number->string previous-node) " -- "
|
||||
(number->string current-node) ";"))
|
||||
|
||||
(define (tree-to-dot-helper tree current-generation previous-generation)
|
||||
;; Helper to ~tree-to-dot~ that translates a Scheme tree with any number of
|
||||
@ -42,7 +37,7 @@
|
||||
;; Returns a graphviz’s dot-compatible string representing a Scheme tree
|
||||
(if (null? tree) ""
|
||||
(string-append
|
||||
"graph{node[shape=plaintext];graph[bgcolor=\"transparent\"];\n"
|
||||
"graph{node[shape=plaintext];graph[bgcolor=\"transparent\"];"
|
||||
(declare-node (car tree) 0)
|
||||
(tree-to-dot-helper (cdr tree) 1 0)
|
||||
"}")))
|
||||
|
Reference in New Issue
Block a user