 (defonce width (reagent/atom 800))
 
 (defonce height (reagent/atom 600))
+
+(defonce speed (reagent/atom 1700))
 
 (def options
   {:chart       {:type "line"}

(defn logistic-map [x]
  (* 3.9341 x (- 1 x)))

(defn evolution! [seed ticks ps _]
  (let [x (atom seed)]
    (swap! ps conj [@ticks seed])
    (fn [_ ticks ps component]
      (let [x' (logistic-map @x)
            ticks' (swap! ticks inc)]
        (swap! ps conj [ticks' x'])
        (js/setTimeout #(reset! x x') 1000)
        [:div component (str [ticks' x'])]))))

(defn page []
  [:div

    [slider "y-max" y-max 1 500]]
   [:div
    [:label {:for "width"} "width"]
    [slider "width" width 400 3000]]
   [:div
    [:label {:for "height"} "height"]
    [slider "y-max" height 400 1080]]
   [:div
    [:label {:for "speed"} "speed"]
    [slider "speed" speed 200 2000]]
   [chart width height points]])

(reagent/render-component [page]
                          (. js/document (getElementById "app")))

(evolution! 0.851 points, speed)