I have a complete, undirected, weighted graph. I would like to visualize this graph in such a way that the visualized edge lengths are proportional to the edge weights, which represent distances between locations (the nodes).
My understanding of the force-directed graph model is that the node charge determines the distance between the nodes, and thus the edge length. Since no node can have more than one charge, it seems logical that (for the complete graph), the distance between all nodes adjacent to some node must be the same.
Is there a way to accomplish such a visualization of a complete graph in D3.js?
答案 0 :(得分:2)
No. You can set the linkDistance()
for each edge, but this is really only a guideline -- D3 doesn't enforce exactly that length.