 (ns maps.core
-  (:require [reagent.core :as reagent :refer [atom]]))
+  (:require [reagent.core :as reagent]))
 
 (enable-console-print!)
 

(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 "x-min" x-min -500 0]]
   [:div
    [:label {:for "x-max"} "x-axis max value"]
    [slider "x-max" x-max 1 1000]]
   [:div
    [:label {:for "y-min"} "y-axis min value"]
    [slider "y-min" y-min -500 0]]
