UNPKG

create-gojs-kit

Version:

A CLI for downloading GoJS samples, extensions, and docs

167 lines 65.2 kB
<!DOCTYPE html><html class="default" lang="en"><head><meta charSet="utf-8"/><link rel="stylesheet" href="../../assets/css/style.css"/><link rel="preconnect" href="https://rsms.me/"/><link rel="stylesheet" href="https://rsms.me/inter/inter.css"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>Quadtree | GoJS API</title><meta name="description" content="Documentation for GoJS API"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><link rel="stylesheet" href="../assets/custom.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script><script type="text/javascript">// formerly in api.js
  var hash = null;
  function changeHash() {
      var panels = document.getElementsByClassName("tsd-panel");
      for (let i = 0; i < panels.length; i++) {
          var p = panels[i];
          p.classList.remove("targeted");
      }
      hash = window.location.hash.slice(1);
      if (hash) {
          var elt = document.getElementById(hash);
          if (elt) elt.parentNode.classList.add("targeted");
      }
  }
  document.addEventListener("DOMContentLoaded", changeHash);
  window.addEventListener("hashchange", changeHash);</script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500)</script><header><nav id="navTop" class="w-full h-[var(--topnav-h)] z-30 bg-[var(--color-background-secondary)] border-b border-b-[var(--color-accent)]"><div class="max-w-screen-xl mx-auto flex flex-wrap items-start justify-between px-4"><a class="!text-white bg-nwoods-primary font-bold !leading-[calc(var(--topnav-h)_-_1px)] my-0 px-2 text-4xl lg:text-5xl logo" href="../../index.html">GoJS</a><div class="relative"><button id="topnavButton" class="h-[calc(var(--topnav-h)_-_1px)] px-2 m-0 text-[var(--color-text)] bg-inherit shadow-none md:hidden hover:!bg-inherit hover:!text-nwoods-accent hover:!shadow-none" aria-label="Navigation"><svg class="h-7 w-7 block" aria-hidden="true" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24"><path d="M3.75 6.75h16.5M3.75 12h16.5m-16.5 5.25h16.5" stroke-linecap="round" stroke-linejoin="round"></path></svg></button><div id="topnavList" class="hidden md:block"><div class="absolute right-0 z-30 flex flex-col items-end rounded border border-[var(--color-accent)] p-4 pl-12 shadow bg-[var(--color-background-secondary)] text-[var(--color-text)] font-semibold
                        md:flex-row md:space-x-4 md:items-start md:border-0 md:p-0 md:shadow-none md:!bg-inherit"><a href="../../learn/index.html">Learn</a><a href="../../samples/index.html">Samples</a><a href="../../intro/index.html">Intro</a><a class="active" href="../../api/index.html">API</a><a href="../../download.html">Download</a><a href="https://forum.nwoods.com/c/gojs/11" target="_blank" rel="noopener">Forum</a><a href="https://nwoods.com/contact.html" target="_blank" rel="noopener" id="contactBtn">Contact</a><a href="https://nwoods.com/sales/index.html" target="_blank" rel="noopener" id="buyBtn">Buy</a></div></div></div></div></nav><script>window.addEventListener("DOMContentLoaded", function () {
    // topnav
    var topButton = document.getElementById("topnavButton");
    var topnavList = document.getElementById("topnavList");
    if (topButton && topnavList) {
      topButton.addEventListener("click", function (e) {
        topnavList
          .classList
          .toggle("hidden");
        e.stopPropagation();
      });
      document.addEventListener("click", function (e) {
        // if the clicked element isn't the list, close the list
        if (!topnavList.classList.contains("hidden") && !e.target.closest("#topnavList")) {
          topButton.click();
        }
      });

      // set active <a> element
      // done via active tag below, always API
    }
  });</script><div class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><div class="table-cell" id="tsd-search" data-base=".."><div class="field"><div id="tsd-search-help"><code class="!text-lg">/</code> to search</div><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-search"></use></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div><div class="field"><div id="tsd-toolbar-links"></div></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">GoJS API</a></div><div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></div></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><div class="flex w-full max-w-screen-xl mx-auto px-2 items-center justify-between"><div><ul class="tsd-breadcrumb"><li><a href="../index.html">GoJS API</a></li><li><a href="Quadtree.html">Quadtree</a></li></ul><h1 class="flex items-center">Class Quadtree&lt;T&gt;</h1></div><div class="text-xs"><b>GoJS</b>® Diagramming Components<br/>version 3.1.0<br/>by <a href="https://nwoods.com/">Northwoods Software®</a></div></div></div><section class="tsd-panel tsd-extension"><p>This is an extension and not part of the main GoJS library. Note that the API for this class may change at any time. If you intend to use an extension in production, you should copy the code to your own source directory. See the <a href="../../intro/extensions.html">Extensions intro page</a> for more information.</p></section><section class="tsd-panel tsd-comment"><div class="tsd-comment tsd-typography"><p>Implementation of the quadtree data structure using the <a href="Rect.html" class="tsd-kind-class">go.Rect</a> class.
Each Quadtree has defined bounds found at <a href="Quadtree.html#bounds" class="tsd-kind-accessor">bounds</a>, an array
of member rectangles, and an array of child nodes
(Quadtrees themselves). If the Quadtree has no
children, the nodes array will have four nulls. To construct a Quadtree, you
can call its constructor with no arguments. Then, to insert a rectangle, call
<a href="Quadtree.html#add" class="tsd-kind-method">add</a>. This tree supports adding points (rectangles with 0
width and height), segments (rectangles with either 0 width or 0 height), and
rectangles with nonzero widths and heights.</p>
<p>Quadtrees can be used to calculate intersections extremely quickly between a
given rectangle and all of the rectangles in the quadtree. Use of this data
structure prevents having to do precise intersection calculations for every
rectangle in the tree. To calculate all of the rectangular intersections for
a given rectangle, use <a href="Quadtree.html#intersecting" class="tsd-kind-method">intersecting</a>.</p>
<p>Other common operations are detailed below.</p>
</div></section> <section class="tsd-panel"><h4>Type Parameters</h4><ul class="tsd-type-parameter-list"><li><span><a id="T" class="tsd-anchor"></a><span class="tsd-kind-type-parameter">T</span></span></li></ul></section> <section class="tsd-panel-group tsd-index-group"><section class="tsd-panel tsd-index-panel"><details class="tsd-index-content tsd-index-accordion" open><summary class="tsd-accordion-summary tsd-index-summary"><h5 class="tsd-index-heading uppercase" role="button" aria-expanded="true" tabIndex="0"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-chevronSmall"></use></svg> Index</h5></summary><div class="tsd-accordion-details"><section class="tsd-index-section"><h3 class="tsd-index-heading">Constructors</h3><div class="tsd-index-list"><a href="Quadtree.html#constructor" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-512"></use></svg><span>constructor</span></a>
</div></section><section class="tsd-index-section"><h3 class="tsd-index-heading">Accessors</h3><div class="tsd-index-list"><a href="Quadtree.html#bounds" class="tsd-index-link"><svg class="readonly tsd-subicon" viewBox="0 0 28 28"><g id="subicon-R,#FF4D4D"><rect fill="var(--color-icon-background)" width="28" height="28" rx="14"></rect><path transform="translate(2, 2)" fill="none" stroke-width="1.5" stroke="var(--color-text)" d="M16.5 10.5V6.75a4.5 4.5 0 1 0-9 0v3.75m-.75 11.25h10.5a2.25 2.25 0 0 0 2.25-2.25v-6.75a2.25 2.25 0 0 0-2.25-2.25H6.75a2.25 2.25 0 0 0-2.25 2.25v6.75a2.25 2.25 0 0 0 2.25 2.25Z" stroke-linecap="round" stroke-linejoin="round"></path></g></svg><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-262144"></use></svg><span>bounds</span></a>
<a href="Quadtree.html#maxLevels" class="tsd-index-link"><svg class="readonly tsd-subicon" viewBox="0 0 28 28"><use href="#subicon-R,#FF4D4D"></use></svg><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-262144"></use></svg><span>max<wbr/>Levels</span></a>
<a href="Quadtree.html#nodeCapacity" class="tsd-index-link"><svg class="readonly tsd-subicon" viewBox="0 0 28 28"><use href="#subicon-R,#FF4D4D"></use></svg><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-262144"></use></svg><span>node<wbr/>Capacity</span></a>
<a href="Quadtree.html#root" class="tsd-index-link"><svg class="readonly tsd-subicon" viewBox="0 0 28 28"><use href="#subicon-R,#FF4D4D"></use></svg><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-262144"></use></svg><span>root</span></a>
</div></section><section class="tsd-index-section"><h3 class="tsd-index-heading">Methods</h3><div class="tsd-index-list"><a href="Quadtree.html#add" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>add</span></a>
<a href="Quadtree.html#clear" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>clear</span></a>
<a href="Quadtree.html#containing" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>containing</span></a>
<a href="Quadtree.html#distanceSquared" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>distance<wbr/>Squared</span></a>
<a href="Quadtree.html#find" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>find</span></a>
<a href="Quadtree.html#findBounds" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>find<wbr/>Bounds</span></a>
<a href="Quadtree.html#findExtremeObjects" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>find<wbr/>Extreme<wbr/>Objects</span></a>
<a href="Quadtree.html#forEach" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>for<wbr/>Each</span></a>
<a href="Quadtree.html#has" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>has</span></a>
<a href="Quadtree.html#intersecting" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>intersecting</span></a>
<a href="Quadtree.html#move" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>move</span></a>
<a href="Quadtree.html#remove" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>remove</span></a>
<a href="Quadtree.html#resize" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>resize</span></a>
<a href="Quadtree.html#setTo" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>set<wbr/>To</span></a>
<a href="Quadtree.html#walk" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>walk</span></a>
</div></section></div></details></section></section><section class="tsd-panel-group tsd-member-group"><h2>Constructors</h2><section class="tsd-panel tsd-member"><a id="constructor" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>constructor</span><a href="#constructor" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="constructor.new_Quadtree" class="tsd-anchor"></a><span class="tsd-kind-constructor-signature">new <wbr/>Quadtree</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type tsd-kind-type-parameter">T</span><span class="tsd-signature-symbol">&gt;</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">nodeCapacity</span><span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">number</span>, <span class="tsd-kind-parameter">maxLevel</span><span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">number</span>, <span class="tsd-kind-parameter">bounds</span><span class="tsd-signature-symbol">?: </span><a href="Rect.html" class="tsd-signature-type tsd-kind-class">Rect</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="Quadtree.html" class="tsd-signature-type tsd-kind-class">Quadtree</a><span class="tsd-signature-symbol">&lt;</span><a class="tsd-signature-type tsd-kind-type-parameter" href="Quadtree.html#constructor.new_Quadtree.T-1">T</a><span class="tsd-signature-symbol">&gt;</span><a href="#constructor.new_Quadtree" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>In most cases, simply calling this constructor with no arguments will produce the desired behaviour.</p>
</div><section class="tsd-panel"><h4>Type Parameters</h4><ul class="tsd-type-parameter-list"><li><span><a id="constructor.new_Quadtree.T-1" class="tsd-anchor"></a><span class="tsd-kind-type-parameter">T</span></span></li></ul></section><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><h5><code class="tsd-tag ts-flagOptional">Optional</code> <span class="tsd-kind-parameter">nodeCapacity</span>: <span class="tsd-signature-type">number</span></h5><div class="tsd-comment tsd-typography"><p>The node capacity of this quadtree. This is the number of objects a node can contain before it splits. Defaults to 1.</p>
</div></li><li><h5><code class="tsd-tag ts-flagOptional">Optional</code> <span class="tsd-kind-parameter">maxLevel</span>: <span class="tsd-signature-type">number</span></h5><div class="tsd-comment tsd-typography"><p>The maximum depth the Quadtree will allow before it will no longer split. Defaults to Infinity (no maximum depth).</p>
</div></li><li><h5><code class="tsd-tag ts-flagOptional">Optional</code> <span class="tsd-kind-parameter">bounds</span>: <a href="Rect.html" class="tsd-signature-type tsd-kind-class">Rect</a></h5><div class="tsd-comment tsd-typography"><p>The bounding box surrounding the entire Quadtree. If the bounds are unset or a node is inserted outside of the bounds, the tree will automatically grow.</p>
</div></li></ul></div><h4 class="tsd-returns-title">Returns <a href="Quadtree.html" class="tsd-signature-type tsd-kind-class">Quadtree</a><span class="tsd-signature-symbol">&lt;</span><a class="tsd-signature-type tsd-kind-type-parameter" href="Quadtree.html#constructor.new_Quadtree.T-1">T</a><span class="tsd-signature-symbol">&gt;</span></h4></li></ul></section></section><section class="tsd-panel-group tsd-member-group"><h2>Accessors</h2><section class="tsd-panel tsd-member"><a id="bounds" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagReadOnly">Readonly</code><span>bounds</span><div class="membertype"><span class="tsd-signature-symbol">: </span><a href="Rect.html" class="tsd-signature-type tsd-kind-class">Rect</a></div><a href="#bounds" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Gets the boundaries of the node. All nodes should be square.</p>
</div></li></ul></section><section class="tsd-panel tsd-member"><a id="maxLevels" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagReadOnly">Readonly</code><span>max<wbr/>Levels</span><div class="membertype"><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span></div><a href="#maxLevels" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Gets the maximum depth the Quadtree will allow before it will no longer split..</p>
</div></li></ul></section><section class="tsd-panel tsd-member"><a id="nodeCapacity" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagReadOnly">Readonly</code><span>node<wbr/>Capacity</span><div class="membertype"><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span></div><a href="#nodeCapacity" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Gets the node capacity of this quadtree. This is the number of objects a node can contain before it splits.</p>
</div></li></ul></section><section class="tsd-panel tsd-member"><a id="root" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagReadOnly">Readonly</code><span>root</span><div class="membertype"><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">QuadNode</span><span class="tsd-signature-symbol">&lt;</span><a class="tsd-signature-type tsd-kind-type-parameter" href="Quadtree.html#constructor.new_Quadtree.T-1">T</a><span class="tsd-signature-symbol">&gt;</span></div><a href="#root" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Gets the root node of the tree</p>
</div></li></ul></section></section><section class="tsd-panel-group tsd-member-group"><h2>Methods</h2><section class="tsd-panel tsd-member"><a id="add" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>add</span><a href="#add" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="add.add-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">add</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">obj</span><span class="tsd-signature-symbol">: </span><a class="tsd-signature-type tsd-kind-type-parameter" href="Quadtree.html#constructor.new_Quadtree.T-1">T</a><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">QuadObj</span><span class="tsd-signature-symbol">&lt;</span><a class="tsd-signature-type tsd-kind-type-parameter" href="Quadtree.html#constructor.new_Quadtree.T-1">T</a><span class="tsd-signature-symbol">&gt;</span>, <span class="tsd-kind-parameter">x</span><span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol"> | </span><a href="Point.html" class="tsd-signature-type tsd-kind-class">Point</a><span class="tsd-signature-symbol"> | </span><a href="Rect.html" class="tsd-signature-type tsd-kind-class">Rect</a>, <span class="tsd-kind-parameter">y</span><span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol"> | </span><a href="Point.html" class="tsd-signature-type tsd-kind-class">Point</a><span class="tsd-signature-symbol"> | </span><a href="Size.html" class="tsd-signature-type tsd-kind-class">Size</a>, <span class="tsd-kind-parameter">w</span><span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">number</span>, <span class="tsd-kind-parameter">h</span><span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span><a href="#add.add-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Insert the object into the quadtree. If the node
exceeds the capacity, it will split and add all
objects to their corresponding nodes. If the object is
outside the bounds of the tree&#39;s root node, the tree
will grow to accomodate it. Possibly restructures the
tree if a more efficient configuration can be found with
the new dimensions. Bounds can be given either as a
single <a href="Rect.html" class="tsd-kind-class">go.Rect</a> or as any combination of arguments
which is valid for the <a href="Rect.html" class="tsd-kind-class">go.Rect</a> constructor.</p>
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><h5><span class="tsd-kind-parameter">obj</span>: <a class="tsd-signature-type tsd-kind-type-parameter" href="Quadtree.html#constructor.new_Quadtree.T-1">T</a><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">QuadObj</span><span class="tsd-signature-symbol">&lt;</span><a class="tsd-signature-type tsd-kind-type-parameter" href="Quadtree.html#constructor.new_Quadtree.T-1">T</a><span class="tsd-signature-symbol">&gt;</span></h5><div class="tsd-comment tsd-typography"><p>the object to insert</p>
</div></li><li><h5><code class="tsd-tag ts-flagOptional">Optional</code> <span class="tsd-kind-parameter">x</span>: <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol"> | </span><a href="Point.html" class="tsd-signature-type tsd-kind-class">Point</a><span class="tsd-signature-symbol"> | </span><a href="Rect.html" class="tsd-signature-type tsd-kind-class">Rect</a></h5><div class="tsd-comment tsd-typography"><p>The Rect bounds of the object, or top-left Point, or x value.</p>
</div></li><li><h5><code class="tsd-tag ts-flagOptional">Optional</code> <span class="tsd-kind-parameter">y</span>: <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol"> | </span><a href="Point.html" class="tsd-signature-type tsd-kind-class">Point</a><span class="tsd-signature-symbol"> | </span><a href="Size.html" class="tsd-signature-type tsd-kind-class">Size</a></h5><div class="tsd-comment tsd-typography"><p>Bottom-right Point or Size or y value.</p>
</div></li><li><h5><code class="tsd-tag ts-flagOptional">Optional</code> <span class="tsd-kind-parameter">w</span>: <span class="tsd-signature-type">number</span></h5><div class="tsd-comment tsd-typography"><p>Width to be used if x,y are specified;
must be non-negative.</p>
</div></li><li><h5><code class="tsd-tag ts-flagOptional">Optional</code> <span class="tsd-kind-parameter">h</span>: <span class="tsd-signature-type">number</span></h5><div class="tsd-comment tsd-typography"><p>Height to be used if x,y are specified;</p>
</div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></section><section class="tsd-panel tsd-member"><a id="clear" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>clear</span><a href="#clear" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="clear.clear-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">clear</span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span><a href="#clear.clear-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Clears the Quadtree, removing all objects and children nodes. Keeps the current bounds of the root node.</p>
</div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></section><section class="tsd-panel tsd-member"><a id="containing" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>containing</span><a href="#containing" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="containing.containing-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">containing</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">rect</span><span class="tsd-signature-symbol">: </span><a href="Point.html" class="tsd-signature-type tsd-kind-class">Point</a><span class="tsd-signature-symbol"> | </span><a href="Rect.html" class="tsd-signature-type tsd-kind-class">Rect</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a class="tsd-signature-type tsd-kind-type-parameter" href="Quadtree.html#constructor.new_Quadtree.T-1">T</a><span class="tsd-signature-symbol">[]</span><a href="#containing.containing-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Return all objects that fully contain the given <a href="Rect.html" class="tsd-kind-class">go.Rect</a> or <a href="Point.html" class="tsd-kind-class">go.Point</a>.</p>
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><h5><span class="tsd-kind-parameter">rect</span>: <a href="Point.html" class="tsd-signature-type tsd-kind-class">Point</a><span class="tsd-signature-symbol"> | </span><a href="Rect.html" class="tsd-signature-type tsd-kind-class">Rect</a></h5><div class="tsd-comment tsd-typography"><p>the Rect or Point to check containing for. If a point is given, a Rect with size (0, 0) is created for containment calculations.</p>
</div></li></ul></div><h4 class="tsd-returns-title">Returns <a class="tsd-signature-type tsd-kind-type-parameter" href="Quadtree.html#constructor.new_Quadtree.T-1">T</a><span class="tsd-signature-symbol">[]</span></h4><p>array containing all containing objects</p>
</li></ul></section><section class="tsd-panel tsd-member"><a id="distanceSquared" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>distance<wbr/>Squared</span><a href="#distanceSquared" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="distanceSquared.distanceSquared-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">distance<wbr/>Squared</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">obj1</span><span class="tsd-signature-symbol">: </span><a class="tsd-signature-type tsd-kind-type-parameter" href="Quadtree.html#constructor.new_Quadtree.T-1">T</a>, <span class="tsd-kind-parameter">obj2</span><span class="tsd-signature-symbol">: </span><a class="tsd-signature-type tsd-kind-type-parameter" href="Quadtree.html#constructor.new_Quadtree.T-1">T</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><a href="#distanceSquared.distanceSquared-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Returns the square of the distance from the centers of the given objects</p>
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><h5><span class="tsd-kind-parameter">obj1</span>: <a class="tsd-signature-type tsd-kind-type-parameter" href="Quadtree.html#constructor.new_Quadtree.T-1">T</a></h5></li><li><h5><span class="tsd-kind-parameter">obj2</span>: <a class="tsd-signature-type tsd-kind-type-parameter" href="Quadtree.html#constructor.new_Quadtree.T-1">T</a></h5></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">number</span></h4><p>square of the distance between the centers of obj1 and obj2</p>
</li></ul></section><section class="tsd-panel tsd-member"><a id="find" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>find</span><a href="#find" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="find.find-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">find</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">obj</span><span class="tsd-signature-symbol">: </span><a class="tsd-signature-type tsd-kind-type-parameter" href="Quadtree.html#constructor.new_Quadtree.T-1">T</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">QuadNode</span><span class="tsd-signature-symbol">&lt;</span><a class="tsd-signature-type tsd-kind-type-parameter" href="Quadtree.html#constructor.new_Quadtree.T-1">T</a><span class="tsd-signature-symbol">&gt;</span><a href="#find.find-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Return the node that contains the given object.</p>
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><h5><span class="tsd-kind-parameter">obj</span>: <a class="tsd-signature-type tsd-kind-type-parameter" href="Quadtree.html#constructor.new_Quadtree.T-1">T</a></h5><div class="tsd-comment tsd-typography"><p>the object to find</p>
</div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">QuadNode</span><span class="tsd-signature-symbol">&lt;</span><a class="tsd-signature-type tsd-kind-type-parameter" href="Quadtree.html#constructor.new_Quadtree.T-1">T</a><span class="tsd-signature-symbol">&gt;</span></h4><p>the node containing the given object, null if the object is not found</p>
</li></ul></section><section class="tsd-panel tsd-member"><a id="findBounds" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>find<wbr/>Bounds</span><a href="#findBounds" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="findBounds.findBounds-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">find<wbr/>Bounds</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">bounds</span><span class="tsd-signature-symbol">: </span><a href="Rect.html" class="tsd-signature-type tsd-kind-class">Rect</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="Rect.html" class="tsd-signature-type tsd-kind-class">Rect</a><a href="#findBounds.findBounds-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Checks if any of the objects in the tree have the given boundaries</p>
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><h5><span class="tsd-kind-parameter">bounds</span>: <a href="Rect.html" class="tsd-signature-type tsd-kind-class">Rect</a></h5><div class="tsd-comment tsd-typography"><p>the rectangle to check for</p>
</div></li></ul></div><h4 class="tsd-returns-title">Returns <a href="Rect.html" class="tsd-signature-type tsd-kind-class">Rect</a></h4><p>the actual bounds object stored in the tree</p>
</li></ul></section><section class="tsd-panel tsd-member"><a id="findExtremeObjects" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>find<wbr/>Extreme<wbr/>Objects</span><a href="#findExtremeObjects" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="findExtremeObjects.findExtremeObjects-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">find<wbr/>Extreme<wbr/>Objects</span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">[</span><a class="tsd-signature-type tsd-kind-type-parameter" href="Quadtree.html#constructor.new_Quadtree.T-1">T</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="Quadtree.html#constructor.new_Quadtree.T-1">T</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="Quadtree.html#constructor.new_Quadtree.T-1">T</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="Quadtree.html#constructor.new_Quadtree.T-1">T</a><span class="tsd-signature-symbol">]</span><a href="#findExtremeObjects.findExtremeObjects-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Finds the most furthest object in each direction stored in the tree.
Bounds are tested using the center x and y coordinate.</p>
</div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-symbol">[</span><a class="tsd-signature-type tsd-kind-type-parameter" href="Quadtree.html#constructor.new_Quadtree.T-1">T</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="Quadtree.html#constructor.new_Quadtree.T-1">T</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="Quadtree.html#constructor.new_Quadtree.T-1">T</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="Quadtree.html#constructor.new_Quadtree.T-1">T</a><span class="tsd-signature-symbol">]</span></h4><p>maximum and minimum objects in the tree, in the format [min x, max x, min y, max y].</p>
</li></ul></section><section class="tsd-panel tsd-member"><a id="forEach" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>for<wbr/>Each</span><a href="#forEach" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="forEach.forEach-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">for<wbr/>Each</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">callback</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">obj</span><span class="tsd-signature-symbol">: </span><a class="tsd-signature-type tsd-kind-type-parameter" href="Quadtree.html#constructor.new_Quadtree.T-1">T</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> =&gt; </span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span><a href="#forEach.forEach-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Visits every object stored in the tree (depth first)</p>
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><h5><span class="tsd-kind-parameter">callback</span>: <span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">obj</span><span class="tsd-signature-symbol">: </span><a class="tsd-signature-type tsd-kind-type-parameter" href="Quadtree.html#constructor.new_Quadtree.T-1">T</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> =&gt; </span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">)</span></h5><div class="tsd-comment tsd-typography"><p>the callback to execute on each object.</p>
</div><ul class="tsd-parameters"><li class="tsd-parameter-signature"><ul class="tsd-signatures"><li class="tsd-signature"><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">obj</span><span class="tsd-signature-symbol">: </span><a class="tsd-signature-type tsd-kind-type-parameter" href="Quadtree.html#constructor.new_Quadtree.T-1">T</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li><li class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><h5><span class="tsd-kind-parameter">obj</span>: <a class="tsd-signature-type tsd-kind-type-parameter" href="Quadtree.html#constructor.new_Quadtree.T-1">T</a></h5></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></li></ul></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></section><section class="tsd-panel tsd-member"><a id="has" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>has</span><a href="#has" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="has.has-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">has</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">obj</span><span class="tsd-signature-symbol">: </span><a class="tsd-signature-type tsd-kind-type-parameter" href="Quadtree.html#constructor.new_Quadtree.T-1">T</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span><a href="#has.has-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Convenience method, calls <a href="Quadtree.html#find" class="tsd-kind-method">find</a> and returns a boolean
indicating whether or not the tree contains the given object</p>
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><h5><span class="tsd-kind-parameter">obj</span>: <a class="tsd-signature-type tsd-kind-type-parameter" href="Quadtree.html#constructor.new_Quadtree.T-1">T</a></h5><div class="tsd-comment tsd-typography"><p>the object to check for</p>
</div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">boolean</span></h4><p>whether or not the given object is present in the tree</p>
</li></ul></section><section class="tsd-panel tsd-member"><a id="intersecting" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>intersecting</span><a href="#intersecting" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="intersecting.intersecting-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">intersecting</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">rect</span><span class="tsd-signature-symbol">: </span><a href="Point.html" class="tsd-signature-type tsd-kind-class">Point</a><span class="tsd-signature-symbol"> | </span><a href="Rect.html" class="tsd-signature-type tsd-kind-class">Rect</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a class="tsd-signature-type tsd-kind-type-parameter" href="Quadtree.html#constructor.new_Quadtree.T-1">T</a><span class="tsd-signature-symbol">[]</span><a href="#intersecting.intersecting-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Return all objects that intersect (wholly or partially) with
the given <a href="Rect.html" class="tsd-kind-class">go.Rect</a> or <a href="Point.html" class="tsd-kind-class">go.Point</a>. Touching edges and
objects overlapping by 1e-7 or less (to account for floating
point error) are both not considered intersections.</p>
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><h5><span class="tsd-kind-parameter">rect</span>: <a href="Point.html" class="tsd-signature-type tsd-kind-class">Point</a><span class="tsd-signature-symbol"> | </span><a href="Rect.html" class="tsd-signature-type tsd-kind-class">Rect</a></h5><div class="tsd-comment tsd-typography"><p>the Rect or Point to check intersections for. If a point is given, a Rect with size (0, 0) is created for intersection calculations.</p>
</div></li></ul></div><h4 class="tsd-returns-title">Returns <a class="tsd-signature-type tsd-kind-type-parameter" href="Quadtree.html#constructor.new_Quadtree.T-1">T</a><span class="tsd-signature-symbol">[]</span></h4><p>array containing all intersecting objects</p>
</li></ul></section><section class="tsd-panel tsd-member"><a id="move" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>move</span><a href="#move" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="move.move-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">move</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">obj</span><span class="tsd-signature-symbol">: </span><a class="tsd-signature-type tsd-kind-type-parameter" href="Quadtree.html#constructor.new_Quadtree.T-1">T</a>, <span class="tsd-kind-parameter">x</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol"> | </span><a href="Point.html" class="tsd-signature-type tsd-kind-class">Point</a>, <span class="tsd-kind-parameter">y</span><span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span><a href="#move.move-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Can be called as either (obj, x, y) or (obj, point). Translate
the given object to given x and y coordinates or to a given <a href="Point.html" class="tsd-kind-class">go.Point</a>.</p>
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><h5><span class="tsd-kind-parameter">obj</span>: <a class="tsd-signature-type tsd-kind-type-parameter" href="Quadtree.html#constructor.new_Quadtree.T-1">T</a></h5><div class="tsd-comment tsd-typography"><p>the object to move</p>
</div></li><li><h5><span class="tsd-kind-parameter">x</span>: <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol"> | </span><a href="Point.html" class="tsd-signature-type tsd-kind-class">Point</a></h5><div class="tsd-comment tsd-typography"><p>the x coordinate or Point to move the object to</p>
</div></li><li><h5><code class="tsd-tag ts-flagOptional">Optional</code> <span class="tsd-kind-parameter">y</span>: <span class="tsd-signature-type">number</span></h5><div class="tsd-comment tsd-typography"><p>the y coordinate to move the object to</p>
</div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">boolean</span></h4><p>whether or not the move was successful. False if the object was not in the tree.</p>
</li></ul></section><section class="tsd-panel tsd-member"><a id="remove" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>remove</span><a href="#remove" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="remove.remove-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">remove</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">obj</span><span class="tsd-signature-symbol">: </span><a class="tsd-signature-type tsd-kind-type-parameter" href="Quadtree.html#constructor.new_Quadtree.T-1">T</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span><a href="#remove.remove-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Remove the given object from the tree, restructuring to
get rid of empty nodes that are unneeded.</p>
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><h5><span class="tsd-kind-parameter">obj</span>: <a class="tsd-signature-type tsd-kind-type-parameter" href="Quadtree.html#constructor.new_Quadtree.T-1">T</a></h5><div class="tsd-comment tsd-typography"><p>the object to remove</p>
</div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">boolean</span></h4><p>whether or not the deletion was successful. False when the object is not in the tree.</p>
</li></ul></section><section class="tsd-panel tsd-member"><a id="resize" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>resize</span><a href="#resize" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="resize.resize-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">resize</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">obj</span><span class="tsd-signature-symbol">: </span><a class="tsd-signature-type tsd-kind-type-parameter" href="Quadtree.html#constructor.new_Quadtree.T-1">T</a>, <span class="tsd-kind-parameter">width</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol"> | </span><a href="Size.html" class="tsd-signature-type tsd-kind-class">Size</a>, <span class="tsd-kind-parameter">height</span><span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span><a href="#resize.resize-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Can be called as either (obj, width, height) or (obj, size). Resize
the given object to given width and height or to a given <a href="Size.html" class="tsd-kind-class">go.Size</a>.</p>
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><h5><span class="tsd-kind-parameter">obj</span>: <a class="tsd-signature-type tsd-kind-type-parameter" href="Quadtree.html#constructor.new_Quadtree.T-1">T</a></h5><div class="tsd-comment tsd-typography"><p>the object to resize</p>
</div></li><li><h5><span class="tsd-kind-parameter">width</span>: <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol"> | </span><a href="Size.html" class="tsd-signature-type tsd-kind-class">Size</a></h5><div class="tsd-comment tsd-typography"><p>the width or Size to resize the object to</p>
</div></li><li><h5><code class="tsd-tag ts-flagOptional">Optional</code> <span class="tsd-kind-parameter">height</span>: <span class="tsd-signature-type">number</span></h5><div class="tsd-comment tsd-typography"><p>the height to resize the object to</p>
</div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">boolean</span></h4><p>whether or not the resize was successful. False if the object was not in the tree.</p>
</li></ul></section><section class="tsd-panel tsd-member"><a id="setTo" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>set<wbr/>To</span><a href="#setTo" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="setTo.setTo-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">set<wbr/>To</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">obj</span><span class="tsd-signature-symbol">: </span><a class="tsd-signature-type tsd-kind-type-parameter" href="Quadtree.html#constructor.new_Quadtree.T-1">T</a>, <span class="tsd-kind-parameter">x</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol"> | </span><a href="Rect.html" class="tsd-signature-type tsd-kind-class">Rect</a>, <span class="tsd-kind-parameter">y</span><span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">number</span>, <span class="tsd-kind-parameter">width</span><span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">number</span>, <span class="tsd-kind-parameter">height</span><span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span><a href="#setTo.setTo-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Updates the given object to have the bounds given, provided as either a
<a href="Rect.html" class="tsd-kind-class">go.Rect</a> or x, y, width, and height.</p>
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><h5><span class="tsd-kind-parameter">obj</span>: <a class="tsd-signature-type tsd-kind-type-parameter" href="Quadtree.html#constructor.new_Quadtree.T-1">T</a></h5><div class="tsd-comment tsd-typography"><p>the object to change the bounds of</p>
</div></li><li><h5><span class="tsd-kind-parameter">x</span>: <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol"> | </span><a href="Rect.html" class="tsd-signature-type tsd-kind-class">Rect</a></h5><div class="tsd-comment tsd-typography"><p>the x-coordinate or Rect to set the object to</p>
</div></li><li><h5><code class="tsd-tag ts-flagOptional">Optional</code> <span class="tsd-kind-parameter">y</span>: <span class="tsd-signature-type">number</span></h5><div class="tsd-comment tsd-typography"><p>the y-coordinate to set the object to, unnecessary if a Rect was given</p>
</div></li><li><h5><code class="tsd-tag ts-flagOptional">Optional</code> <span class="tsd-kind-parameter">width</span>: <span class="tsd-signature-type">number</span></h5><div class="tsd-comment tsd-typography"><p>the width to set the object to, unnecessary if a Rect was given</p>
</div></li><li><h5><code class="tsd-tag ts-flagOptional">Optional</code> <span class="tsd-kind-parameter">height</span>: <span class="tsd-signature-type">number</span></h5><div class="tsd-comment tsd-typography"><p>the height to set the object to, unnecessary if a Rect was given</p>
</div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">boolean</span></h4></li></ul></section><section class="tsd-panel tsd-member"><a id="walk" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>walk</span><a href="#walk" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="walk.walk-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">walk</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">callback</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">n</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">QuadNode</span><span class="tsd-signature-symbol">&lt;</span><a class="tsd-signature-type tsd-kind-type-parameter" href="Quadtree.html#constructor.new_Quadtree.T-1">T</a><span class="tsd-signature-symbol">&gt;</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> =&gt; </span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">)</span>, <span class="tsd-kind-parameter">node</span><span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">QuadNode</span><span class="tsd-signature-symbol">&lt;</span><a class="tsd-signature-type tsd-kind-type-parameter" href="Quadtree.html#constructor.new_Quadtree.T-1">T</a><span class="tsd-signature-symbol">&gt;</span>, <span class="tsd-kind-parameter">root</span><span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span><a href="#walk.walk-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Recursively traverses the tree (depth first) and executes the
given callback on each node.</p>
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><h5><span class="tsd-kind-parameter">callback</span>: <span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">n</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">QuadNode</span><span class="tsd-signature-symbol">&lt;</span><a class="tsd-signature-type tsd-kind-type-parameter" href="Quadtree.html#constructor.new_Quadtree.T-1">T</a><span class="tsd-signature-symbol">&gt;</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> =&gt; </span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">)</span></h5><div class="tsd-comment tsd-typography"><p>the callback to execute on each node. Takes the form of (n: Quadtree) =&gt; void</p>
</div><ul class="tsd-parameters"><li class="tsd-parameter-signature"><ul class="tsd-signatures"><li class="tsd-signature"><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">n</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">QuadNode</span><span class="tsd-signature-symbol">&lt;</span><a class="tsd-signature-type tsd-kind-type-parameter" href="Quadtree.html#constructor.new_Quadtree.T-1">T</a><span class="tsd-signature-symbol">&gt;</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li><li class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><h5><span class="tsd-kind-parameter">n</span>: <span class="tsd-signature-type">QuadNode</span><span class="tsd-signature-symbol">&lt;</span><a class="tsd-signature-type tsd-kind-type-parameter" href="Quadtree.html#constructor.new_Quadtree.T-1">T</a><span class="tsd-signature-symbol">&gt;</span></h5></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></li></ul></li><li><h5><span class="tsd-kind-parameter">node</span>: <span class="tsd-signature-type">QuadNode</span><span class="tsd-signature-symbol">&lt;</span><a class="tsd-signature-type tsd-kind-type-parameter" href="Quadtree.html#constructor.new_Quadtree.T-1">T</a><span class="tsd-signature-symbol">&gt;</span><span class="tsd-signature-symbol"> = ...</span></h5></li><li><h5><span class="tsd-kind-parameter">root</span>: <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol"> = true</span></h5><div class="tsd-comment tsd-typography"><p>whether or not to execute the callback on the root node as well. Defaults to true</p>
</div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></section></section></div><div class="col-sidebar"><div class="page-menu"><details open class="tsd-index-accordion tsd-page-navigation"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>On This Page</h3></summary><div class="tsd-accordion-details"><ul><li><a href="#constructor"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-512"></use></svg><span>constructor</span></a></li><li><a href="#bounds"><svg class="readonly tsd-subicon" viewBox="0 0 28 28"><use href="#subicon-R,#FF4D4D"></use></svg><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-262144"></use></svg><span>bounds</span></a></li><li><a href="#maxLevels"><svg class="readonly tsd-subicon" viewBox="0 0 28 28"><use href="#subicon-R,#FF4D4D"></use></svg><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-262144"></use></svg><span>max<wbr/>Levels</span></a></li><li><a href="#nodeCapacity"><svg class="readonly tsd-subicon" viewBox="0 0 28 28"><use href="#subicon-R,#FF4D4D"></use></svg><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-262144"></use></svg><span>node<wbr/>Capacity</span></a></li><li><a href="#root"><svg class="readonly tsd-subicon" viewBox="0 0 28 28"><use href="#subicon-R,#FF4D4D"></use></svg><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-262144"></use></svg><span>root</span></a></li><li><a href="#add"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>add</span></a></li><li><a href="#clear"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>clear</span></a></li><li><a href="#containing"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>containing</span></a></li><li><a href="#distanceSquared"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>distance<wbr/>Squared</span></a></li><li><a href="#find"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>find</span></a></li><li><a href="#findBounds"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>find<wbr/>Bounds</span></a></li><li><a href="#findExtremeObjects"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>find<wbr/>Extreme<wbr/>Objects</span></a></li><li><a href="#forEach"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>for<wbr/>Each</span></a></li><li><a href="#has"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>has</span></a></li><li><a href="#intersecting"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>intersecting</span></a></li><li><a href="#move"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>move</span></a></li><li><a href="#remove"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>remove</span></a></li><li><a href="#resize"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>resize</span></a></li><li><a href="#setTo"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>set<wbr/>To</span></a></li><li><a href="#walk"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>walk</span></a></li></ul></div></details><div class="tsd-navigation settings"><div class="tsd-theme-toggle"><h4 class="uppercase">Theme</h4><select id="tsd-theme"><option value="os">System</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></div><div class="site-menu"><nav class="tsd-navigation"><a href="../index.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1"></use></svg><span>GoJS API</span></a><ul class="tsd-small-nested-navigation" id="tsd-nav-container" data-base=".."><li>Loading...</li></ul></nav></div></div></div><div class="tsd w-full max-w-screen-xl mx-auto px-2"><div class="bottom-copyright">Copyright © 1998-2025 by Northwoods Software Corporation.</div></div><div class="overlay"></div><script async src="https://www.googletagmanager.com/gtag/js?id=G-S5QK8VSK84"></script><script>window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-S5QK8VSK84');
var getOutboundLink = function(url, label) {
  gtag('event', 'click', {
  'event_category': 'outbound',
  'event_label': label,
  'transport_type': 'beacon'
  });
}

document.getElementById("contactBtn").addEventListener("click", function() {
  getOutboundLink('https://nwoods.com/contact.html', 'contact');
});
document.getElementById("buyBtn").addEventListener("click", function() {
  getOutboundLink('https://nwoods.com/sales/index.html', 'buy');
});</script></body></html>