【发布时间】:2016-02-29 12:10:20
【问题描述】:
我正在创建一个节点树图,基于:http://www.d3noob.org/2014/01/tree-diagrams-in-d3js_11.html
我没有完成什么,或者在 google 上查找是否可以将多个节点定向到一个端节点,如下面的示例图片所示。 有人可以帮我吗?还是指出正确的方向?
按我想要的方式采样。 http://i.stack.imgur.com/hyocN.png
谢谢
【问题讨论】:
我正在创建一个节点树图,基于:http://www.d3noob.org/2014/01/tree-diagrams-in-d3js_11.html
我没有完成什么,或者在 google 上查找是否可以将多个节点定向到一个端节点,如下面的示例图片所示。 有人可以帮我吗?还是指出正确的方向?
按我想要的方式采样。 http://i.stack.imgur.com/hyocN.png
谢谢
【问题讨论】:
试试这个数据源:
var treeData = [ {
"name": "Top Level 1",
"parent": "null",
"children": [
{
"name": "Level 2: A",
"parent": "Top Level 1",
"children": [
{
"name": "Son of A",
"parent": "Level 2: A"
},
{
"name": "Daughter of A",
"parent": "Level 2: A"
}
]
},
{
"name": "Level 2: B",
"parent": "Top Level"
}
] }, {
"name": "Top Level 2",
"parent": "null",
"children": [
{
"name": "Level 2: A",
"parent": "Top Level 2"
}
] }, {
"name": "Top Level 3",
"parent": "null",
"children": [
{
"name": "Level 2: A",
"parent": "Top Level 3"
}
] } ];
【讨论】: