 
 (defn ajax-get
   ([ url params callback ]
+   (watch url params)
    (ajax/GET url {:handler callback
                   :params params
                   :error-handler #(.log js/console (str "HTTP error, url: " url " resp: " %))}))

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

      :reagent-render
      (fn [ & rest ]
        @window-width

              cb)))

(defn periodic-event-channel [ interval-ms ]
  (let [channel (chan (dropping-buffer 1))
        put-now #(put! channel (time/now))]
    (put-now)
    (js/setInterval put-now interval-ms)
    channel))

(defn range-ending-at [ end-t ]
  (let [begin-t (time/minus end-t (time/seconds @query-window-secs))]
    {:begin-t (time-coerce/to-long begin-t)
     :end-t (time-coerce/to-long end-t)}))

(defn query-range-channel [ periodic-event-channel ]
  (let [ channel (chan) ]
    (pipeline 1 channel (map range-ending-at) periodic-event-channel)
    channel))

(defn series-data-channel [ series-name query-range-channel ]
  (let [channel (chan)]
    (go-loop []
      (ajax-get (str "/data/" series-name) (<! query-range-channel) #(put! channel %))
      (recur))
    channel))

(defn series-tsplot [ series qws-arg ]
  (let [dom-node (reagent/atom nil)
