A many-body force changes how nodes interact with one another in a force simulation. With d3.forceManyBody(), a negative strength makes nodes repel; a positive strength makes them attract. Unlike a positioning force, it does not pull each node toward a chosen coordinate. section 12.4.1
Combine it with other forces to shape a layout: collision keeps nodes from overlapping, centering moves the whole group, and link force pulls connected nodes together. The simulation updates node positions as it runs. section 12.4 section 12.5
Figure 12.17 The many-body force influences how nodes interact with each other. A negative many-body force creates repulsion, while a positive one mimics attraction.
Compare the two layouts to see how changing the sign switches node interaction from repulsion to attraction. section 12.4.1
