           (.append "line")
           (.attr "class" "link")
           (.style "stroke" "#C9CBCB")
-          (.style "stroke-width" 3)
-          (.each
-            (fn [link]
-              (this-as elem (add-tap-listener elem #(.onNext link-tap-subject link))))))
+          (.style "stroke-width" 3))
       (-> link-selection
           maybe-transition
           (.attr "x1" #(-> % :source positions v/x))

        svg (setup-svg! selector)
        gesture-manager (hammer-manager svg)
        animation-subject (animation-subject)
        node-tap-subject (js/Rx.Subject.)
        link-tap-subject (js/Rx.Subject.)
        current-state (atom (initial-state svg
                                           width
                                           height
                                           animation-subject
                                           node-tap-subject
                                           link-tap-subject))]
    (sync-on-container-size! current-state selector)
    (load-graph "miserables.json"
                (fn [graph]

         (zoom-in-to-pos! current-state
                          (zoom-out->world-pos @current-state %))))))

(defn svg-element-position [svg elem]
  (let [box (.getBoundingClientRect elem)
        center-x (+ (.-left box) (/ (.-width box) 2))
        center-y (+ (.-top box) (/ (.-height box) 2))
        svg-box (-> svg .node .getBoundingClientRect)
        svg-x (.-left svg-box)
        svg-y (.-top svg-box)]
    (v/create (- center-x svg-x) (- center-y svg-y))))

;; Gestures - tap on node

(defn closest-node
  "Returns the node closest to the given position and its distance"
  [state pos]
  (let [closest-node (atom nil)
        closest-distance-sq (atom js/Infinity)
        svg (:svg state)]
    (-> svg (.selectAll ".node-dot")
        (.each
          (fn [node]
            (this-as elem
                     (let [elem-pos (svg-element-position svg elem)
                           distance-sq (v/distance-sq pos elem-pos)]
                       (when (< distance-sq @closest-distance-sq)
                         (reset! closest-distance-sq distance-sq)
                         (reset! closest-node node)))))))
    {:node @closest-node
     :distance (js/Math.sqrt @closest-distance-sq)}))

(defn focus-node-on-tap-2! [manager current-state animation-observable]
  (let [taps (tap-observable manager)]
    (-> taps
        (suppress-while-animating animation-observable)
        (.map #(closest-node @current-state %))
        (.filter #(< (:distance %) (/ hitbox-size 2)))
        (.subscribe (fn [{:keys [node]}]
                      (if (= (:projection @current-state) :fisheye)
                        (zoom-in-to-pos! current-state (:pos node))))))))

;; Exported function to do magic

