 (defn fetch-series-data [ series-name query-window-secs cb ]
   (ajax-get (str "/data/" series-name "?query-window-secs=" query-window-secs) cb))
 
-(def default-tsplot-width 1024)
-(def default-tsplot-height 180)
-
 (defn dom-node-width
   ([ node default-width ]
    (if node

      
      :component-did-mount
      (fn [ this ]
        (swap! series-state assoc :dom-node (.-parentNode (reagent/dom-node this)))
        (go
          (swap! series-state assoc :series-data (<! (<<< fetch-series-data series @query-window-secs)))))

      :reagent-render
      (fn [ ]
        @window-width
        (let [ dom-node (:dom-node @series-state)]
          [:canvas
           {:width (dom-node-width dom-node default-tsplot-width)
            :height (dom-node-height dom-node default-tsplot-height)}]))})))

(defn series-pane [ series ]
  [:div.series-pane

(def dashboard-state (reagent/atom {:series [] :text ""}))

(def window-width (reagent/atom nil))

(def default-tsplot-width 1024)
(def default-tsplot-height 180)

(defn <<< [f & args]
  (let [c (chan)]
