Running script, graph put in requested file location

This commit is contained in:
Dane Johnson 2024-10-11 16:41:11 -05:00
parent afa99bad4a
commit 62fa492823
3 changed files with 10 additions and 19 deletions

BIN
graph.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

View File

@ -24,24 +24,6 @@
((10 . 40) (0 2 4) ,white) ((10 . 40) (0 2 4) ,white)
((40 . 40) (1 2 3) ,white))) ((40 . 40) (1 2 3) ,white)))
(define-syntax-rule
(for x n stmt ...)
(let loop ([x 0]
[lst '()])
(if (< x n)
(loop (1+ x)
(cons lst (stmt i)))
lst)))
(define large-web
(let ([lst '()])
(do (i (1+ i))
((> i 10))
(do (j (1+ j))
((> j 10))
(set! lst (cons `((,i . ,j)
,(map ))))))))
(define (edge-painter cr graph) (define (edge-painter cr graph)
(lambda (node) (lambda (node)
(cairo-set-source cr black) (cairo-set-source cr black)
@ -84,7 +66,7 @@
surface)) surface))
(define my-surface (draw-abstract-graph more-complex-graph)) (define my-surface (draw-abstract-graph more-complex-graph))
(cairo-surface-write-to-png my-surface "graph.png") (cairo-surface-write-to-png my-surface (cadr (command-line)))
(cairo-surface-destroy my-surface) (cairo-surface-destroy my-surface)
;; Local Variables: ;; Local Variables:

9
run.sh Executable file
View File

@ -0,0 +1,9 @@
#!/usr/bin/bash
GRAPH_FILE=/tmp/graph.png
set -e
guile graphgif.scm $GRAPH_FILE
feh $GRAPH_FILE
rm $GRAPH_FILE