0
當我查看節點時,x和y未在我的數組中定義。我的代碼最初是在版本3圓包節點x,y和r未定義d3.v4
var tree = d3.nest().key(node => node.parent)
.rollup(function (leaves) {return leaves.length; })
.entries(data);
var treeRoot = {
key: "root",
value: "100",
values: tree
};
var pack = d3.layout.pack()
.size([width, height - 50])
.children(function(d) { return d.values; })
.value(function(d) { return d.values; })
.padding(10);
var nodes = pack.nodes(treeRoot);