 
 (defonce query-window (reagent/atom "1d"))
 
-(defn periodic-event-channel [ interval-ms ]
-  (let [channel (chan)
-        put-now #(put! channel {:msg-type :timestamp :t (time/now)})]
-    (put-now)
-    (js/setInterval put-now interval-ms)
-    channel))
-
-(defonce time-event-channel (periodic-event-channel 15000))
+(defn time-atom [ interval-ms ]
+  (let [ new-atom (reagent/atom (time/now)) ]
+    (js/setInterval #(reset! new-atom (time/now)) interval-ms)
+    new-atom))
+
+(defonce current-time (time-atom 5000))
 
 (defn range-ending-at [ end-t window-seconds ]
   (let [begin-t (time/minus end-t (time/seconds window-seconds))]

  (ajax-get "/series-names" then))

(defn fetch-series-data [ series-name query-range then ]
  (let [ request-t (time/now) ]
    (ajax-get (str "/data/" series-name) query-range
              #(then (merge {:series-data %

     :begin-t (time-coerce/to-long begin-t)
     :end-t (time-coerce/to-long end-t)}))

(defonce dashboard-state (reagent/atom {:series [] }))

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

