几个月前,我试图combining Hierarchical Edge Bundling and Radial Reingold–Tilford Tree using d3.jsD3.js添加(分级边缘捆绑元素)的径向树元素之间的链接
我从HEB开始并试图使之成为一个树。 事情并没有按照我想要的方式工作,我意识到从不同的角度开始从可折叠的径向树(不是Reingold Tilford)可能会更好。
Here is a JSFiddle of the radial tree
数据模型也发生了变化,因为现在的元素有一个名字,儿童和进口(链接)。
var flare =
{
"name": "root",
"children": [
{
"name": "test1.parent1","children": [
{"name": "test1.child11","children": [
{"name": "test1.child111"},
{"name": "test1.child112"}
]}
],"imports": ["test2.parent2","test3.parent3","test4.parent4"]
},
{
"name": "test2.parent2","children": [
{"name": "test2.child21"},
{"name": "test2.child22"},
{"name": "test2.child28","children":[
{"name": "test2.child281"},
{"name": "test2.child282"}
]}
],"imports": ["test3.parent3"]
},
{"name": "test3.parent3","imports": ["test4.parent4"]},
{
"name": "test4.parent4","children": [
{"name": "test4.child41"},
{"name": "test4.child42"}
]
}
]
};
慢慢来,我想给non-interactive Hierarchical edge bundling从迈克·博斯托克与当前JSFiddle结合,但牢记的互动将成为它的一部分以后。
而且,只有第一层必须有链接(父父链接),如下图所示(我想要的结果):
我现在最大的问题是,HEB没有“根”,但树从一个项目开始。所以我迄今为止所尝试的所有东西都导致了树中心的大乱。
请注意,在树的中心有一个圆圈来覆盖根级别1的链接,所以树从级别1(父母)开始。
var circle = svg.append("circle")
.attr("cx", 0)
.attr("cy", 0)
.attr("r", diameter - 725.3)
.style("fill", "#F3F5F6")
.style("stroke-width", 0.2)
.style("stroke", "black");
理想的情况下,家长之间的联系有更新时的水平为(UN)倒塌,像它的节点和层次之间的联系,但可以晚一点,可能不是最初后难获得第一级链接显示。另外,如有必要,数据模板可能会更改,但所有3条信息都很重要(名称,子级和导入)。
另一种方法可以将数据更改为不包含根部分,并且其行为与现在完全相同 也可以部分回答。
绝对不是重复的,但似乎与[this](http://stackoverflow.com/q/30653093/1586231)相关。 –