Circle collision detection for D3
run npm install d3-circleCollision
const d3CircleCollision = require('d3-circleCollision');
https://cdn.jsdelivr.net/npm/d3-circle-collision@1.0.0/dist/d3-circleCollision.min.js
<script src="https://cdn.jsdelivr.net/npm/d3-circle-collision@1.0.0/dist/d3-circleCollision.min.js"></script>
Download the latest release.
# circleCollision(circles, hide)
takes in a selection of circles and whether the old circles should be hidden or not and returns an array of objects. Each object in the array represents a group in which the circles collide and contains the collision coordinates and the combined data in the form of an array of the collided circles.