MCPcopy Create free account
hub / github.com/breck7/scroll / initializeNodes

Function initializeNodes

external/.d3.js:9139–9153  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

9137 }
9138
9139 function initializeNodes() {
9140 for (var i = 0, n = nodes.length, node; i < n; ++i) {
9141 node = nodes[i], node.index = i;
9142 if (node.fx != null) node.x = node.fx;
9143 if (node.fy != null) node.y = node.fy;
9144 if (isNaN(node.x) || isNaN(node.y)) {
9145 var radius = initialRadius * Math.sqrt(0.5 + i), angle = i * initialAngle;
9146 node.x = radius * Math.cos(angle);
9147 node.y = radius * Math.sin(angle);
9148 }
9149 if (isNaN(node.vx) || isNaN(node.vy)) {
9150 node.vx = node.vy = 0;
9151 }
9152 }
9153 }
9154
9155 function initializeForce(force) {
9156 if (force.initialize) force.initialize(nodes, random);

Callers 1

simulationFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected