MCPcopy Index your code
hub / github.com/d3/d3-force / initializeNodes

Function initializeNodes

src/simulation.js:63–77  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

61 }
62
63 function initializeNodes() {
64 for (var i = 0, n = nodes.length, node; i < n; ++i) {
65 node = nodes[i], node.index = i;
66 if (node.fx != null) node.x = node.fx;
67 if (node.fy != null) node.y = node.fy;
68 if (isNaN(node.x) || isNaN(node.y)) {
69 var radius = initialRadius * Math.sqrt(0.5 + i), angle = i * initialAngle;
70 node.x = radius * Math.cos(angle);
71 node.y = radius * Math.sin(angle);
72 }
73 if (isNaN(node.vx) || isNaN(node.vy)) {
74 node.vx = node.vy = 0;
75 }
76 }
77 }
78
79 function initializeForce(force) {
80 if (force.initialize) force.initialize(nodes, random);

Callers 1

simulation.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…