 
     (let [vecs
           (for [c (range cols) r (range rows)]
-            (let [num (or (::core/density-at-last-update (get grid-cells [r c]))
-                          0.0)]
+            (let [num (or
+                        (when clusters-only
+                          (do
+                            (println "clusers only")
+                            (let [cluster (::core/cluster (get grid-cells [r c]))]
+                              (println "cluster:" cluster)
+                              (if (and (not (= nil cluster))
+                                       (not (= "NO_CLASS" cluster)))
+                                (do
+                                  (println "cluster: " cluster)
+                                  (::core/density-at-last-update (get grid-cells [r c])))
+                                0.0))))
+                        (::core/density-at-last-update (get grid-cells [r c]))
+                        0.0)]
               num
               ))]
       {:matrix (->>

    ;;TODO abandon tsne for a simple dxd grid of 2d scatter plots

    (clojure.pprint/pprint displayable)
    ;(clojure.pprint/pprint sorted-stats)
    )
  )


(deftest stuff
  (let [test-props   {::core/c_m         3.0
                      ::core/c_l         0.8
                      ::core/lambda      0.998
                      ::core/beta        0.3
                      ::core/dimensions  2
                      ::core/phase-space [
                                          {::core/domain-start    -1.0
                                           ::core/domain-end      1.0
                                           ::core/domain-interval 0.1}
                                          {::core/domain-start    -1.0
                                           ::core/domain-end      1.0
                                           ::core/domain-interval 0.1}]
                      ::core/gap-time    100}
        samples      (repeatedly 10000 #(hash-map
                                          ::core/raw-datum
                                          {::core/position-value
                                                        (vec
                                                          (take
                                                            (::core/dimensions test-props)
                                                            (repeatedly
                                                              (fn []
                                                                (let [r (rand)]
                                                                  (cond (<= 0.0 r 0.9) (+ 0.1
                                                                                          (* 0.1
                                                                                             (first
                                                                                               (random/sample-normal 1))))
                                                                        (<= 0.9 r 0.95) (-
                                                                                         (* 0.05
                                                                                            (first
                                                                                              (random/sample-normal 1)))
                                                                                         0.3)
                                                                        (<= 0.95 r 1.0) (+
                                                                                          (* 0.05
                                                                                             (first
                                                                                               (random/sample-normal 1)))
                                                                                          0.3)))))))
                                           ::core/value 1.0}))

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