                [:span {:style {:backgroundColor "lightgrey"}} (str (:now wld))]])))
 
 (def world-widget
-  (let [c
+  (let [props (fn [this] (aget (.-props this) "args"))
+        rescroll (fn [_ _]
+                   (this-as this
+                     (let [n (.getDOMNode this)
+                           wld @(get (props this) :world)]
+                       (set! (.-scrollLeft n) (:scroll-x wld))
+                       (set! (.-scrollTop n) (- (:height wld) (:scroll-y wld))))))
+        c
         (.createClass js/React
-                      #js {#_:getInitialState
-                           #_(fn [] (atom {}))
-                           :shouldComponentUpdate
+                      #js {:shouldComponentUpdate
                            (fn [next-props next-state]
                              (this-as this
-                               (or (not= next-props (.-props this))
+                               (or (not= next-props (props this))
                                    (not= @next-state @(.-state this)))))
                            :render
                            (fn []
                              (this-as this
-                               (let [props (.-props this)
-                                     world (aget props "world")
-                                     container-w (aget props "width")
-                                     container-h (aget props "height")
+                               (let [props (props this)
+                                     world (get props :world)
+                                     container-w (get props :width)
+                                     container-h (get props :height)
                                      _ (assert (instance? Atom world) "world should be atom?")
                                      wld @world
                                      world-w (:width wld)

                                   (+ (:entry-time prev) heval/time-unit)
                                   (min (iv/end (:interval trans))
                                        (:t opt)))
                            _ (soft-assert (= (get-in prev [:objects (:id opt) :state])
                                              (:state opt))
                                           "not="
                                           (get-in prev [:objects (:id opt) :state])
                                           (:state opt))
                            succ (roll/follow-transition ha-defs prev trans time)
                            _ (soft-assert (= (get-in succ [:objects (:id opt) :state])
                                              (:target opt))
                                           "not="
                                           (get-in succ [:objects (:id opt) :state])
                                           (:target opt))
                            [rolled seen] (roll/inert-playout ha-defs succ explore-roll-limit seen)]
                        [(conj ps (concat (conj next-path succ) rolled))
                         (conj

                                                   :style   {:position "absolute"}
                                                   :viewBox (str "0 0 " world-w " " world-h)}
                                             (seen-viz/seen-viz world-h polys)
                                             [:g {}
                                              (map (fn [[x y w h]]
                                                     [:rect {:x     x :y (- world-h h y)
                                                             :width w :height h
                                                             :fill  "white"
                                                             :key   (str x "@" y "," w "@" h)}])
                                                   (:walls wld))]
                                             (map (fn [{{x :x y :y w :w h :h} :v0 id :id :as ha}]
                                                    [:g {:key id}
                                                     [:rect {:x     x :y (- world-h h y)
                                                             :width w :height h
                                                             :fill  "brown"
                                                             :key   "sprite"}]
                                                     [:text {:width    200 :x x :y (- world-h y 5)
                                                             :fontSize 8
                                                             :fill     "lightgrey"
                                                             :key      "name"}
                                                      (str id " " (:state ha))]])
                                                  (map #(ha/extrapolate (get ha-defs (:id %)) % (:now wld))
                                                       (vals has)))]
                                            (button-bar world)]))))
                           :componentDidUpdate
                           rescroll
                           :componentDidMount
                           rescroll})
        f (.createFactory js/React c)]
    f))

(defn rererender [target]
  (let [w @world]
