diff --git a/.gitignore b/.gitignore index 713f40a..94ac55c 100644 --- a/.gitignore +++ b/.gitignore @@ -11,3 +11,5 @@ out *.tgz *.zip +.lsp/ +.clj-kondo/ diff --git a/.lein-failures b/.lein-failures new file mode 100644 index 0000000..9e26dfe --- /dev/null +++ b/.lein-failures @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/README.md b/README.md index 41864ea..a757805 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ -# swingometer +# radial-svg-graph -A [re-frame](https://github.com/Day8/re-frame) application designed to show votes in an election. +A [re-frame](https://github.com/Day8/re-frame) application designed to show a radial SVG graph, possibly with several rings. ## Development Mode diff --git a/project.clj b/project.clj index 5f25843..82d098d 100644 --- a/project.clj +++ b/project.clj @@ -1,11 +1,17 @@ -(defproject swingometer "0.1.0-SNAPSHOT" - :dependencies [[org.clojure/clojure "1.8.0"] - [org.clojure/clojurescript "1.9.229"] - [reagent "0.6.0"] - [re-frame "0.9.4"] - [re-com "2.0.0"]] +(defproject rsvggraph "0.1.0-SNAPSHOT" + :dependencies [[clojure2d "1.4.5"] ;; (mainly) for colours + [generateme/fastmath "2.4.0"] + [hiccup "2.0.0-RC3"] + [javax.xml.bind/jaxb-api "2.4.0-b180830.0359"] + [org.clojure/clojure "1.8.0"] + ;; [org.clojure/clojurescript "1.9.229"] + ;; [org.omcljs/om "1.0.0-beta1"] + ;; [reagent "0.6.0"] + ;; [re-frame "0.9.4"] + ;; [re-com "2.0.0"] + ] - :plugins [[lein-cljsbuild "1.1.4"]] + ;; :plugins [[lein-cljsbuild "1.1.4"]] :min-lein-version "2.5.3" @@ -15,36 +21,32 @@ :figwheel {:css-dirs ["resources/public/css"]} - :profiles - {:dev - {:dependencies [[binaryage/devtools "0.8.2"]] + ;; :profiles + ;; {:dev + ;; {:dependencies [[binaryage/devtools "0.8.2"]] - :plugins [[lein-figwheel "0.5.9"]] - }} + ;; :plugins [[lein-figwheel "0.5.9"]] + ;; }} - :cljsbuild - {:builds - [{:id "dev" - :source-paths ["src/cljs"] - :figwheel {:on-jsload "swingometer.core/mount-root"} - :compiler {:main swingometer.core - :output-to "resources/public/js/compiled/app.js" - :output-dir "resources/public/js/compiled/out" - :asset-path "js/compiled/out" - :source-map-timestamp true - :preloads [devtools.preload] - :external-config {:devtools/config {:features-to-install :all}} - }} + ;; :cljsbuild + ;; {:builds + ;; [{:id "dev" + ;; :source-paths ["src/cljs"] + ;; :figwheel {:on-jsload "rsvggraph.core/mount-root"} + ;; :compiler {:main rsvggraph.core + ;; :output-to "resources/public/js/compiled/app.js" + ;; :output-dir "resources/public/js/compiled/out" + ;; :asset-path "js/compiled/out" + ;; :source-map-timestamp true + ;; :preloads [devtools.preload] + ;; :external-config {:devtools/config {:features-to-install :all}} + ;; }} - {:id "min" - :source-paths ["src/cljs"] - :compiler {:main swingometer.core - :output-to "resources/public/js/compiled/app.js" - :optimizations :advanced - :closure-defines {goog.DEBUG false} - :pretty-print false}} - - - ]} - - ) + ;; {:id "min" + ;; :source-paths ["src/cljs"] + ;; :compiler {:main rsvggraph.core + ;; :output-to "resources/public/js/compiled/app.js" + ;; :optimizations :advanced + ;; :closure-defines {goog.DEBUG false} + ;; :pretty-print false}}]}) +) diff --git a/resources/public/css/swingometer.css b/resources/public/css/rsvggraph.css similarity index 64% rename from resources/public/css/swingometer.css rename to resources/public/css/rsvggraph.css index fe3fe55..fc64d5b 100644 --- a/resources/public/css/swingometer.css +++ b/resources/public/css/rsvggraph.css @@ -1,70 +1,73 @@ /***************************************************************************\ * * - * swinging-needle-meter.css * + * rsvggraph.css * * * - * CSS styling for the swinging needle meter itself. * + * CSS styling for the radial svg graph itself. * * * \***************************************************************************/ -.snm-cursor { +svg { + border: thin solid gray; + object-fit: contain; +} + +.rsvggraph-cursor { stroke:#ff8500; stroke-width: 3%; stroke-opacity: 0.5; } -.snm-frame { +.rsvggraph-frame { fill: none; - stroke-width: 5%; - stroke-linejoin: round; - stroke: #444444; + stroke: none; } -.snm-gradation path { +.rsvggraph-gradation path { stroke: black; stroke-width: 1; } -.snm-gradation text { +.rsvggraph-gradation text { font-size: 200%; font-weight: lighter; } -.snm-hub { +.rsvggraph-hub { fill: #444444; } -.snm-meter { +.rsvggraph-graph { height: 50%; width: auto; } -.snm-needle { +.rsvggraph-needle { stroke: black; stroke-width: 1; } -.snm-redzone { +.rsvggraph-redzone { fill:none; stroke: maroon; stroke-width: 10%; } -.snm-scale { +.rsvggraph-scale { fill: none; stroke: silver; stroke-width: 10%; } -.snm-target .snm-frame { +.rsvggraph-target .rsvggraph-frame { stroke: green; } -.snm-value { +.rsvggraph-value { font-size: 400%; font-weight: bold; text-align: center; } -.snm-warning .snm-frame { +.rsvggraph-warning .rsvggraph-frame { stroke: maroon; } diff --git a/resources/public/index.html b/resources/public/index.html index f4b2849..70e6e2a 100644 --- a/resources/public/index.html +++ b/resources/public/index.html @@ -5,16 +5,16 @@ - + -