diff --git a/README.md b/README.md index b6dafc3..4ad277c 100644 --- a/README.md +++ b/README.md @@ -118,8 +118,7 @@ Forces typically read the node’s current position ⟨*x*,*y*⟩ and then add t Simulations typically compose multiple forces as desired. This module provides several for your enjoyment: * [Centering](#centering) -* [Circle Collision](#circle-collision) -* [Circle Containment](#circle-containment) +* [Collision](#collision) * [Links](#links) * [Many-Body](#many-body) * [Positioning](#positioning) @@ -136,7 +135,7 @@ Assigns the array of *nodes* to this force. This method is called when a force i #### Centering -The centering force moves nodes so that their mean position (their center of mass assuming all nodes have equal weight) is at the given position ⟨[*x*](#center_x),[*y*](#center_y)⟩. This force modifies the positions of nodes on each application; it does not modify velocities, as doing so would typically cause the nodes to overshoot and oscillate around the desired center. +The centering force translates nodes uniformly so that the mean position of all nodes (the center of mass if all nodes have equal weight) is at the given position ⟨[*x*](#center_x),[*y*](#center_y)⟩. This force modifies the positions of nodes on each application; it does not modify velocities, as doing so would typically cause the nodes to overshoot and oscillate around the desired center. This force helps keeps nodes in the center of the viewport, and unlike the [positioning force](#positioning), it does not distort their relative positions. # d3.forceCenter([x, y]) @@ -150,9 +149,9 @@ If *x* is specified, sets the *x*-coordinate of the centering position to the sp If *y* is specified, sets the *y*-coordinate of the centering position to the specified number and returns this force. If *y* is not specified, returns the current *y*-coordinate, which defaults to zero. -#### Circle Collision +#### Collision -The circle collision force treats nodes as circles with a given [radius](#collide_radius), rather than points, and prevents nodes from overlapping. More formally, two nodes *a* and *b* are separated so that the distance between *a* and *b* is at least *radius*(*a*) + *radius*(*b*). To reduce jitter, this is by default a “soft” constraint with a configurable [strength](#collide_strength) and [iteration count](#collide_iterations). +The collision force treats nodes as circles with a given [radius](#collide_radius), rather than points, and prevents nodes from overlapping. More formally, two nodes *a* and *b* are separated so that the distance between *a* and *b* is at least *radius*(*a*) + *radius*(*b*). To reduce jitter, this is by default a “soft” constraint with a configurable [strength](#collide_strength) and [iteration count](#collide_iterations). # d3.forceCollide([radius]) @@ -180,26 +179,6 @@ Overlapping nodes are resolved through iterative relaxation. For each node, the If *iterations* is specified, sets the number of iterations per application to the specified number and returns this force. If *iterations* is not specified, returns the current iteration count which defaults to 1. Increasing the number of iterations greatly increases the rigidity of the constraint and avoids partial overlap of nodes, but also increases the runtime cost to evaluate the force. -#### Circle Containment - -The circle containment force constrains nodes to fit within a circle of a given [*radius*](#contain_radius) and center ⟨[*x*](#contain_x),[*y*](#contain_y)⟩. The radius and center can be specified on a per-node basis. (These parameters are only recomputed when the force is initialized, not on every application.) - -# d3.forceContain([radius[, x, y]]) - -… - -# contain.radius([radius]) - -… - -# contain.x([x]) - -… - -# contain.y([y]) - -… - #### Links The link force pushes linked nodes closer together or farther apart according to the desired [link distance](#link_distance), which may be specified on a per-node basis. (These parameters are only recomputed when the force is initialized, not on every application.)