forceY() is a positioning force for a D3 force simulation. It draws nodes toward a chosen vertical position, leaving them free to spread along the x-axis. section 12.4.1
Align nodes into a horizontal band
Use forceY(0) to pull nodes toward y = 0. Combined with a collision force, the nodes avoid overlap and form a flattened beeswarm-like shape. section 12.4.1
Control the pull with strength(). Its default is 1; lowering the y-force strength makes vertical attraction weaker. Combine forceY() with forceX() when nodes should be attracted toward both coordinates. section 12.4.1
Figure 12.11 d3.forceX() makes the nodes move toward a specific horizontal position, while d3.forceY() does the same with a vertical position.
Compare horizontal and vertical positioning: forceY() targets a y-coordinate, the vertical counterpart to forceX(). section 12.4.1
