d3树

编程入门 行业动态 更新时间:2024-10-28 06:37:05
本文介绍了d3树 - 父母有相同的孩子的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我已经将我的代码从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树

本文发布于:2023-10-26 09:16:18,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1529732.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!