怎么设置力导向图的线条长度API并没有给出示例,导致我一直不知道distance
这个代码往哪里加,这里记录一下.
const simulation = d3.forceSimulation().force('link', d3.forceLink().id(d => d.id).distance(100))
.force('charge', d3.forceManyBody())
.force('center', d3.forceCenter(width / 2, height / 2))
API:
https://github.com/xswei/d3-force/blob/master/README.md#link_distance