d3.js中的有向无环图 [英] Directed, acyclic graph in 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.
If d3
is not mandatory have also a look at others graphs library. ;)
2018年9月更新
有一个新的库,名为 d3-dag
这篇关于d3.js中的有向无环图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!