MCPcopy
hub / github.com/palantir/plottable / split

Method split

src/utils/rTree.ts:369–390  ·  view source on GitHub ↗

* Splits this node by creating two new nodes and dividing the this node's * children between them. This node is removed from its parent and the two * new nodes are added. * * If this node is the root, a new parent node is created. * * Returns the parent node.

(strategy: IRTreeSplitStrategy)

Source from the content-addressed store, hash-verified

367 * Returns the parent node.
368 */
369 public split(strategy: IRTreeSplitStrategy): RTreeNode<T> {
370 // Remove self from parent.
371 if (this.parent != null) {
372 this.parent.remove(this);
373 }
374
375 // Create children from split
376 const children: NodePair<T> = [
377 new RTreeNode<T>(this.leaf),
378 new RTreeNode<T>(this.leaf),
379 ];
380 strategy.split(this.entries, children);
381
382 // Add new nodes to parent
383 // If root, create new non-leaf node as parent.
384 const parent = this.parent != null ? this.parent : new RTreeNode<T>(false);
385 parent.insert(children[0]);
386 parent.insert(children[1]);
387 // Always make the parent a non-leaf after split
388 parent.leaf = false;
389 return parent;
390 }
391
392 /**
393 * Returns the difference in area that adding an entry `bounds` to the node

Callers 11

Gruntfile.jsFile · 0.45
decomposePathFunction · 0.45
tokenizePathStringFunction · 0.45
areaVerticesFunction · 0.45
blanket_mocha.jsFile · 0.45
parseTransformMatrixFunction · 0.45
insertMethod · 0.45
colorTestFunction · 0.45
getStrokeDashArrayFunction · 0.45

Calls 2

removeMethod · 0.65
insertMethod · 0.45

Tested by

no test coverage detected