 (ns nonaga.draw
-  (:require 
+  (:require
     [dommy.utils :as utils]
     [dommy.core :as dommy])
   (:use-macros


(def svg
  (make-svg "svg"
            :xmlns "http://www.w3.org/2000/svg" 
            :viewbox "0 0 1200 800"
            :width  "200px"
            :height "200px"))

(defn ring [x y]
  (make-svg "circle" :cx x :cy y :r 18 :fill "transparent" :stroke "blue"))

(dommy/append! (sel1 :body) svg)

(def rings
  (list
       [1 4] [2 4] [3 4]  
     [0 3] [1 3] [2 3] [3 3]
   [0 2] [1 2] [2 2] [3 2] [4 2] 
     [0 1] [1 1] [2 1] [3 1] 
       [1 0] [2 0] [3 0]))

(def svg-node
  (sel1 :svg))

(defn hex-coord->svg-coord [[hex-x hex-y]]
  (let [x (+ 20 (* 40 hex-x) (if (odd? hex-y) 20 0))

       (map hex-coord->svg-coord)
       (mapv (fn [[x y]] (dommy/append! svg-node (ring x y))))))

(defn draw-marbles [svg-node coords color]
  (->> coords
       (map hex-coord->svg-coord)
       (mapv (fn [[x y]] (dommy/append! svg-node (marble x y color))))))

(defn draw-coords [svg-node coords]
  (letfn [(draw [coord [x y]]
            (let [text (make-text (- x 10) (+ y 5) (coord->str coord))]
