Skip to content

Commit

Permalink
Initial REPL experiments with SVG
Browse files Browse the repository at this point in the history
Testing out SVG code written for the ClojureBridge London that runs in
ClojureScript with Reagent.
  • Loading branch information
practicalli-johnny committed Sep 17, 2018
1 parent 356b038 commit 4d79251
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions src/status_monitor/handler.clj
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,28 @@

(def app
(wrap-defaults app-routes site-defaults))




;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; REPL experiments


;; A quick test of some SVG code to check it renders okay in the static page
;; This is a bit of code taken from ClojureBridge London workshop,
;; used with ClojureScript and Reagent. It just works in Clojure too :)

#_(defn display-cpu-load-average
"Graphical representation of CPU average load"
[cpu-load-average]
[:svg {:style {:border "1px solid"
:background "white"
:width "150px"
:height "150px"}}
[:circle {:r 50, :cx 75, :cy 75, :fill "green"}]
[:circle {:r 25, :cx 75, :cy 75, :fill "blue"}]
[:path {:stroke-width 12
:stroke "white"
:fill "none"
:d "M 30,40 C 100,40 50,110 120,110"}]])

0 comments on commit 4d79251

Please sign in to comment.