0

在d3.js中,我发现树形布局不能通过某个节点计算之前的节点,它只能绘制后继节点。像 DAG 这样的布局可以在 d3.js 中绘制吗?

4

1 回答 1

0

Couple of ideas you might find useful:

You can use the tree layout to place the nodes in the canvas, create link objects pointing back and forth, then bind the link objects to a diagonal.

http://www.durablejs.org/examples/flowchart/1/admin.html

You can also use place the nodes using a pack layout, create the link objects pointing back and forth, and bind the links to a Bezier curve.

http://www.durablejs.org/examples/statechart/1/admin.html

You can find the code for the graphs above:

https://github.com/jruizgit/durable/tree/master/lib/durabjevisual.js

于 2013-09-05T06:57:52.390 回答