             [taoensso.tufte :as tufte :refer (defnp p profiled profile)]))
 
 
-(defn get-random-sample [method properties & {:keys [centroids]}]
+(defn get-random-sample [method properties & {:keys [centroids pos]}]
   ;;TODO make this sample some actua; distributions....
   (if centroids
-    (let [the-centroid (get centroids (rand-int (count centroids)))]
+    (let [the-centroid (get centroids (rand-int (count centroids)))
+          {:keys [row col]} pos
+
+          ]
+      (n/noise2 (* row 0.1) (* col 0.25))
       (vec
         (map-indexed (fn [idx {:keys [::core/domain-start ::core/domain-end]}]
                        (max domain-start (min domain-end (+ domain-start

   :layout        viz/svg-heatmap})

(defn cartesian-viz
  [prefix id the-matrix & [opts]]
  (clojure.pprint/pprint the-matrix)
  (->> {:x-axis (viz/linear-axis
                  {:domain [0 50]
                   :range  [50 550]
                   :major  10
                   :minor  5
                   :pos    280})
        :y-axis (viz/linear-axis
                  {:domain      [0 10]
                   :range       [280 20]
                   :major       1
                   :pos         50
                   :label-dist  15
                   :label-style {:text-anchor "end"}})

                                          {::core/domain-start    -2.5
                                           ::core/domain-end      2.5
                                           ::core/domain-interval 0.1}
                                          {::core/domain-start    -2.5
                                           ::core/domain-end      2.5
                                           ::core/domain-interval 0.1}]
                      ::core/gap-time    250}
        ;centroids    (vec (repeatedly 4 (fn [] (get-random-sample :unifrom test-props))))
        ;_            (println "centroids: " centroids)
        samples      (repeatedly 50000 #(hash-map
                                         ::core/raw-datum
                                         {::core/position-value
                                                       (vec
                                                         (take
                                                           (::core/dimensions test-props)
                                                           (repeatedly
                                                             (fn []

                                                               (if (> 0.5 (rand))
                                                                 (+ 0.1
                                                                    (* 0.15
                                                                       (first
                                                                         (random/sample-normal 1))))
                                                                 (+ 0.9
                                                                    (* 0.25
                                                                       (first
                                                                         (random/sample-normal 1)))))))))
                                          ::core/value 1.0}))

        test-state   {::core/state {::core/grid-cells           {}
