Use d3.forceCenter() to move a whole cluster of nodes toward a chosen position. Unlike d3.forceX() and d3.forceY(), which pull nodes individually and can flatten the cluster, the centering force translates the group while preserving its shape. section 12.4.1
Move a cluster
In a force simulation, set the destination with the force’s x() and y() accessors: forceSimulation(nodes) .force("center", forceCenter().x(200).y(150)); A cluster formed with a collision force can then move toward (200, 150) without being flattened by separate x and y positioning forces. section 12.4.1
Figure 12.16 The centering force moves an entire system of particles, or nodes, toward the coordinates passed to the x() and y() accessor functions.
The figure shows the nodes moving together toward the coordinates set by x() and y(). section 12.4.1
