javascript d3js 树方块

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/11137238/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-26 12:10:12  来源:igfitidea点击:

d3js Tree square

javascriptsvgd3.jstree

提问by gpasse

I would like to use d3.js to build a pedigree tree.

我想使用 d3.js 来构建谱系树。

All exemples that I found are showcasing organic trees.

我发现的所有例子都展示了有机树。

enter image description here

在此处输入图片说明

Are there any exemples out there with a pedigree like style ?

是否有任何具有血统风格的例子?

enter image description here

在此处输入图片说明

回答by mbostock

You could accomplish this using either the clusteror treelayouts. And using a custom path generator to draw orthogonal lines connecting nodes, as in this elbow dendrogram. I guess I was feeling inspired so I gave it a shot:

您可以使用集群布局来完成此操作。并使用自定义路径生成器绘制连接节点的正交线,如肘部树状图所示。我想我受到了启发,所以我试了一下:

回答by gpasse

I recently created some examples of using D3 to draw pedigreesin the style that most software does. There are examples for showing how to make it expand and collapse, transitions, and showing descendants as well as ancestors.

我最近创建了一些使用 D3 以大多数软件所做的风格绘制系谱的示例。有一些示例展示了如何使其展开和折叠、转换以及显示后代和祖先。

enter image description here

在此处输入图片说明