;(function() {

    var isInited = false;
    var marker = null;
    var container = null;
    SVG.extend(SVG.Element, {
        connectable: function(options, elmTarget) {

            if (elmTarget === undefined) {
                elmTarget = options;
                options = {};
            }

            container = container || options.container;
            var elmSource = this;
            var line = container.line().attr("marker-end", "url(#triangle)");
            var markers = options.markers;

            // Source and target positions
            var sPos = {};
            var tPos = {};

            function updateLine() {

                sPos = elmSource.transform();
                tPos = elmTarget.transform();

                var x1 = sPos.x;
                var y1 = sPos.y;
                var x2 = tPos.x;
                var y2 = tPos.y;

                var dx = x2 - x1;
                var dy = y2 - y1;

                if (Math.abs(dy) < 200) {
                    if (dx < 0) {
                        x1 -= 25;
                        x2 += 30;
                    } else {
                        x2 -= 30;
                        x1 += 25;
                    }
                } else {
                    if (dy < 0) {
                        y1 -= 25;
                        y2 += 30;
                    } else {
                        y2 -= 30;
                        y1 += 25;
                    }
                }

                line.attr({
                    x1: x1,
                    y1: y1,
                    x2: x2,
                    y2: y2
                });
            }

            if (isInited === false) {
                marker = markers.marker(10, 10);
                marker.attr({
                    id: "triangle",
                    viewBox: "0 0 10 10",
                    refX: "0",
                    refY: "5",
                    markerUnits: "strokeWidth",
                    markerWidth: "4",
                    markerHeight: "5"
                });

                marker.path().attr({
                    d: "M 0 0 L 10 5 L 0 10 z"
                });

                isInited = true;
            }


            updateLine();

            elmSource.dragmove = updateLine;
            elmTarget.dragmove = updateLine;

            return {
                source: elmSource,
                target: elmTarget,
                line: line
            };
        }
    });
}).call(this);

@@ -21,38 +21,15 @@
 var 
-isInited = false;%0A    var mark
+contain
 er =
@@ -39,33 +39,31 @@
 ll;%0A    var 
-contain
+mark
 er
+s
  = null;%0A   
@@ -55,24 +55,25 @@
 ers = null;%0A
+%0A
     SVG.exte
@@ -358,16 +358,185 @@
 = this;%0A
+            markers = markers %7C%7C options.markers;%0A%0A            var marker = markers.marker(10, 10);%0A            var markerId = %22triangle-%22 + Math.random().toString(16);%0A
         
@@ -596,21 +596,30 @@
 rl(#
-triangle
+%22 + markerId + %22
 )%22);%0A
+%0A
     
@@ -630,37 +630,363 @@
     
-var markers = options.markers
+marker.attr(%7B%0A                id: markerId,%0A                viewBox: %220 0 10 10%22,%0A                refX: %220%22,%0A                refY: %225%22,%0A                markerUnits: %22strokeWidth%22,%0A                markerWidth: %224%22,%0A                markerHeight: %225%22%0A            %7D);%0A%0A            marker.path().attr(%7B%0A                d: %22M 0 0 L 10 5 L 0 10 z%22%0A            %7D)
 ;%0A%0A 
@@ -2120,564 +2120,8 @@
  %7D%0A%0A
-            if (isInited === false) %7B%0A                marker = markers.marker(10, 10);%0A                marker.attr(%7B%0A                    id: %22triangle%22,%0A                    viewBox: %220 0 10 10%22,%0A                    refX: %220%22,%0A                    refY: %225%22,%0A                    markerUnits: %22strokeWidth%22,%0A                    markerWidth: %224%22,%0A                    markerHeight: %225%22%0A                %7D);%0A%0A                marker.path().attr(%7B%0A                    d: %22M 0 0 L 10 5 L 0 10 z%22%0A                %7D);%0A%0A                isInited = true;%0A            %7D%0A%0A%0A
     
@@ -2325,16 +2325,16 @@
 Target,%0A
-
         
@@ -2351,16 +2351,48 @@
 ne: line
+,%0A                marker: marker
 %0A       

Create new markers for each line