<svg width="100" height="100">
<line id="line1" x1="10" y1="10" x2="50" y2="50" stroke="red"/>
<line id="line2" x1="10" y1="10" x2="50" y2="50" stroke="red"/>
<svg>
<script>
var line1=document.getElementById("line1");
var line2=document.getElementById("line2");
var x1=line1.getAttribute("x2")
line2.setAttribute("x2", функция(координаты мышки, x1, другие переменные));
</script>
_elm: function(sel){
return this._cldElm(this.svg, sel);
},
_cldElm: function(elm, sel){
return elm.querySelector(sel);
},
setAttr: function(el, ns, nm, vl){
el.setAttributeNS(ns, nm, vl);
},
setAttrs: function(el, attrs){
for (var a in attrs)
this.setAttr(el, null, a, attrs[a]);
},
// и пример использования
var ln = this._elm('.svg-line');
this.setAttrs(ln, { x1: x - 50, y1: (rowId * 80) + 40, x2: x - 10, y2: y + 35 });