             [cljs-time.coerce :as time-coerce]
             [metlog-client.tsplot :as tsplot]))
 
-(defonce query-window-secs (reagent/atom (* 3600 24)))
+(defonce query-window (reagent/atom (* 3600 24)))
 
 (def dashboard-state (reagent/atom {:series [] :text ""}))
 

  [:div.header
   [:span#app-name
    "Metlog"]
   [input-field @query-window-secs #(end-edit % dashboard-state)]])

(defn dashboard [ ]
  [:div

                    {:width (.-clientWidth node)
                     :height (.-clientHeight node)})]])})))

(defn series-pane [ series-name query-window ]
  [:div.series-pane
   [:div.series-pane-header
    [:span.series-name series-name]]
   [series-tsplot series-name query-window]])

(defn series-list [ ]
  [:div
   (for [ series (:series @dashboard-state) ]
     ^{ :key series } [series-pane series @query-window])])

(defn end-edit [ text state ]
  (reset! query-window (js/parseInt text)))

(defn input-field [ initial-text on-enter ]
  (let [ state (reagent/atom { :text initial-text }) ]
