 
 (enable-console-print!)
 
-(def app-state (atom {:grid {:width 10 :height 10}}))
+(def app-state (atom {:grid {:width 10 :height 10}
+                      :display {:width 600 :height 600}}))
 
+;;; TODO
+(defn color-for [cell] "#212")
 
 (defn alive-cell-view
   [cell owner]

(defmethod cell-view :dead
  [cell owner] (dead-cell-view cell owner))


(defn grid-view
  [data owner]
  (reify
    om/IRender
    (render [_]
      (apply dom/div #js {:className "automaton-grid"}
             (mapv (fn [y]
                     (apply dom/div #js {:className "automaton-row"}
                            (mapv (fn [x] (+ x y))
                                  (range (get-in data [:grid :width])))))
                   (range (get-in data [:grid :height])))))))


(defn handle-config-change

    (render [_]
      (dom/span #js {:className "cell dead"} "_"))))

(defn default-cell [cell owner]
  (reify
    om/IRenderState
    (render-state [_ {:keys [width height t]}]
      (let [st #js {:backgroundColor (color-for cell)
                    :width width
                    :height height
                    :float "left"
                    :borderStyle "solid";
                    :borderWidth "1px"}]
        (dom/div #js {:style st} t)))))

(defmulti cell-view (fn [cell _] (:state cell)))

(defmethod cell-view :alive
