我已经将我的代码从JIT转换到D3,并使用树布局。我已复制 mbostock.github/d3/talk/20111018/tree中的代码。 html 与我的树数据,但我想多做一点。
I have been transitioning my code from JIT to D3, and working with the tree layout. I have replicated the code from mbostock.github/d3/talk/20111018/tree.html with my tree data, but I wanted to do a little more.
在我的例子中,我想创建子节点合并回来形成一个较低级别的父级,我意识到更多是一个有向图结构,但是树来适应这(即注意子节点之间的公共id应该合并)。
In my case I wanted to create child nodes that merge back to form a parent at a lower level, which I realize is more of a directed graph structure, but would like the tree to accomodate this (i.e. notice that common id's between child nodes should merge).
因此,基本上一棵树在从父母到子女的路上像正常一样分裂,但是后来也有能力把那些子节点组合在一起成为父母)。
So basically a tree that divides like normal on the way from parents to children, but then also has the ability to bring those children nodes together to be parents (sort of an incestual relationship or something :)).
问类似的东西 - > 如何使用D3布局非树层次结构
Asks something similar -> How to layout a non-tree hierarchy with D3
我可能能够使用分层边缘绑定与树层次结构布局,但我没有看到这样做。
It sounds like I might be able to use hierarchical edge bundling in conjunction with the tree hierarchy layout, but I haven't seen that done. I might be a little off with that though.
推荐答案我一直在使用一个库,名为 dagre ,用于在JavaScript中布局有向图。我们有如何与D3配合使用的示例。也许这符合您的需要?
I've been working on a library, called dagre, for laying out directed graphs in the JavaScript. We have an example for how it can be used with D3. Maybe this suits your needs?
更多推荐
d3树
发布评论