d3.js如何使所有节点折叠在可折叠缩进的树中

d3.js如何使所有节点折叠在可折叠缩进的树中

问题描述:

我试图在样本d3折叠树上工作。 mbostock的块#1093025。最初,当窗体加载时,如何使所有的节点最初折叠?

I am trying to work on a sample d3 collapsible tree. mbostock’s block #1093025. Initially when the form is loaded, how do i make all the nodes collapsed initially?

在你的json加载。
检查示例: http://mbostock.github.io/d3 /talk/20111018/tree.html

You have to add a function for that in your json loading. Check that example : http://mbostock.github.io/d3/talk/20111018/tree.html