()
| 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); |
no outgoing calls
no test coverage detected
searching dependent graphs…