D3强制定向图节点
问题描述:
我使用Force Directed Graph来构建一种流程图。它工作正常,除了节点没有特定的顺序。它们是随机的。我希望图表遵循层次结构的顺序。
I am using the Force Directed Graph to build a kind of flow diagram. It works fine except that the nodes have no specific order. They are random. I would like the graph to follow a hierarchical order.
var force = d3.layout.force()
.nodes(d3.values(nodes))
.links(links)
.size([width, height])
.linkDistance(90)
.gravity(0.6)
.charge(-2000)
.linkStrength(0.3);
我想给节点一些