Jsplumb change position of static anchor -


what want accomplish can rotate jsplumb connections. can use setanchor redefine anchor can't work. found online , works it's not want.

jsplumb.selectendpoints("myclickedelement").setanchor([ "continuous", { faces: ["top", "bottom", "left", "right"] }]) 

i got endpoint on top , bottom of object , when rotate want them @ left , right without deleting existing connections.

          jsplumb.addendpoint($(this).parent("div").attr('id'),     { anchor:[0.5, 0, 0, -1] }, { issource:true,  istarget:true,  paintstyle:{ linewidth:1, strokestyle:'#ff8700' },  connector: 'flowchart',  hoverpaintstyle:{ strokestyle:"#ff8700", linewidth:4},   })   jsplumb.addendpoint($(this).parent("div").attr('id'),   { anchor:[0.5, 1, 0, 1] }, { issource:true,  istarget:true,  paintstyle:{ linewidth:1, strokestyle:'#ff8700' },  connector: 'flowchart',  hoverpaintstyle:{ strokestyle:"#ff8700", linewidth:4},   }) 

this have create objects anchors

i have found solution

endpoints = jsplumb.selectendpoints($(this).attr('id').elementid); anchorarray = [[0.5,0,0,-1],[1,0.5,1,0],[0.5,1,0,1],[0,0.5,-1,0]];  endpoints.each(function(ep){     if (top == 0 && ep.id.contains(clickeditem)) {             ep.setanchor(anchorarray[0]);             top = 1;          } else if (ep.id.contains(clickeditem)) {             ep.setanchor(anchorarray[2]);         } });  

Comments

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -