MCPcopy
hub / github.com/csev/py4e / step

Function step

code/gmane/d3.layout.cloud.js:43–65  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

41 return cloud;
42
43 function step() {
44 var start = +new Date,
45 d;
46 while (+new Date - start < timeInterval && ++i < n && timer) {
47 d = data[i];
48 d.x = (size[0] * (Math.random() + .5)) >> 1;
49 d.y = (size[1] * (Math.random() + .5)) >> 1;
50 cloudSprite(d, data, i);
51 if (place(board, d, bounds)) {
52 tags.push(d);
53 event.word(d);
54 if (bounds) cloudBounds(bounds, d);
55 else bounds = [{x: d.x + d.x0, y: d.y + d.y0}, {x: d.x + d.x1, y: d.y + d.y1}];
56 // Temporary hack
57 d.x -= size[0] >> 1;
58 d.y -= size[1] >> 1;
59 }
60 }
61 if (i >= n) {
62 cloud.stop();
63 event.end(tags, bounds);
64 }
65 }
66 }
67
68 cloud.stop = function() {

Callers 7

ceilFunction · 0.70
offsetFunction · 0.70
rangeFunction · 0.70
cloudFunction · 0.70
ceilFunction · 0.50
offsetFunction · 0.50
rangeFunction · 0.50

Calls 4

cloudSpriteFunction · 0.70
placeFunction · 0.70
cloudBoundsFunction · 0.70
endMethod · 0.45

Tested by

no test coverage detected