D3.js how do I arrange nodes of a force layout to be on a circle

后端 未结 1 609
慢半拍i
慢半拍i 2021-01-06 05:47

I have developed a force layout to represent relationships between social groups. Now I would like to get the nodes to be distributed in a circle with links joining them. Wh

1条回答
  •  攒了一身酷
    2021-01-06 06:20

    Here's someone else's solution:

    This network graph uses the D3 force layout to draw nodes and links, but instead of using d3.force() to find the best node positions, we draw an invisible arc and evenly places nodes along the circumference.

    
    
    
    
      
      JS Bin
    
      
    
    
    
    
    
    
    

    0 讨论(0)
提交回复
热议问题