     (reset! animation
       (ann/anneal
         layout/score
-        (ann/linear-cooling 1000)
+        (ann/linear-cooling cooling)
         layout/permute-move
         ann/standard-prob
         (layout/init-state test-users)))

  (doto (graphics/createGraphics "100%" "100%" 1.0 1.0)
    (.render (dom/getElement "network"))))

(defn draw-graph [{:keys [locs mentions]}]
  (. g (clear))

  ; Draw mention edges

  (let [offset (/ avatar-size 2)]
    (doseq [[username {:keys [x y]}] locs]
      (.drawImage g (- x offset) (- y offset) avatar-size avatar-size
                  (:image-url (get mentions username)))))

  (when text (.drawTextOnLine g text 0 0.02 0 1 "left" font stroke fill)))

; This is temporary.  The graph data should flow somehow from the
; tweets.  For now, just hardcode some:
(def test-users {"djspiewak" {:image-url "http://a0.twimg.com/profile_images/746976711/angular-final_normal.jpg", :last-tweet "Does Clojure have a Sinatra clone?", :mentions {}}, "tobsn" {:image-url "http://a2.twimg.com/profile_images/1364411587/yr40_normal.png", :last-tweet "Creating a Query DSL using Clojure and MongoDB http://tob.sn/qgCxkm #mongodb", :mentions {}}, "CzarneckiD" {:image-url "http://a3.twimg.com/profile_images/1156755747/head_trees_normal.jpg", :last-tweet "@greymouser I need to start writing some Clojure I guess :)", :mentions {"greymouser" 2}}, "sbtourist" {:image-url "http://a0.twimg.com/profile_images/72494229/Cryer_Black_normal.jpg", :last-tweet "Clooj, a lightweight Clojure IDE: http://t.co/OSCjr9X", :mentions {"djspiewak" 2}}, "jboner" {:image-url "http://a2.twimg.com/profile_images/1395654712/jonas_bw_small_normal.JPG", :last-tweet "RT @sbtourist: Clooj, a lightweight Clojure IDE: http://t.co/OSCjr9X", :mentions {"sbtourist" 2, "djspiewak" 2, "romanroe" 2}}})

(def animation (atom nil))

(set! (.cycle animation)
  (fn [t]
    (let [a (first @animation)]
      (draw-graph (:best a) (debug a)))
    (swap! animation #(drop anneal-skipping %))))

(events/listen
  (dom/getElement "network")
