         cy (+ 50 (rand 300))]
     (for [_ (range n)]
       [(+ cx -40 (rand 80)) (+ cy -40 (rand 80))])))
-
-(defn k-means-vis []
-  (let [k 5
-        N 8
-        data (mapcat random-cluster (repeat k N))
-        means (clustering/k-means k data)]
-    (-> (vis/visual @points)
-        (vis/elem (partial data-point "#fff"))
-        (vis/enter (partial dom/append (dom/query "svg"))))
-    (-> (vis/visual means)
-        (vis/elem mean)
-        (vis/enter (partial dom/append (dom/query "svg"))))))
 
 (defn clear-svg []
   (dom/empty (dom/query "svg")))


(pm/defpartial mean [[[x y] {:keys [index points]}]]
  (let [color (nth (cycle colors) index)]
    (visualize-group points (partial data-point color))
    (visualize-group points (partial line [x y]))
    [:svg:circle {:r 6 :cx x :cy y :stroke "#333" :fill color}]))

(def points (atom []))

(def initial-state {:next-step :init
                    :k 10

            [pinot.draw.visualization :as vis]
            [pinot.util.clj :as pclj])
  (:require-macros [pinot.macros :as pm]))

(defn remove-attribute [elem k]
  (doseq [el (pclj/->coll elem)]
