在 React 中试用 D3 的这个例子。我看到我们可以使用以下数据方案制作简单的可折叠树,
"name": "flare",
"children": [{
"name": "analytics",
"children": [{
"name": "cluster",
"children": [{
"name": "AgglomerativeCluster",
"size": 3938
}, {
"name": "CommunityStructure",
"size": 3812
}]
}, {
"name": "graph",
"children": [{
"name": "BetweennessCentrality",
"size": 3534
}, {
"name": "SpanningTree",
"size": 3416
}]
}]
如果每个子项都包含自己的子项怎么办,我们如何为子项嵌套项显示可折叠树?例如,
"name": "flare",
"children": [{
"name": "analytics",
"children": [{
"name": "cluster",
"children": [{
"name": "AgglomerativeCluster",
"size": 3938
children: [{
"name": "children nested children1",
"size": "123"
}]
}, {
"name": "CommunityStructure",
"size": 3812
}]
}]