springy icon indicating copy to clipboard operation
springy copied to clipboard

怎么修改节点之间连接线的长短?How to modify the length of the connection line?

Open LorrieIory opened this issue 9 years ago • 2 comments

hi 朋友 你的springy很好用,但是怎么修改连接线的长短呢?我修改了springyui.js里的很多属性都不生效,展现出来的图太大了; 请告诉我怎么修改节点之间的连接线;

Hi buddy Your springy is very easy to use,and pretty graph!But how to modify the length of the connection line it? I modify the springyui.js , many of the properties are not effective, the show is too large; Please teach me how to modify the connection line between the nodes,make them shortly; thank you~~~

LorrieIory avatar Nov 22 '16 03:11 LorrieIory

Hey yep, you can set an edge’s length in its metadata when creating it e.g.

graph.newEdge(node1, node2, { length: 2 ); // default length is 1, so a value if 2 should be roughly twice as long

dhotson avatar Nov 22 '16 11:11 dhotson

sorry i didn't use this function... i use a json String like this: var graph = new Springy.Graph(); var json= queryDependent(param,'id');// a json response;

    graph.loadJSON(json);// load json and draw
    var springy = $('#canvasDependent').springy({
        graph: graph

    });

so for this situation maybe i should change springyui.js? please tell me where i can set the length~~

LorrieIory avatar Nov 25 '16 08:11 LorrieIory