     (string/join " " (map str ["M" "L" "L"] coords))))
 
 
-(defn line [from to color id]
+(defn svg-edge [[id [from to color]]]
   [:svg:path
    {:class "clickable"
     :id id

    :marker-end "url(#Vertex)"}])


(.appendChild (dommy.core/sel1 :.forsvg)
              (crate/html [:svg:svg {:width 1000 :height 1000}
                           [:svg:defs
                            triangle-marker
                            circle-marker]
                           (line [100, 20] [200, 40] "#6666ff" "one")
                           (line [200, 40] [100, 80] "red" "two")]))

(defn e->tid [e]
  (-> e

  (js/alert "123"))

(def vertex-loc [[40 40]
                 [300 40]
                 [300 300]
                 [40 300]])

(def edges-vec [[0 1 "red"]
                [1 2 "blue"]
                [2 3 "red"]
                [3 1 "red"]])


(defn edge->endpoints [locations [start end color]]
  [(locations start) (locations end) color])


(defn make-edges [edges locations]
  (let [edge-ids (map (partial str "edge") (range))
        edges-with-endpoints (map (partial edge->endpoints locations) edges)]
    (into {} (map vector edge-ids edges-with-endpoints))))



(.log js/console (str (make-edges edges-vec vertex-loc)))

(defn make-svg [[width height] edges]
  [:svg:svg {:width width :height height}
   [:svg:defs
    triangle-marker
    circle-marker]
   (map svg-edge edges)]
  )

(.appendChild (dommy.core/sel1 :.forsvg)
              (crate/html (make-svg [1000 1000]
                                    (make-edges edges-vec vertex-loc)
                                    )))

(map #(dommy.core/listen! % :click click-handler) (dommy.core/sel :.clickable))
; (dommy.core/append (dommy.core/parent (dommy.core/sel1 :circle))
;                    (crate/html
;                      [:svg:line]))
