D3 tree vertical separation

前端 未结 4 517
时光说笑
时光说笑 2020-12-30 08:03

I am using the D3 tree layout, such as this one: http://mbostock.github.com/d3/talk/20111018/tree.html

I have modified it for my needs and am running into an issue.

4条回答
  •  [愿得一人]
    2020-12-30 08:56

    As of 2016, I was able to achieve this using just

    tree.nodeSize([height, width])
    

    https://github.com/mbostock/d3/wiki/Tree-Layout#nodeSize

    The API Reference is a bit poor, but is works pretty straight forward. Be sure to use it after tree.size([height, width]) or else you will be overriding your values again.

    For more reference: D3 Tree Layout Separation Between Nodes using NodeSize

提交回复
热议问题