       (fn [ this old-argv ]
         (let [canvas (.-firstChild @dom-node)
               ctx (.getContext canvas "2d")
-              range (range-ending-at (time/now))]
+              range (range-ending-at-current-window (time/now))]
           (tsplot/draw ctx (.-clientWidth canvas) (.-clientHeight canvas)
                        (:series-data @series-state)
                        (:begin-t range)

             false)))))

(defonce query-window (reagent/atom "1d"))

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



(defn end-edit [ text state ]
  (when (parse-query-window text)
    (put! time-event-channel {:msg-type :query-window :window-spec text})
    (reset! query-window text)))

(defn input-field [ initial-text text-valid? on-enter ]
