js/directives.js
// Move d to be adjacent to the cluster node.
Move d to be adjacent to the cluster node.
Move d to be adjacent to the cluster node .
function cluster(alpha) {
                            return function(d) {
                                var cluster = clusters[d.cluster];
                                if (cluster === d) {
                                    return;
                                }
                                var x = d.x - cluster.x,
                                    y = d.y - cluster.y,
                                    l = Math.sqrt(x * x + y * y),
                                    r = d.radius + cluster.radius;
                                if (l !== r) {
                                    l = (l - r) / l * alpha;
                                    d.x -= x *= l;
                                    d.y -= y *= l;
                                    cluster.x += x;
                                    cluster.y += y;
                                }
                            };
                        }
function cluster ( alpha ) { return function ( d ) { var cluster = clusters [ d . cluster ] ; if ( cluster === d ) { return ; } var x = d . x - cluster . x , y = d . y - cluster . y , l = Math . sqrt ( x * x + y * y ) , r = d . radius + cluster . radius ; if ( l !== r ) { l = ( l - r ) / l * alpha ; d . x -= x *= l ; d . y -= y *= l ; cluster . x += x ; cluster . y += y ; } } ; }
Move d to be adjacent to the cluster node.
Move d to be adjacent to the cluster node .