    (< n min) min
    (> n max) max
    :else n))
+
+(defn is-number? [v] (not (js/isNaN v)))
 
 
 (defn grid-config-view

  [data owner]
  (reify
    om/IRenderState
    (render-state [_ {:keys [tax-rate depreciation command-info-channel]
                      :as state}]
      (dom/div
       #js {:role "form" :className "economic-model-control"}

                    (normalize (/ (js/parseFloat tax-rate) 100) 0 1.0)
                    :depreciation
                    (normalize (/ (js/parseFloat depreciation) 100) 0 1.0)}
                   (filter (comp is-number? second))
                   (into {})
                   (merge
                    {:utility-params (->> {:a (js/parseFloat a)
                                           :p (js/parseFloat p)
                                           :q (js/parseFloat q)}
                                          (filter (comp is-number? second))
                                          (into {}))})
                   (put! command-info-channel))}
        "Send command")

