d3.js中的有向无环图 [英] Directed, acyclic graph in d3.js

查看:642
本文介绍了d3.js中的有向无环图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

今天在D3.js中是否有一种可靠的方式绘制有向无环图?我正在尝试可视化课程中的先决条件,与此类似.

Is there a reliable way of drawing directed, acyclic graphs in D3.js today? I'm trying to visualize prerequisites in a curriculum, similar to this.

我已经看到了一些类似问题的较早答案,最有希望的线索是此黑客 ,尽管它不适用于更大,更复杂的数据集.

I've seen some older answers to similar questions with the most promising lead being this hack, though it doesn't work reliably well with larger and more complex data sets.

这是D3不太理想的可视化案例吗?

Is this simply a rare case of a visualization that D3 is not ideal for?

推荐答案

您可以尝试 dagre ,一个用于DAG图形的JS库.

You may have a try to dagre, a JS library for DAG graphs.

如果出于任何原因要使用d3,请查看 dagre-d3

If you want to use d3 for whatever reason, have a look at dagre-d3

要获得更高级的方法,请在此项目中使用所有内容来 上面的库.

For a more high-level approach have a look at this project using all the libs above.

如果d3不是强制性的,也可以在其他图形库中查看 . ;)

If d3 is not mandatory have also a look at others graphs library. ;)

2018年9月更新

有一个新的库,名为 d3-dag

这篇关于d3.js中的有向无环图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆