Add side panels, task selection, graph animation, and project docs

- Foldable left panel (user profile) and right panel (task details)
- Clicking a task in the list or graph node selects it and shows details
- Both views (task list + graph) always mounted via absolute inset-0 for
  correct canvas dimensions; tabs toggle visibility with opacity
- Graph node selection animation: other nodes repel outward (charge -600),
  then selected node smoothly slides to center (500ms cubic ease-out),
  then charge restores to -120 and graph stabilizes
- Graph re-fits on tab switch and panel resize via ResizeObserver
- Fix UUID string IDs throughout (backend returns UUIDs, not integers)
- Add TaskDetailPanel, UserPanel components
- Add CLAUDE.md project documentation

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Alvis
2026-04-08 11:23:06 +00:00
parent 5c7edd4bbc
commit f1d51b8cc8
23998 changed files with 3242708 additions and 0 deletions

21
frontend/node_modules/d3-octree/LICENSE generated vendored Normal file
View File

@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2017 Vasco Asturiano
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

220
frontend/node_modules/d3-octree/README.md generated vendored Normal file
View File

@@ -0,0 +1,220 @@
d3-octree
==============
[![NPM package][npm-img]][npm-url]
[![Build Size][build-size-img]][build-size-url]
[![NPM Downloads][npm-downloads-img]][npm-downloads-url]
Ported version of D3's [Quadtree](https://github.com/d3/d3-quadtree), to use with three dimensional data structures, by adding the z coordinate.
An [octree](https://en.wikipedia.org/wiki/Octree) recursively partitions three-dimensional space into cubes, dividing each cube into eight equally-sized cubes. Each distinct point exists in a unique leaf [node](#nodes); coincident points are represented by a linked list. Octrees can accelerate various spatial operations, such as the [BarnesHut approximation](https://en.wikipedia.org/wiki/BarnesHut_simulation) for computing many-body forces, collision detection, and searching for nearby points.
See also [d3-binarytree](https://github.com/vasturiano/d3-binarytree) and [d3-quadtree](https://github.com/d3/d3-quadtree).
## Installing
If you use npm, `npm install d3-octree`. You can also load directly from the global [npmJS](https://npmjs.com) registry, as a bundled [standalone library](https://unpkg.com/d3-octree). In vanilla, a `d3` global is exported:
```html
<script src="https://unpkg.com/d3-octree"></script>
<script>
const octree = d3.octree();
</script>
```
## API Reference
<a name="octree" href="#octree">#</a> d3.<b>octree</b>([<i>data</i>[, <i>x</i>, <i>y</i>, <i>z</i>]])
[<>](https://github.com/vasturiano/d3-octree/blob/master/src/octree.js#L15 "Source")
Creates a new, empty octree with an empty [extent](#octree_extent) and the default [*x*-](#octree_x), [*y*-](#octree_y) and [*z*-](#octree_z)accessors. If *data* is specified, [adds](#octree_addAll) the specified array of data to the octree. This is equivalent to:
```js
const tree = d3.octree()
.addAll(data);
```
If *x*, *y* and *z* are also specified, sets the [*x*-](#octree_x), [*y*-](#octree_y) and [*z*-](#octree_z) accessors to the specified functions before adding the specified array of data to the octree, equivalent to:
```js
const tree = d3.octree()
.x(x)
.y(y)
.z(z)
.addAll(data);
```
<a name="octree_x" href="#octree_x">#</a> <i>octree</i>.<b>x</b>([<i>x</i>]) [<>](https://github.com/vasturiano/d3-octree/blob/master/src/x.js "Source")
If *x* is specified, sets the current *x*-coordinate accessor and returns the octree. If *x* is not specified, returns the current *x*-accessor, which defaults to:
```js
function x(d) {
return d[0];
}
```
The *x*-acccessor is used to derive the *x*-coordinate of data when [adding](#octree_add) to and [removing](#octree_remove) from the tree. It is also used when [finding](#octree_find) to re-access the coordinates of data previously added to the tree; therefore, the *x*-, *y*- and *z*-accessors must be consistent, returning the same value given the same input.
<a name="octree_y" href="#octree_y">#</a> <i>octree</i>.<b>y</b>([<i>y</i>])
[<>](https://github.com/vasturiano/d3-octree/blob/master/src/y.js "Source")
If *y* is specified, sets the current *y*-coordinate accessor and returns the octree. If *y* is not specified, returns the current *y*-accessor, which defaults to:
```js
function y(d) {
return d[1];
}
```
The *y*-acccessor is used to derive the *y*-coordinate of data when [adding](#octree_add) to and [removing](#octree_remove) from the tree. It is also used when [finding](#octree_find) to re-access the coordinates of data previously added to the tree; therefore, the *x*-, *y*- and *z*-accessors must be consistent, returning the same value given the same input.
<a name="octree_z" href="#octree_z">#</a> <i>octree</i>.<b>z</b>([<i>z</i>])
[<>](https://github.com/vasturiano/d3-octree/blob/master/src/z.js "Source")
If *z* is specified, sets the current *z*-coordinate accessor and returns the octree. If *z* is not specified, returns the current *z*-accessor, which defaults to:
```js
function z(d) {
return d[2];
}
```
The *z*-acccessor is used to derive the *z*-coordinate of data when [adding](#octree_add) to and [removing](#octree_remove) from the tree. It is also used when [finding](#octree_find) to re-access the coordinates of data previously added to the tree; therefore, the *x*-, *y*- and *z*-accessors must be consistent, returning the same value given the same input.
<a name="octree_extent" href="#octree_extent">#</a> <i>octree</i>.<b>extent</b>([*extent*])
[<>](https://github.com/vasturiano/d3-octree/blob/master/src/extent.js "Source")
If *extent* is specified, expands the octree to [cover](#octree_cover) the specified points [[*x0*, *y0*, *z0*], [*x1*, *y1*, *z1*]] and returns the octree. If *extent* is not specified, returns the octrees current extent [[*x0*, *y0*, *z0*], [*x1*, *y1*, *z1*]], where *x0*, *y0* and *z0* are the inclusive lower bounds and *x1*, *y1* and *z1* are the inclusive upper bounds, or undefined if the octree has no extent. The extent may also be expanded by calling [*octree*.cover](#octree_cover) or [*octree*.add](#octree_add).
<a name="octree_cover" href="#octree_cover">#</a> <i>octree</i>.<b>cover</b>(<i>x</i>, <i>y</i>, <i>z</i>)
[<>](https://github.com/vasturiano/d3-octree/blob/master/src/cover.js "Source")
Expands the octree to cover the specified point ⟨*x*,*y*,*z*⟩, and returns the octree. If the octrees extent already covers the specified point, this method does nothing. If the octree has an extent, the extent is repeatedly doubled to cover the specified point, wrapping the [root](#octree_root) [node](#nodes) as necessary; if the octree is empty, the extent is initialized to the extent [[⌊*x*⌋, ⌊*y*⌋, ⌊*z*⌋], [⌈*x*⌉, ⌈*y*⌉, ⌈*z*⌉]]. (Rounding is necessary such that if the extent is later doubled, the boundaries of existing octants do not change due to floating point error.)
<a name="octree_add" href="#octree_add">#</a> <i>octree</i>.<b>add</b>(<i>datum</i>)
[<>](https://github.com/vasturiano/d3-octree/blob/master/src/add.js "Source")
Adds the specified *datum* to the octree, deriving its coordinates ⟨*x*,*y*,*z*⟩ using the current [*x*-](#octree_x), [*y*-](#octree_y) and [*z*-](#octree_z)accessors, and returns the octree. If the new point is outside the current [extent](#octree_extent) of the octree, the octree is automatically expanded to [cover](#octree_cover) the new point.
<a name="octree_addAll" href="#octree_addAll">#</a> <i>octree</i>.<b>addAll</b>(<i>data</i>)
[<>](https://github.com/vasturiano/d3-octree/blob/master/src/add.js#L59 "Source")
Adds the specified array of *data* to the octree, deriving each elements coordinates ⟨*x*,*y*,*z*⟩ using the current [*x*-](#octree_x), [*y*-](#octree_y) and [*z*-](#octree_z)accessors, and return this octree. This is approximately equivalent to calling [*octree*.add](#octree_add) repeatedly:
```js
for (let i = 0, n = data.length; i < n; ++i) {
octree.add(data[i]);
}
```
However, this method results in a more compact octree because the extent of the *data* is computed first before adding the data.
<a name="octree_remove" href="#octree_remove">#</a> <i>octree</i>.<b>remove</b>(<i>datum</i>)
[<>](https://github.com/vasturiano/d3-octree/blob/master/src/remove.js "Source")
Removes the specified *datum* to the octree, deriving its coordinates ⟨*x*,*y*,*z*⟩ using the current [*x*-](#octree_x), [*y*-](#octree_y) and [*z*-](#octree_z)accessors, and returns the octree. If the specified *datum* does not exist in this octree, this method does nothing.
<a name="octree_removeAll" href="#octree_removeAll">#</a> <i>octree</i>.<b>removeAll</b>(<i>data</i>)
[<>](https://github.com/vasturiano/d3-octree/blob/master/src/remove.js#L65 "Source")
Removes the specified *data* from the octree, deriving their coordinates ⟨*x*,*y*,*z*⟩ using the current [*x*-](#octree_x), [*y*-](#octree_y) and [*z*-](#octree_z)accessors, and returns the octree. If a specified *datum* does not exist in this octree, it is ignored.
<a name="octree_copy" href="#octree_copy">#</a> <i>octree</i>.<b>copy</b>()
Returns a copy of the octree. All [nodes](#nodes) in the returned octree are identical copies of the corresponding node in the octree; however, any data in the octree is shared by reference and not copied.
<a name="octree_root" href="#octree_root">#</a> <i>octree</i>.<b>root</b>()
[<>](https://github.com/vasturiano/d3-octree/blob/master/src/root.js "Source")
Returns the root [node](#nodes) of the octree.
<a name="octree_data" href="#octree_data">#</a> <i>octree</i>.<b>data</b>()
[<>](https://github.com/vasturiano/d3-octree/blob/master/src/data.js "Source")
Returns an array of all data in the octree.
<a name="octree_size" href="#octree_size">#</a> <i>octree</i>.<b>size</b>()
[<>](https://github.com/vasturiano/d3-octree/blob/master/src/size.js "Source")
Returns the total number of data in the octree.
<a name="octree_find" href="#octree_find">#</a> <i>octree</i>.<b>find</b>(<i>x</i>, <i>y</i>, <i>z</i>[, <i>radius</i>])
[<>](https://github.com/vasturiano/d3-octree/blob/master/src/find.js "Source")
Returns the datum closest to the position ⟨*x*,*y*,*z*⟩ with the given search *radius*. If *radius* is not specified, it defaults to infinity. If there is no datum within the search area, returns undefined.
<a name="octree_findAllWithinRadius" href="#octree_findAllWithinRadius">#</a> <i>octree</i>.<b>findAllWithinRadius</b>(<i>x</i>, <i>y</i>, <i>z</i>, <i>radius</i>)
[<>](https://github.com/vasturiano/d3-octree/blob/master/src/findAll.js "Source")
Returns all the data points within the given search *radius* of the position ⟨*x*,*y*,*z*⟩. If there is no data points within the search area, returns an empty array.
<a name="octree_visit" href="#octree_visit">#</a> <i>octree</i>.<b>visit</b>(<i>callback</i>)
[<>](https://github.com/vasturiano/d3-octree/blob/master/src/visit.js "Source")
Visits each [node](#nodes) in the octree in pre-order traversal, invoking the specified *callback* with arguments *node*, *x0*, *y0*, *z0*, *x1*, *y1*, *z1* for each node, where *node* is the node being visited, ⟨*x0*, *y0*, *z0*⟩ are the lower bounds of the node, and ⟨*x1*, *y1*, *z1*⟩ are the upper bounds, and returns the octree. (Assuming that positive *x* is right, positive *y* is down and positive *z* is far, as is typically the case, ⟨*x0*, *y0*, *z0*⟩ is the top-left-front corner and ⟨*x1*, *y1*, *z1*⟩ is the lower-right-back corner; however, the coordinate system is arbitrary, so more formally *x0* <= *x1*, *y0* <= *y1* and *z0* <= *z1*.)
If the *callback* returns true for a given node, then the children of that node are not visited; otherwise, all child nodes are visited. This can be used to quickly visit only parts of the tree, for example when using the [BarnesHut approximation](https://en.wikipedia.org/wiki/BarnesHut_simulation). Note, however, that child octants are always visited in sibling order: top-left-front, top-right-front, bottom-left-front, bottom-right-front, top-left-back, top-right-back, bottom-left-back, bottom-right-back. In cases such as [search](#octree_find), visiting siblings in a specific order may be faster.
As an example, the following visits the octree and returns all the nodes within a cubic extent [xmin, ymin, zmin, xmax, ymax, zmax], ignoring octants that cannot possibly contain any such node:
```js
function search(octree, xmin, ymin, zmin, xmax, ymax, zmax) {
const results = [];
octree.visit(function(node, x1, y1, z1, x2, y2, z2) {
if (!node.length) {
do {
const d = node.data;
if (d[0] >= xmin && d[0] < xmax && d[1] >= ymin && d[1] < ymax && d[2] >= zmin && d[2] < zmax) {
results.push(d);
}
} while (node = node.next);
}
return x1 >= xmax || y1 >= ymax || z1 >= zmax || x2 < xmin || y2 < ymin || z2 < zmin;
});
return results;
}
```
<a name="octree_visitAfter" href="#octree_visitAfter">#</a> <i>octree</i>.<b>visitAfter</b>(<i>callback</i>)
[<>](https://github.com/vasturiano/d3-octree/blob/master/src/visitAfter.js "Source")
Visits each [node](#nodes) in the octree in post-order traversal, invoking the specified *callback* with arguments *node*, *x0*, *y0*, *z0*, *x1*, *y1*, *z1* for each node, where *node* is the node being visited, ⟨*x0*, *y0*, *z0*⟩ are the lower bounds of the node, and ⟨*x1*, *y1*, *z1*⟩ are the upper bounds, and returns the octree. (Assuming that positive *x* is right, positive *y* is down and positive *z* is far, as is typically the case, ⟨*x0*, *y0*, *z0*⟩ is the top-left-front corner and ⟨*x1*, *y1*, *z1*⟩ is the lower-right-back corner; however, the coordinate system is arbitrary, so more formally *x0* <= *x1*, *y0* <= *y1* and *z0* <= *z1*.) Returns *root*.
### Nodes
Internal nodes of the octree are represented as eight-element arrays in left-to-right, top-to-bottom, front-to-back order:
* `0` - the top-left-front octant, if any.
* `1` - the top-right-front octant, if any.
* `2` - the bottom-left-front octant, if any.
* `3` - the bottom-right-front octant, if any.
* `4` - the top-left-back octant, if any.
* `5` - the top-right-back octant, if any.
* `6` - the bottom-left-back octant, if any.
* `7` - the bottom-right-back octant, if any.
A child octant may be undefined if it is empty.
Leaf nodes are represented as objects with the following properties:
* `data` - the data associated with this point, as passed to [*octree*.add](#octree_add).
* `next` - the next datum in this leaf, if any.
The `length` property may be used to distinguish leaf nodes from internal nodes: it is undefined for leaf nodes, and 8 for internal nodes. For example, to iterate over all data in a leaf node:
```js
if (!node.length) do console.log(node.data); while (node = node.next);
```
The points *x*-, *y*- and *z*-coordinates **must not be modified** while the point is in the octree. To update a points position, [remove](#octree_remove) the point and then re-[add](#octree_add) it to the octree at the new position. Alternatively, you may discard the existing octree entirely and create a new one from scratch; this may be more efficient if many of the points have moved.
[npm-img]: https://img.shields.io/npm/v/d3-octree
[npm-url]: https://npmjs.org/package/d3-octree
[build-size-img]: https://img.shields.io/bundlephobia/minzip/d3-octree
[build-size-url]: https://bundlephobia.com/result?p=d3-octree
[npm-downloads-img]: https://img.shields.io/npm/dt/d3-octree
[npm-downloads-url]: https://www.npmtrends.com/d3-octree

508
frontend/node_modules/d3-octree/dist/d3-octree.js generated vendored Normal file
View File

@@ -0,0 +1,508 @@
// https://github.com/vasturiano/d3-octree v1.1.0
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
typeof define === 'function' && define.amd ? define(['exports'], factory) :
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.d3 = global.d3 || {}));
})(this, (function (exports) { 'use strict';
function tree_add(d) {
const x = +this._x.call(null, d),
y = +this._y.call(null, d),
z = +this._z.call(null, d);
return add(this.cover(x, y, z), x, y, z, d);
}
function add(tree, x, y, z, d) {
if (isNaN(x) || isNaN(y) || isNaN(z)) return tree; // ignore invalid points
var parent,
node = tree._root,
leaf = {data: d},
x0 = tree._x0,
y0 = tree._y0,
z0 = tree._z0,
x1 = tree._x1,
y1 = tree._y1,
z1 = tree._z1,
xm,
ym,
zm,
xp,
yp,
zp,
right,
bottom,
deep,
i,
j;
// If the tree is empty, initialize the root as a leaf.
if (!node) return tree._root = leaf, tree;
// Find the existing leaf for the new point, or add it.
while (node.length) {
if (right = x >= (xm = (x0 + x1) / 2)) x0 = xm; else x1 = xm;
if (bottom = y >= (ym = (y0 + y1) / 2)) y0 = ym; else y1 = ym;
if (deep = z >= (zm = (z0 + z1) / 2)) z0 = zm; else z1 = zm;
if (parent = node, !(node = node[i = deep << 2 | bottom << 1 | right])) return parent[i] = leaf, tree;
}
// Is the new point is exactly coincident with the existing point?
xp = +tree._x.call(null, node.data);
yp = +tree._y.call(null, node.data);
zp = +tree._z.call(null, node.data);
if (x === xp && y === yp && z === zp) return leaf.next = node, parent ? parent[i] = leaf : tree._root = leaf, tree;
// Otherwise, split the leaf node until the old and new point are separated.
do {
parent = parent ? parent[i] = new Array(8) : tree._root = new Array(8);
if (right = x >= (xm = (x0 + x1) / 2)) x0 = xm; else x1 = xm;
if (bottom = y >= (ym = (y0 + y1) / 2)) y0 = ym; else y1 = ym;
if (deep = z >= (zm = (z0 + z1) / 2)) z0 = zm; else z1 = zm;
} while ((i = deep << 2 | bottom << 1 | right) === (j = (zp >= zm) << 2 | (yp >= ym) << 1 | (xp >= xm)));
return parent[j] = node, parent[i] = leaf, tree;
}
function addAll(data) {
if (!Array.isArray(data)) data = Array.from(data);
const n = data.length;
const xz = new Float64Array(n);
const yz = new Float64Array(n);
const zz = new Float64Array(n);
let x0 = Infinity,
y0 = Infinity,
z0 = Infinity,
x1 = -Infinity,
y1 = -Infinity,
z1 = -Infinity;
// Compute the points and their extent.
for (let i = 0, d, x, y, z; i < n; ++i) {
if (isNaN(x = +this._x.call(null, d = data[i])) || isNaN(y = +this._y.call(null, d)) || isNaN(z = +this._z.call(null, d))) continue;
xz[i] = x;
yz[i] = y;
zz[i] = z;
if (x < x0) x0 = x;
if (x > x1) x1 = x;
if (y < y0) y0 = y;
if (y > y1) y1 = y;
if (z < z0) z0 = z;
if (z > z1) z1 = z;
}
// If there were no (valid) points, abort.
if (x0 > x1 || y0 > y1 || z0 > z1) return this;
// Expand the tree to cover the new points.
this.cover(x0, y0, z0).cover(x1, y1, z1);
// Add the new points.
for (let i = 0; i < n; ++i) {
add(this, xz[i], yz[i], zz[i], data[i]);
}
return this;
}
function tree_cover(x, y, z) {
if (isNaN(x = +x) || isNaN(y = +y) || isNaN(z = +z)) return this; // ignore invalid points
var x0 = this._x0,
y0 = this._y0,
z0 = this._z0,
x1 = this._x1,
y1 = this._y1,
z1 = this._z1;
// If the octree has no extent, initialize them.
// Integer extent are necessary so that if we later double the extent,
// the existing octant boundaries dont change due to floating point error!
if (isNaN(x0)) {
x1 = (x0 = Math.floor(x)) + 1;
y1 = (y0 = Math.floor(y)) + 1;
z1 = (z0 = Math.floor(z)) + 1;
}
// Otherwise, double repeatedly to cover.
else {
var t = x1 - x0 || 1,
node = this._root,
parent,
i;
while (x0 > x || x >= x1 || y0 > y || y >= y1 || z0 > z || z >= z1) {
i = (z < z0) << 2 | (y < y0) << 1 | (x < x0);
parent = new Array(8), parent[i] = node, node = parent, t *= 2;
switch (i) {
case 0: x1 = x0 + t, y1 = y0 + t, z1 = z0 + t; break;
case 1: x0 = x1 - t, y1 = y0 + t, z1 = z0 + t; break;
case 2: x1 = x0 + t, y0 = y1 - t, z1 = z0 + t; break;
case 3: x0 = x1 - t, y0 = y1 - t, z1 = z0 + t; break;
case 4: x1 = x0 + t, y1 = y0 + t, z0 = z1 - t; break;
case 5: x0 = x1 - t, y1 = y0 + t, z0 = z1 - t; break;
case 6: x1 = x0 + t, y0 = y1 - t, z0 = z1 - t; break;
case 7: x0 = x1 - t, y0 = y1 - t, z0 = z1 - t; break;
}
}
if (this._root && this._root.length) this._root = node;
}
this._x0 = x0;
this._y0 = y0;
this._z0 = z0;
this._x1 = x1;
this._y1 = y1;
this._z1 = z1;
return this;
}
function tree_data() {
var data = [];
this.visit(function(node) {
if (!node.length) do data.push(node.data); while (node = node.next)
});
return data;
}
function tree_extent(_) {
return arguments.length
? this.cover(+_[0][0], +_[0][1], +_[0][2]).cover(+_[1][0], +_[1][1], +_[1][2])
: isNaN(this._x0) ? undefined : [[this._x0, this._y0, this._z0], [this._x1, this._y1, this._z1]];
}
function Octant(node, x0, y0, z0, x1, y1, z1) {
this.node = node;
this.x0 = x0;
this.y0 = y0;
this.z0 = z0;
this.x1 = x1;
this.y1 = y1;
this.z1 = z1;
}
function tree_find(x, y, z, radius) {
var data,
x0 = this._x0,
y0 = this._y0,
z0 = this._z0,
x1,
y1,
z1,
x2,
y2,
z2,
x3 = this._x1,
y3 = this._y1,
z3 = this._z1,
octs = [],
node = this._root,
q,
i;
if (node) octs.push(new Octant(node, x0, y0, z0, x3, y3, z3));
if (radius == null) radius = Infinity;
else {
x0 = x - radius, y0 = y - radius, z0 = z - radius;
x3 = x + radius, y3 = y + radius, z3 = z + radius;
radius *= radius;
}
while (q = octs.pop()) {
// Stop searching if this octant cant contain a closer node.
if (!(node = q.node)
|| (x1 = q.x0) > x3
|| (y1 = q.y0) > y3
|| (z1 = q.z0) > z3
|| (x2 = q.x1) < x0
|| (y2 = q.y1) < y0
|| (z2 = q.z1) < z0) continue;
// Bisect the current octant.
if (node.length) {
var xm = (x1 + x2) / 2,
ym = (y1 + y2) / 2,
zm = (z1 + z2) / 2;
octs.push(
new Octant(node[7], xm, ym, zm, x2, y2, z2),
new Octant(node[6], x1, ym, zm, xm, y2, z2),
new Octant(node[5], xm, y1, zm, x2, ym, z2),
new Octant(node[4], x1, y1, zm, xm, ym, z2),
new Octant(node[3], xm, ym, z1, x2, y2, zm),
new Octant(node[2], x1, ym, z1, xm, y2, zm),
new Octant(node[1], xm, y1, z1, x2, ym, zm),
new Octant(node[0], x1, y1, z1, xm, ym, zm)
);
// Visit the closest octant first.
if (i = (z >= zm) << 2 | (y >= ym) << 1 | (x >= xm)) {
q = octs[octs.length - 1];
octs[octs.length - 1] = octs[octs.length - 1 - i];
octs[octs.length - 1 - i] = q;
}
}
// Visit this point. (Visiting coincident points isnt necessary!)
else {
var dx = x - +this._x.call(null, node.data),
dy = y - +this._y.call(null, node.data),
dz = z - +this._z.call(null, node.data),
d2 = dx * dx + dy * dy + dz * dz;
if (d2 < radius) {
var d = Math.sqrt(radius = d2);
x0 = x - d, y0 = y - d, z0 = z - d;
x3 = x + d, y3 = y + d, z3 = z + d;
data = node.data;
}
}
}
return data;
}
const distance = (x1, y1, z1, x2, y2, z2) => Math.sqrt((x1-x2)**2 + (y1-y2)**2 + (z1-z2)**2);
function findAllWithinRadius(x, y, z, radius) {
const result = [];
const xMin = x - radius;
const yMin = y - radius;
const zMin = z - radius;
const xMax = x + radius;
const yMax = y + radius;
const zMax = z + radius;
this.visit((node, x1, y1, z1, x2, y2, z2) => {
if (!node.length) {
do {
const d = node.data;
if (distance(x, y, z, this._x(d), this._y(d), this._z(d)) <= radius) {
result.push(d);
}
} while (node = node.next);
}
return x1 > xMax || y1 > yMax || z1 > zMax || x2 < xMin || y2 < yMin || z2 < zMin;
});
return result;
}
function tree_remove(d) {
if (isNaN(x = +this._x.call(null, d)) || isNaN(y = +this._y.call(null, d)) || isNaN(z = +this._z.call(null, d))) return this; // ignore invalid points
var parent,
node = this._root,
retainer,
previous,
next,
x0 = this._x0,
y0 = this._y0,
z0 = this._z0,
x1 = this._x1,
y1 = this._y1,
z1 = this._z1,
x,
y,
z,
xm,
ym,
zm,
right,
bottom,
deep,
i,
j;
// If the tree is empty, initialize the root as a leaf.
if (!node) return this;
// Find the leaf node for the point.
// While descending, also retain the deepest parent with a non-removed sibling.
if (node.length) while (true) {
if (right = x >= (xm = (x0 + x1) / 2)) x0 = xm; else x1 = xm;
if (bottom = y >= (ym = (y0 + y1) / 2)) y0 = ym; else y1 = ym;
if (deep = z >= (zm = (z0 + z1) / 2)) z0 = zm; else z1 = zm;
if (!(parent = node, node = node[i = deep << 2 | bottom << 1 | right])) return this;
if (!node.length) break;
if (parent[(i + 1) & 7] || parent[(i + 2) & 7] || parent[(i + 3) & 7] || parent[(i + 4) & 7] || parent[(i + 5) & 7] || parent[(i + 6) & 7] || parent[(i + 7) & 7]) retainer = parent, j = i;
}
// Find the point to remove.
while (node.data !== d) if (!(previous = node, node = node.next)) return this;
if (next = node.next) delete node.next;
// If there are multiple coincident points, remove just the point.
if (previous) return (next ? previous.next = next : delete previous.next), this;
// If this is the root point, remove it.
if (!parent) return this._root = next, this;
// Remove this leaf.
next ? parent[i] = next : delete parent[i];
// If the parent now contains exactly one leaf, collapse superfluous parents.
if ((node = parent[0] || parent[1] || parent[2] || parent[3] || parent[4] || parent[5] || parent[6] || parent[7])
&& node === (parent[7] || parent[6] || parent[5] || parent[4] || parent[3] || parent[2] || parent[1] || parent[0])
&& !node.length) {
if (retainer) retainer[j] = node;
else this._root = node;
}
return this;
}
function removeAll(data) {
for (var i = 0, n = data.length; i < n; ++i) this.remove(data[i]);
return this;
}
function tree_root() {
return this._root;
}
function tree_size() {
var size = 0;
this.visit(function(node) {
if (!node.length) do ++size; while (node = node.next)
});
return size;
}
function tree_visit(callback) {
var octs = [], q, node = this._root, child, x0, y0, z0, x1, y1, z1;
if (node) octs.push(new Octant(node, this._x0, this._y0, this._z0, this._x1, this._y1, this._z1));
while (q = octs.pop()) {
if (!callback(node = q.node, x0 = q.x0, y0 = q.y0, z0 = q.z0, x1 = q.x1, y1 = q.y1, z1 = q.z1) && node.length) {
var xm = (x0 + x1) / 2, ym = (y0 + y1) / 2, zm = (z0 + z1) / 2;
if (child = node[7]) octs.push(new Octant(child, xm, ym, zm, x1, y1, z1));
if (child = node[6]) octs.push(new Octant(child, x0, ym, zm, xm, y1, z1));
if (child = node[5]) octs.push(new Octant(child, xm, y0, zm, x1, ym, z1));
if (child = node[4]) octs.push(new Octant(child, x0, y0, zm, xm, ym, z1));
if (child = node[3]) octs.push(new Octant(child, xm, ym, z0, x1, y1, zm));
if (child = node[2]) octs.push(new Octant(child, x0, ym, z0, xm, y1, zm));
if (child = node[1]) octs.push(new Octant(child, xm, y0, z0, x1, ym, zm));
if (child = node[0]) octs.push(new Octant(child, x0, y0, z0, xm, ym, zm));
}
}
return this;
}
function tree_visitAfter(callback) {
var octs = [], next = [], q;
if (this._root) octs.push(new Octant(this._root, this._x0, this._y0, this._z0, this._x1, this._y1, this._z1));
while (q = octs.pop()) {
var node = q.node;
if (node.length) {
var child, x0 = q.x0, y0 = q.y0, z0 = q.z0, x1 = q.x1, y1 = q.y1, z1 = q.z1, xm = (x0 + x1) / 2, ym = (y0 + y1) / 2, zm = (z0 + z1) / 2;
if (child = node[0]) octs.push(new Octant(child, x0, y0, z0, xm, ym, zm));
if (child = node[1]) octs.push(new Octant(child, xm, y0, z0, x1, ym, zm));
if (child = node[2]) octs.push(new Octant(child, x0, ym, z0, xm, y1, zm));
if (child = node[3]) octs.push(new Octant(child, xm, ym, z0, x1, y1, zm));
if (child = node[4]) octs.push(new Octant(child, x0, y0, zm, xm, ym, z1));
if (child = node[5]) octs.push(new Octant(child, xm, y0, zm, x1, ym, z1));
if (child = node[6]) octs.push(new Octant(child, x0, ym, zm, xm, y1, z1));
if (child = node[7]) octs.push(new Octant(child, xm, ym, zm, x1, y1, z1));
}
next.push(q);
}
while (q = next.pop()) {
callback(q.node, q.x0, q.y0, q.z0, q.x1, q.y1, q.z1);
}
return this;
}
function defaultX(d) {
return d[0];
}
function tree_x(_) {
return arguments.length ? (this._x = _, this) : this._x;
}
function defaultY(d) {
return d[1];
}
function tree_y(_) {
return arguments.length ? (this._y = _, this) : this._y;
}
function defaultZ(d) {
return d[2];
}
function tree_z(_) {
return arguments.length ? (this._z = _, this) : this._z;
}
function octree(nodes, x, y, z) {
var tree = new Octree(x == null ? defaultX : x, y == null ? defaultY : y, z == null ? defaultZ : z, NaN, NaN, NaN, NaN, NaN, NaN);
return nodes == null ? tree : tree.addAll(nodes);
}
function Octree(x, y, z, x0, y0, z0, x1, y1, z1) {
this._x = x;
this._y = y;
this._z = z;
this._x0 = x0;
this._y0 = y0;
this._z0 = z0;
this._x1 = x1;
this._y1 = y1;
this._z1 = z1;
this._root = undefined;
}
function leaf_copy(leaf) {
var copy = {data: leaf.data}, next = copy;
while (leaf = leaf.next) next = next.next = {data: leaf.data};
return copy;
}
var treeProto = octree.prototype = Octree.prototype;
treeProto.copy = function() {
var copy = new Octree(this._x, this._y, this._z, this._x0, this._y0, this._z0, this._x1, this._y1, this._z1),
node = this._root,
nodes,
child;
if (!node) return copy;
if (!node.length) return copy._root = leaf_copy(node), copy;
nodes = [{source: node, target: copy._root = new Array(8)}];
while (node = nodes.pop()) {
for (var i = 0; i < 8; ++i) {
if (child = node.source[i]) {
if (child.length) nodes.push({source: child, target: node.target[i] = new Array(8)});
else node.target[i] = leaf_copy(child);
}
}
}
return copy;
};
treeProto.add = tree_add;
treeProto.addAll = addAll;
treeProto.cover = tree_cover;
treeProto.data = tree_data;
treeProto.extent = tree_extent;
treeProto.find = tree_find;
treeProto.findAllWithinRadius = findAllWithinRadius;
treeProto.remove = tree_remove;
treeProto.removeAll = removeAll;
treeProto.root = tree_root;
treeProto.size = tree_size;
treeProto.visit = tree_visit;
treeProto.visitAfter = tree_visitAfter;
treeProto.x = tree_x;
treeProto.y = tree_y;
treeProto.z = tree_z;
exports.octree = octree;
}));

File diff suppressed because one or more lines are too long

45
frontend/node_modules/d3-octree/package.json generated vendored Normal file
View File

@@ -0,0 +1,45 @@
{
"name": "d3-octree",
"version": "1.1.0",
"description": "Three-dimensional recursive spatial subdivision.",
"keywords": [
"d3",
"d3-module",
"octree",
"3d"
],
"homepage": "https://github.com/vasturiano/d3-octree",
"license": "MIT",
"author": {
"name": "Vasco Asturiano",
"url": "https://github.com/vasturiano"
},
"type": "module",
"unpkg": "dist/d3-octree.min.js",
"jsdelivr": "dist/d3-octree.min.js",
"main": "src/index.js",
"module": "src/index.js",
"exports": {
"umd": "./dist/d3-octree.min.js",
"default": "./src/index.js"
},
"repository": {
"type": "git",
"url": "https://github.com/vasturiano/d3-octree.git"
},
"sideEffects": false,
"scripts": {
"test": "mocha 'test/**/*-test.js' && eslint src test",
"prepare": "rm -rf dist && yarn test && rollup -c"
},
"files": [
"src/**/*.js",
"dist/**/*.js"
],
"devDependencies": {
"@rollup/plugin-terser": "^0.4.4",
"eslint": "^8.57.1",
"mocha": "^11.0.1",
"rollup": "^4.29.1"
}
}

98
frontend/node_modules/d3-octree/src/add.js generated vendored Normal file
View File

@@ -0,0 +1,98 @@
export default function(d) {
const x = +this._x.call(null, d),
y = +this._y.call(null, d),
z = +this._z.call(null, d);
return add(this.cover(x, y, z), x, y, z, d);
}
function add(tree, x, y, z, d) {
if (isNaN(x) || isNaN(y) || isNaN(z)) return tree; // ignore invalid points
var parent,
node = tree._root,
leaf = {data: d},
x0 = tree._x0,
y0 = tree._y0,
z0 = tree._z0,
x1 = tree._x1,
y1 = tree._y1,
z1 = tree._z1,
xm,
ym,
zm,
xp,
yp,
zp,
right,
bottom,
deep,
i,
j;
// If the tree is empty, initialize the root as a leaf.
if (!node) return tree._root = leaf, tree;
// Find the existing leaf for the new point, or add it.
while (node.length) {
if (right = x >= (xm = (x0 + x1) / 2)) x0 = xm; else x1 = xm;
if (bottom = y >= (ym = (y0 + y1) / 2)) y0 = ym; else y1 = ym;
if (deep = z >= (zm = (z0 + z1) / 2)) z0 = zm; else z1 = zm;
if (parent = node, !(node = node[i = deep << 2 | bottom << 1 | right])) return parent[i] = leaf, tree;
}
// Is the new point is exactly coincident with the existing point?
xp = +tree._x.call(null, node.data);
yp = +tree._y.call(null, node.data);
zp = +tree._z.call(null, node.data);
if (x === xp && y === yp && z === zp) return leaf.next = node, parent ? parent[i] = leaf : tree._root = leaf, tree;
// Otherwise, split the leaf node until the old and new point are separated.
do {
parent = parent ? parent[i] = new Array(8) : tree._root = new Array(8);
if (right = x >= (xm = (x0 + x1) / 2)) x0 = xm; else x1 = xm;
if (bottom = y >= (ym = (y0 + y1) / 2)) y0 = ym; else y1 = ym;
if (deep = z >= (zm = (z0 + z1) / 2)) z0 = zm; else z1 = zm;
} while ((i = deep << 2 | bottom << 1 | right) === (j = (zp >= zm) << 2 | (yp >= ym) << 1 | (xp >= xm)));
return parent[j] = node, parent[i] = leaf, tree;
}
export function addAll(data) {
if (!Array.isArray(data)) data = Array.from(data);
const n = data.length;
const xz = new Float64Array(n);
const yz = new Float64Array(n);
const zz = new Float64Array(n);
let x0 = Infinity,
y0 = Infinity,
z0 = Infinity,
x1 = -Infinity,
y1 = -Infinity,
z1 = -Infinity;
// Compute the points and their extent.
for (let i = 0, d, x, y, z; i < n; ++i) {
if (isNaN(x = +this._x.call(null, d = data[i])) || isNaN(y = +this._y.call(null, d)) || isNaN(z = +this._z.call(null, d))) continue;
xz[i] = x;
yz[i] = y;
zz[i] = z;
if (x < x0) x0 = x;
if (x > x1) x1 = x;
if (y < y0) y0 = y;
if (y > y1) y1 = y;
if (z < z0) z0 = z;
if (z > z1) z1 = z;
}
// If there were no (valid) points, abort.
if (x0 > x1 || y0 > y1 || z0 > z1) return this;
// Expand the tree to cover the new points.
this.cover(x0, y0, z0).cover(x1, y1, z1);
// Add the new points.
for (let i = 0; i < n; ++i) {
add(this, xz[i], yz[i], zz[i], data[i]);
}
return this;
}

52
frontend/node_modules/d3-octree/src/cover.js generated vendored Normal file
View File

@@ -0,0 +1,52 @@
export default function(x, y, z) {
if (isNaN(x = +x) || isNaN(y = +y) || isNaN(z = +z)) return this; // ignore invalid points
var x0 = this._x0,
y0 = this._y0,
z0 = this._z0,
x1 = this._x1,
y1 = this._y1,
z1 = this._z1;
// If the octree has no extent, initialize them.
// Integer extent are necessary so that if we later double the extent,
// the existing octant boundaries dont change due to floating point error!
if (isNaN(x0)) {
x1 = (x0 = Math.floor(x)) + 1;
y1 = (y0 = Math.floor(y)) + 1;
z1 = (z0 = Math.floor(z)) + 1;
}
// Otherwise, double repeatedly to cover.
else {
var t = x1 - x0 || 1,
node = this._root,
parent,
i;
while (x0 > x || x >= x1 || y0 > y || y >= y1 || z0 > z || z >= z1) {
i = (z < z0) << 2 | (y < y0) << 1 | (x < x0);
parent = new Array(8), parent[i] = node, node = parent, t *= 2;
switch (i) {
case 0: x1 = x0 + t, y1 = y0 + t, z1 = z0 + t; break;
case 1: x0 = x1 - t, y1 = y0 + t, z1 = z0 + t; break;
case 2: x1 = x0 + t, y0 = y1 - t, z1 = z0 + t; break;
case 3: x0 = x1 - t, y0 = y1 - t, z1 = z0 + t; break;
case 4: x1 = x0 + t, y1 = y0 + t, z0 = z1 - t; break;
case 5: x0 = x1 - t, y1 = y0 + t, z0 = z1 - t; break;
case 6: x1 = x0 + t, y0 = y1 - t, z0 = z1 - t; break;
case 7: x0 = x1 - t, y0 = y1 - t, z0 = z1 - t; break;
}
}
if (this._root && this._root.length) this._root = node;
}
this._x0 = x0;
this._y0 = y0;
this._z0 = z0;
this._x1 = x1;
this._y1 = y1;
this._z1 = z1;
return this;
}

7
frontend/node_modules/d3-octree/src/data.js generated vendored Normal file
View File

@@ -0,0 +1,7 @@
export default function() {
var data = [];
this.visit(function(node) {
if (!node.length) do data.push(node.data); while (node = node.next)
});
return data;
}

5
frontend/node_modules/d3-octree/src/extent.js generated vendored Normal file
View File

@@ -0,0 +1,5 @@
export default function(_) {
return arguments.length
? this.cover(+_[0][0], +_[0][1], +_[0][2]).cover(+_[1][0], +_[1][1], +_[1][2])
: isNaN(this._x0) ? undefined : [[this._x0, this._y0, this._z0], [this._x1, this._y1, this._z1]];
}

82
frontend/node_modules/d3-octree/src/find.js generated vendored Normal file
View File

@@ -0,0 +1,82 @@
import Octant from "./octant.js";
export default function(x, y, z, radius) {
var data,
x0 = this._x0,
y0 = this._y0,
z0 = this._z0,
x1,
y1,
z1,
x2,
y2,
z2,
x3 = this._x1,
y3 = this._y1,
z3 = this._z1,
octs = [],
node = this._root,
q,
i;
if (node) octs.push(new Octant(node, x0, y0, z0, x3, y3, z3));
if (radius == null) radius = Infinity;
else {
x0 = x - radius, y0 = y - radius, z0 = z - radius;
x3 = x + radius, y3 = y + radius, z3 = z + radius;
radius *= radius;
}
while (q = octs.pop()) {
// Stop searching if this octant cant contain a closer node.
if (!(node = q.node)
|| (x1 = q.x0) > x3
|| (y1 = q.y0) > y3
|| (z1 = q.z0) > z3
|| (x2 = q.x1) < x0
|| (y2 = q.y1) < y0
|| (z2 = q.z1) < z0) continue;
// Bisect the current octant.
if (node.length) {
var xm = (x1 + x2) / 2,
ym = (y1 + y2) / 2,
zm = (z1 + z2) / 2;
octs.push(
new Octant(node[7], xm, ym, zm, x2, y2, z2),
new Octant(node[6], x1, ym, zm, xm, y2, z2),
new Octant(node[5], xm, y1, zm, x2, ym, z2),
new Octant(node[4], x1, y1, zm, xm, ym, z2),
new Octant(node[3], xm, ym, z1, x2, y2, zm),
new Octant(node[2], x1, ym, z1, xm, y2, zm),
new Octant(node[1], xm, y1, z1, x2, ym, zm),
new Octant(node[0], x1, y1, z1, xm, ym, zm)
);
// Visit the closest octant first.
if (i = (z >= zm) << 2 | (y >= ym) << 1 | (x >= xm)) {
q = octs[octs.length - 1];
octs[octs.length - 1] = octs[octs.length - 1 - i];
octs[octs.length - 1 - i] = q;
}
}
// Visit this point. (Visiting coincident points isnt necessary!)
else {
var dx = x - +this._x.call(null, node.data),
dy = y - +this._y.call(null, node.data),
dz = z - +this._z.call(null, node.data),
d2 = dx * dx + dy * dy + dz * dz;
if (d2 < radius) {
var d = Math.sqrt(radius = d2);
x0 = x - d, y0 = y - d, z0 = z - d;
x3 = x + d, y3 = y + d, z3 = z + d;
data = node.data;
}
}
}
return data;
}

26
frontend/node_modules/d3-octree/src/findAll.js generated vendored Normal file
View File

@@ -0,0 +1,26 @@
const distance = (x1, y1, z1, x2, y2, z2) => Math.sqrt((x1-x2)**2 + (y1-y2)**2 + (z1-z2)**2);
export function findAllWithinRadius(x, y, z, radius) {
const result = [];
const xMin = x - radius;
const yMin = y - radius;
const zMin = z - radius;
const xMax = x + radius;
const yMax = y + radius;
const zMax = z + radius;
this.visit((node, x1, y1, z1, x2, y2, z2) => {
if (!node.length) {
do {
const d = node.data;
if (distance(x, y, z, this._x(d), this._y(d), this._z(d)) <= radius) {
result.push(d);
}
} while (node = node.next);
}
return x1 > xMax || y1 > yMax || z1 > zMax || x2 < xMin || y2 < yMin || z2 < zMin;
});
return result;
}

1
frontend/node_modules/d3-octree/src/index.js generated vendored Normal file
View File

@@ -0,0 +1 @@
export {default as octree} from "./octree.js";

9
frontend/node_modules/d3-octree/src/octant.js generated vendored Normal file
View File

@@ -0,0 +1,9 @@
export default function(node, x0, y0, z0, x1, y1, z1) {
this.node = node;
this.x0 = x0;
this.y0 = y0;
this.z0 = z0;
this.x1 = x1;
this.y1 = y1;
this.z1 = z1;
}

80
frontend/node_modules/d3-octree/src/octree.js generated vendored Normal file
View File

@@ -0,0 +1,80 @@
import tree_add, {addAll as tree_addAll} from "./add.js";
import tree_cover from "./cover.js";
import tree_data from "./data.js";
import tree_extent from "./extent.js";
import tree_find from "./find.js";
import { findAllWithinRadius as tree_findAllWithinRadius } from "./findAll.js";
import tree_remove, {removeAll as tree_removeAll} from "./remove.js";
import tree_root from "./root.js";
import tree_size from "./size.js";
import tree_visit from "./visit.js";
import tree_visitAfter from "./visitAfter.js";
import tree_x, {defaultX} from "./x.js";
import tree_y, {defaultY} from "./y.js";
import tree_z, {defaultZ} from "./z.js";
export default function octree(nodes, x, y, z) {
var tree = new Octree(x == null ? defaultX : x, y == null ? defaultY : y, z == null ? defaultZ : z, NaN, NaN, NaN, NaN, NaN, NaN);
return nodes == null ? tree : tree.addAll(nodes);
}
function Octree(x, y, z, x0, y0, z0, x1, y1, z1) {
this._x = x;
this._y = y;
this._z = z;
this._x0 = x0;
this._y0 = y0;
this._z0 = z0;
this._x1 = x1;
this._y1 = y1;
this._z1 = z1;
this._root = undefined;
}
function leaf_copy(leaf) {
var copy = {data: leaf.data}, next = copy;
while (leaf = leaf.next) next = next.next = {data: leaf.data};
return copy;
}
var treeProto = octree.prototype = Octree.prototype;
treeProto.copy = function() {
var copy = new Octree(this._x, this._y, this._z, this._x0, this._y0, this._z0, this._x1, this._y1, this._z1),
node = this._root,
nodes,
child;
if (!node) return copy;
if (!node.length) return copy._root = leaf_copy(node), copy;
nodes = [{source: node, target: copy._root = new Array(8)}];
while (node = nodes.pop()) {
for (var i = 0; i < 8; ++i) {
if (child = node.source[i]) {
if (child.length) nodes.push({source: child, target: node.target[i] = new Array(8)});
else node.target[i] = leaf_copy(child);
}
}
}
return copy;
};
treeProto.add = tree_add;
treeProto.addAll = tree_addAll;
treeProto.cover = tree_cover;
treeProto.data = tree_data;
treeProto.extent = tree_extent;
treeProto.find = tree_find;
treeProto.findAllWithinRadius = tree_findAllWithinRadius;
treeProto.remove = tree_remove;
treeProto.removeAll = tree_removeAll;
treeProto.root = tree_root;
treeProto.size = tree_size;
treeProto.visit = tree_visit;
treeProto.visitAfter = tree_visitAfter;
treeProto.x = tree_x;
treeProto.y = tree_y;
treeProto.z = tree_z;

68
frontend/node_modules/d3-octree/src/remove.js generated vendored Normal file
View File

@@ -0,0 +1,68 @@
export default function(d) {
if (isNaN(x = +this._x.call(null, d)) || isNaN(y = +this._y.call(null, d)) || isNaN(z = +this._z.call(null, d))) return this; // ignore invalid points
var parent,
node = this._root,
retainer,
previous,
next,
x0 = this._x0,
y0 = this._y0,
z0 = this._z0,
x1 = this._x1,
y1 = this._y1,
z1 = this._z1,
x,
y,
z,
xm,
ym,
zm,
right,
bottom,
deep,
i,
j;
// If the tree is empty, initialize the root as a leaf.
if (!node) return this;
// Find the leaf node for the point.
// While descending, also retain the deepest parent with a non-removed sibling.
if (node.length) while (true) {
if (right = x >= (xm = (x0 + x1) / 2)) x0 = xm; else x1 = xm;
if (bottom = y >= (ym = (y0 + y1) / 2)) y0 = ym; else y1 = ym;
if (deep = z >= (zm = (z0 + z1) / 2)) z0 = zm; else z1 = zm;
if (!(parent = node, node = node[i = deep << 2 | bottom << 1 | right])) return this;
if (!node.length) break;
if (parent[(i + 1) & 7] || parent[(i + 2) & 7] || parent[(i + 3) & 7] || parent[(i + 4) & 7] || parent[(i + 5) & 7] || parent[(i + 6) & 7] || parent[(i + 7) & 7]) retainer = parent, j = i;
}
// Find the point to remove.
while (node.data !== d) if (!(previous = node, node = node.next)) return this;
if (next = node.next) delete node.next;
// If there are multiple coincident points, remove just the point.
if (previous) return (next ? previous.next = next : delete previous.next), this;
// If this is the root point, remove it.
if (!parent) return this._root = next, this;
// Remove this leaf.
next ? parent[i] = next : delete parent[i];
// If the parent now contains exactly one leaf, collapse superfluous parents.
if ((node = parent[0] || parent[1] || parent[2] || parent[3] || parent[4] || parent[5] || parent[6] || parent[7])
&& node === (parent[7] || parent[6] || parent[5] || parent[4] || parent[3] || parent[2] || parent[1] || parent[0])
&& !node.length) {
if (retainer) retainer[j] = node;
else this._root = node;
}
return this;
}
export function removeAll(data) {
for (var i = 0, n = data.length; i < n; ++i) this.remove(data[i]);
return this;
}

3
frontend/node_modules/d3-octree/src/root.js generated vendored Normal file
View File

@@ -0,0 +1,3 @@
export default function() {
return this._root;
}

7
frontend/node_modules/d3-octree/src/size.js generated vendored Normal file
View File

@@ -0,0 +1,7 @@
export default function() {
var size = 0;
this.visit(function(node) {
if (!node.length) do ++size; while (node = node.next)
});
return size;
}

20
frontend/node_modules/d3-octree/src/visit.js generated vendored Normal file
View File

@@ -0,0 +1,20 @@
import Octant from "./octant.js";
export default function(callback) {
var octs = [], q, node = this._root, child, x0, y0, z0, x1, y1, z1;
if (node) octs.push(new Octant(node, this._x0, this._y0, this._z0, this._x1, this._y1, this._z1));
while (q = octs.pop()) {
if (!callback(node = q.node, x0 = q.x0, y0 = q.y0, z0 = q.z0, x1 = q.x1, y1 = q.y1, z1 = q.z1) && node.length) {
var xm = (x0 + x1) / 2, ym = (y0 + y1) / 2, zm = (z0 + z1) / 2;
if (child = node[7]) octs.push(new Octant(child, xm, ym, zm, x1, y1, z1));
if (child = node[6]) octs.push(new Octant(child, x0, ym, zm, xm, y1, z1));
if (child = node[5]) octs.push(new Octant(child, xm, y0, zm, x1, ym, z1));
if (child = node[4]) octs.push(new Octant(child, x0, y0, zm, xm, ym, z1));
if (child = node[3]) octs.push(new Octant(child, xm, ym, z0, x1, y1, zm));
if (child = node[2]) octs.push(new Octant(child, x0, ym, z0, xm, y1, zm));
if (child = node[1]) octs.push(new Octant(child, xm, y0, z0, x1, ym, zm));
if (child = node[0]) octs.push(new Octant(child, x0, y0, z0, xm, ym, zm));
}
}
return this;
}

25
frontend/node_modules/d3-octree/src/visitAfter.js generated vendored Normal file
View File

@@ -0,0 +1,25 @@
import Octant from "./octant.js";
export default function(callback) {
var octs = [], next = [], q;
if (this._root) octs.push(new Octant(this._root, this._x0, this._y0, this._z0, this._x1, this._y1, this._z1));
while (q = octs.pop()) {
var node = q.node;
if (node.length) {
var child, x0 = q.x0, y0 = q.y0, z0 = q.z0, x1 = q.x1, y1 = q.y1, z1 = q.z1, xm = (x0 + x1) / 2, ym = (y0 + y1) / 2, zm = (z0 + z1) / 2;
if (child = node[0]) octs.push(new Octant(child, x0, y0, z0, xm, ym, zm));
if (child = node[1]) octs.push(new Octant(child, xm, y0, z0, x1, ym, zm));
if (child = node[2]) octs.push(new Octant(child, x0, ym, z0, xm, y1, zm));
if (child = node[3]) octs.push(new Octant(child, xm, ym, z0, x1, y1, zm));
if (child = node[4]) octs.push(new Octant(child, x0, y0, zm, xm, ym, z1));
if (child = node[5]) octs.push(new Octant(child, xm, y0, zm, x1, ym, z1));
if (child = node[6]) octs.push(new Octant(child, x0, ym, zm, xm, y1, z1));
if (child = node[7]) octs.push(new Octant(child, xm, ym, zm, x1, y1, z1));
}
next.push(q);
}
while (q = next.pop()) {
callback(q.node, q.x0, q.y0, q.z0, q.x1, q.y1, q.z1);
}
return this;
}

7
frontend/node_modules/d3-octree/src/x.js generated vendored Normal file
View File

@@ -0,0 +1,7 @@
export function defaultX(d) {
return d[0];
}
export default function(_) {
return arguments.length ? (this._x = _, this) : this._x;
}

7
frontend/node_modules/d3-octree/src/y.js generated vendored Normal file
View File

@@ -0,0 +1,7 @@
export function defaultY(d) {
return d[1];
}
export default function(_) {
return arguments.length ? (this._y = _, this) : this._y;
}

7
frontend/node_modules/d3-octree/src/z.js generated vendored Normal file
View File

@@ -0,0 +1,7 @@
export function defaultZ(d) {
return d[2];
}
export default function(_) {
return arguments.length ? (this._z = _, this) : this._z;
}