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