d3-force-container
v0.0.1
Published
constrain particles to an area for forceSimulation in d3v4.
Downloads
4,869
Maintainers
Readme
d3-force-container
npm install d3-force-container
Constrain particles in a forceSimulation to a bounding box.
This examples uses the forceContainer to stop points from overlaping with the x axis
To use, pass an array with the position of the upper left and lower right corner of the bounding box to forceContainer:
var force = d3.forceSimulation(data)
.force("container", forceContainer([[10, 10],[890, 490]]))