        {:x x :y (+ 5 y)
         :fill "black"
         :text-anchor "middle"}
-       (str id " (" vert-inflow "/" weight ")") ]))
+       (str free) ]))
   )
 
 (defn event->targetid [e]

                  (crate/html [:div#forsvg
                                (make-svg [1000 1000] world-state)])))

(defn inflow [edges vertex]
  (let [in-going (for [[_ [_ to color]] edges
                       :when (= to vertex)]
                   (color->value color))]
    (apply + in-going)))

(defn ok-to-flip? [{:keys [vertices edges]} [_ to color]]
  (let [edge-value (color->value color)
        to-inflow (inflow edges to)
        to-vertex-value (first (vertices to))]
    (>= (- to-inflow edge-value) to-vertex-value)))

(defn flip-edge [world-state [from to color :as edge]]
  (if (ok-to-flip? world-state edge)

    ch))


(defn make-triangle-marker [id arrow]
  [:svg:marker
   {:id id
    :viewBox "-5 -5 20 20"
    :refX "5"
    :refY "5"
    :markerWidth "7"
    :markerHeight "7"
    :orient "auto"}
   arrow])

(def triangle-marker-ok
  (make-triangle-marker "TriangleOK"
        [:svg:path {:fill "white" :stroke "black" :d "M0,0 L 10,5 L0,10 z"}]))

(def triangle-marker-not-ok
  (make-triangle-marker "TriangleNotOK"
    [:svg:path {:fill "black" :stroke "black" :d "M0,0 L 10,5 L0,10 z"}]))


(defn make-line-dirs [from to]
