d3.js Indented tree with straight links

前端 未结 2 2036
误落风尘
误落风尘 2021-02-06 10:40

My code is based on the D3.js Indented tree example.

I want straight links instead of the curved links between parent/child-objects.

I understand this has someth

2条回答
  •  一个人的身影
    2021-02-06 11:27

    You're almost there. You need to use a normal line with a suitable interpolation, e.g.

    var line = d3.svg.line().interpolation("step")
                     .x(function(d) { return d.y; })
                     .y(function(d) { return d.x; });
    

    You may have to tweak the exact interpolation mode.

提交回复
热议问题