(dimension, size)
| 5328 | |
| 5329 | // initialize node position based on first neighbor |
| 5330 | function position(dimension, size) { |
| 5331 | var neighbors = neighbor(i), |
| 5332 | j = -1, |
| 5333 | m = neighbors.length, |
| 5334 | x; |
| 5335 | while (++j < m) if (!isNaN(x = neighbors[j][dimension])) return x; |
| 5336 | return Math.random() * size; |
| 5337 | } |
| 5338 | |
| 5339 | // initialize neighbors lazily |
| 5340 | function neighbor() { |