diff --git a/lib/forceCluster.js b/lib/forceCluster.js index 2c9f1ff..64ebbda 100644 --- a/lib/forceCluster.js +++ b/lib/forceCluster.js @@ -25,7 +25,7 @@ function cluster (centers) { x = d.x - c.x, y = d.y - c.y, l = Math.sqrt(x * x + y * y), - r = d.radius + (c.radius || 0); + r = d.radius || 1 + (c.radius || 0); if (l && l != r) { l = (l - r) / l * alpha; @@ -96,4 +96,4 @@ function cluster (centers) { } -export default cluster; \ No newline at end of file +export default cluster;