แก้ coding style ภาค 8
This commit is contained in:
@@ -78,11 +78,11 @@ export default function () {
|
||||
// Apply the Barnes-Hut approximation if possible.
|
||||
// Limit forces for very close nodes; randomize direction if coincident.
|
||||
if (w / l < theta) {
|
||||
if (x === 0) {x = jiggle(); l += x * x;}
|
||||
if (y === 0) {y = jiggle(); l += y * y;}
|
||||
if (x === 0) { x = jiggle(); l += x * x; }
|
||||
if (y === 0) { y = jiggle(); l += y * y; }
|
||||
if (quad.data) {
|
||||
l = (l - +distance(node, quad.data)) / l * alpha;
|
||||
x *= l, y *= l;
|
||||
x *= l; y *= l;
|
||||
quad.data.vx -= x;
|
||||
quad.data.vy -= y;
|
||||
node.vx += x;
|
||||
@@ -93,8 +93,8 @@ export default function () {
|
||||
|
||||
// Limit forces for very close nodes; randomize direction if coincident.
|
||||
if (quad.data !== node || quad.next) {
|
||||
if (x === 0) {x = jiggle(); l += x * x;}
|
||||
if (y === 0) {y = jiggle(); l += y * y;}
|
||||
if (x === 0) { x = jiggle(); l += x * x; }
|
||||
if (y === 0) { y = jiggle(); l += y * y; }
|
||||
}
|
||||
|
||||
do {
|
||||
|
||||
@@ -36,7 +36,7 @@ export default function (sim, forceS, forceF) {
|
||||
simulation = sim,
|
||||
forceSample = forceS,
|
||||
forceFull = forceF,
|
||||
event = d3.dispatch('sampleTick', 'fullTick', 'startInterp', 'end'),
|
||||
event = dispatch('sampleTick', 'fullTick', 'startInterp', 'end'),
|
||||
initAlready = false,
|
||||
nodes,
|
||||
alreadyRanIterations,
|
||||
|
||||
Reference in New Issue
Block a user