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

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

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

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

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

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

    (swap! dashboard-state assoc :series (<! (<<< fetch-series-names)))))

(run)

