flow like the river
This commit is contained in:
commit
013fe673f3
42435 changed files with 5764238 additions and 0 deletions
14
VISUALIZACION/node_modules/d3-binarytree/src/visit.js
generated
vendored
Executable file
14
VISUALIZACION/node_modules/d3-binarytree/src/visit.js
generated
vendored
Executable file
|
|
@ -0,0 +1,14 @@
|
|||
import Half from "./half.js";
|
||||
|
||||
export default function(callback) {
|
||||
var halves = [], q, node = this._root, child, x0, x1;
|
||||
if (node) halves.push(new Half(node, this._x0, this._x1));
|
||||
while (q = halves.pop()) {
|
||||
if (!callback(node = q.node, x0 = q.x0, x1 = q.x1) && node.length) {
|
||||
var xm = (x0 + x1) / 2;
|
||||
if (child = node[1]) halves.push(new Half(child, xm, x1));
|
||||
if (child = node[0]) halves.push(new Half(child, x0, xm));
|
||||
}
|
||||
}
|
||||
return this;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue