MCPcopy Index your code
hub / github.com/csev/py4e / position

Function position

code/gmane/d3.v3.js:6411–6426  ·  view source on GitHub ↗
(dimension, size)

Source from the content-addressed store, hash-verified

6409 charges = [];
6410 if (typeof charge === "function") for (i = 0; i < n; ++i) charges[i] = +charge.call(this, nodes[i], i); else for (i = 0; i < n; ++i) charges[i] = charge;
6411 function position(dimension, size) {
6412 if (!neighbors) {
6413 neighbors = new Array(n);
6414 for (j = 0; j < n; ++j) {
6415 neighbors[j] = [];
6416 }
6417 for (j = 0; j < m; ++j) {
6418 var o = links[j];
6419 neighbors[o.source.index].push(o.target);
6420 neighbors[o.target.index].push(o.source);
6421 }
6422 }
6423 var candidates = neighbors[i], j = -1, l = candidates.length, x;
6424 while (++j < l) if (!isNaN(x = candidates[j][dimension])) return x;
6425 return Math.random() * size;
6426 }
6427 return force.resume();
6428 };
6429 force.resume = function() {

Callers 7

dragstartFunction · 0.70
movedFunction · 0.70
endedFunction · 0.70
d3.v3.jsFile · 0.70
partitionFunction · 0.70
squarifyFunction · 0.70
stickifyFunction · 0.70

Calls 1

roundFunction · 0.70

Tested by

no test coverage detected