D3 tree: lines instead of diagonal projection

后端 未结 1 934
栀梦
栀梦 2020-12-28 22:29

I am using d3.js to create a tree using this example.

This handles the data I have perfectly and produces the desired outcome except for one detail: I don\'t want th

相关标签:
1条回答
  • 2020-12-28 23:11

    Actually I figured out from other example:

    svg.selectAll(".link")
        .data(links)
    .enter().append("line")
        .attr("class", "link")
        .attr("x1", function(d) { return d.source.y; })
        .attr("y1", function(d) { return d.source.x; })
        .attr("x2", function(d) { return d.target.y; })
        .attr("y2", function(d) { return d.target.x; });
    

    0 讨论(0)
提交回复
热议问题