javascript - Change the shape of the edges in D3 -
i have graph uses dagre layout , looks this:
what trying change shape of edges can in zigzag form one:
i have function:
function shape_edges(d) { return "m" + d.source.y + "," + d.source.x + "h" + (d.source.y + (d.target.y-d.source.y)/2) + "v" + d.target.x + "h" + d.target.y; } which, little bit of change can give me shape want.
the problem not sure how use function affect edges.
i creating edges following way:
for (i=0; i<relations.length; i++) { g.setedge(relations[i][0],relations[i][1], { arrowheadstyle: "fill: #000", lineinterpolate: 'linear' }); } i have read lineinterpolate can accept function haven't been able apply shape_edges function it.
can show me how apply desired function can affect edges, or @ least point me in right direction because have been stuck quite time?


Comments
Post a Comment