         weightTotal (apply + weights)
         weightedValues (map #(/ (:value %) (+ 1 (:distance %))) values)
         weightedSum (apply + weightedValues)]
-    (.log js/console "wa" weightedSum weightTotal (/ weightedSum weightTotal))
+    ;(.log js/console "wa" weightedSum weightTotal (/ weightedSum weightTotal))
     (/ weightedSum weightTotal)))
+
+(defn alpha-blend [values]
+  (let [distances (map :distance values)
+        maxDistance (apply max distances)
+        fudgeFactor 700.0]
+    ;(.log js/console "ab" maxDistance)
+    (min 1.0 (/ 1.0 (/ maxDistance fudgeFactor)))))
 
 (defn temp-for-locations [boxWidth boxHeight]
   (let [locations (:locations @app-state)

(defonce app-state (atom {:nodes []
                          :timer nil
                          :map (js/Image.)
                          :locations {"temp-1a:fe:34:fa:b2:af" [50 50]
                                      "temp-1a:fe:34:fa:b2:bf" [100 100]}}))

(def r (t/reader :json))

      (fetch-events)
      (. timer (start))
      (swap! app-state assoc :timer timer)
      ;(events/listen timer goog.Timer/TICK fetch-events)
)))

(if (-> (:timer @app-state) nil? not)
  (.stop (:timer @app-state)))
