all these changes

This commit is contained in:
Jake Kasper
2026-04-09 13:19:47 -05:00
parent e83a51a051
commit 65315f36d1
39102 changed files with 7932979 additions and 567 deletions

21
frontend/node_modules/point-in-polygon/LICENSE generated vendored Normal file
View File

@@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2016 James Halliday
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.

View File

@@ -0,0 +1,6 @@
var pointInPolygon = require('../');
var polygon = [ [ 1, 1 ], [ 1, 2 ], [ 2, 2 ], [ 2, 1 ] ];
console.log(pointInPolygon([ 1.5, 1.5 ], polygon)); // true
console.log(pointInPolygon([ 4.9, 1.2 ], polygon)); // false
console.log(pointInPolygon([ 1.8, 1.1 ], polygon)); // true

15
frontend/node_modules/point-in-polygon/flat.js generated vendored Normal file
View File

@@ -0,0 +1,15 @@
module.exports = function pointInPolygonFlat (point, vs, start, end) {
var x = point[0], y = point[1];
var inside = false;
if (start === undefined) start = 0;
if (end === undefined) end = vs.length;
var len = (end-start)/2;
for (var i = 0, j = len - 1; i < len; j = i++) {
var xi = vs[start+i*2+0], yi = vs[start+i*2+1];
var xj = vs[start+j*2+0], yj = vs[start+j*2+1];
var intersect = ((yi > y) !== (yj > y))
&& (x < (xj - xi) * (y - yi) / (yj - yi) + xi);
if (intersect) inside = !inside;
}
return inside;
};

12
frontend/node_modules/point-in-polygon/index.js generated vendored Normal file
View File

@@ -0,0 +1,12 @@
var pointInPolygonFlat = require('./flat.js')
var pointInPolygonNested = require('./nested.js')
module.exports = function pointInPolygon (point, vs, start, end) {
if (vs.length > 0 && Array.isArray(vs[0])) {
return pointInPolygonNested(point, vs, start, end);
} else {
return pointInPolygonFlat(point, vs, start, end);
}
}
module.exports.nested = pointInPolygonNested
module.exports.flat = pointInPolygonFlat

18
frontend/node_modules/point-in-polygon/nested.js generated vendored Normal file
View File

@@ -0,0 +1,18 @@
// ray-casting algorithm based on
// https://wrf.ecse.rpi.edu/Research/Short_Notes/pnpoly.html
module.exports = function pointInPolygonNested (point, vs, start, end) {
var x = point[0], y = point[1];
var inside = false;
if (start === undefined) start = 0;
if (end === undefined) end = vs.length;
var len = end - start;
for (var i = 0, j = len - 1; i < len; j = i++) {
var xi = vs[i+start][0], yi = vs[i+start][1];
var xj = vs[j+start][0], yj = vs[j+start][1];
var intersect = ((yi > y) !== (yj > y))
&& (x < (xj - xi) * (y - yi) / (yj - yi) + xi);
if (intersect) inside = !inside;
}
return inside;
};

32
frontend/node_modules/point-in-polygon/package.json generated vendored Normal file
View File

@@ -0,0 +1,32 @@
{
"name": "point-in-polygon",
"description": "determine if a point is inside a polygon with a ray intersection counting algorithm",
"version": "1.1.0",
"repository": {
"type": "git",
"url": "git://github.com/substack/point-in-polygon.git"
},
"main": "index.js",
"keywords": [
"point",
"polygon",
"inside"
],
"directories": {
"lib": ".",
"example": "example",
"test": "test"
},
"scripts": {
"test": "tape test/*.js"
},
"devDependencies": {
"tape": "^4.0.0"
},
"license": "MIT",
"author": {
"name": "James Halliday",
"email": "mail@substack.net",
"url": "http://substack.net"
}
}

51
frontend/node_modules/point-in-polygon/readme.markdown generated vendored Normal file
View File

@@ -0,0 +1,51 @@
# point-in-polygon
Determine if a point is inside of a polygon.
This module casts a semi-infinite ray from the inquiry point and counts intersections,
based on
[this algorithm](https://wrf.ecse.rpi.edu/Research/Short_Notes/pnpoly.html).
If you need a numerically robust solution and are willing to trade some performance for it,
use [robust-point-in-polygon](https://github.com/mikolalysenko/robust-point-in-polygon).
# example
``` js
var pointInPolygon = require('point-in-polygon');
var polygon = [ [ 1, 1 ], [ 1, 2 ], [ 2, 2 ], [ 2, 1 ] ];
console.log(pointInPolygon([ 1.5, 1.5 ], polygon)); // true
console.log(pointInPolygon([ 4.9, 1.2 ], polygon)); // false
console.log(pointInPolygon([ 1.8, 1.1 ], polygon)); // true
```
# methods
``` js
var pointInPolygon = require('point-in-polygon')
var pointInPolygonFlat = require('point-in-polygon/flat')
var pointInPolygonNested = require('point-in-polygon/nested')
```
## pointInPolygon(point, polygon, start=0, end=polygon.length)
Return whether `point` is contained in `polygon`.
* `point` should be a 2-item array of coordinates
* `polygon` should be an array of 2-item arrays of coordinates or a flat array of coordinates
* `start` is an offset into `polygon`. default `0`
* `end` is an offset into `polygon`. default `polygon.length`
The flat or nested is detected automatically. Or you can use the specific methods if you want to
skip the check.
# install
```
npm install point-in-polygon
```
# license
MIT

View File

@@ -0,0 +1,24 @@
var test = require('tape');
var inside = require('../');
test('nested box with offsets', function (t) {
var polygon = [ [100,101],[102,103], [ 1, 1 ], [ 1, 2 ], [ 2, 2 ], [ 2, 1 ], [200,201] ];
t.ok(inside([ 1.5, 1.5 ], polygon, 2, 6));
t.ok(inside([ 1.2, 1.9 ], polygon, 2, 6));
t.ok(!inside([ 0, 1.9 ], polygon, 2, 6));
t.ok(!inside([ 1.5, 2 ], polygon, 2, 6));
t.ok(!inside([ 1.5, 2.2 ], polygon, 2, 6));
t.ok(!inside([ 3, 5 ], polygon, 2, 6));
t.end();
});
test('nested flag with offsets', function (t) {
var polygon = [ [100,101], [ 1, 1 ], [ 10, 1 ], [ 5, 5 ], [ 10, 10 ], [ 1, 10 ] ];
t.ok(inside([ 2, 5 ], polygon, 1));
t.ok(inside([ 3, 5 ], polygon, 1));
t.ok(inside([ 4, 5 ], polygon, 1));
t.ok(!inside([ 10, 5 ], polygon, 1));
t.ok(!inside([ 11, 5 ], polygon, 1));
t.ok(!inside([ 9, 5 ], polygon, 1));
t.end();
});

34
frontend/node_modules/point-in-polygon/test/box.js generated vendored Normal file
View File

@@ -0,0 +1,34 @@
var test = require('tape');
var inside = require('../');
test('box', function (t) {
var polygon = [ [ 1, 1 ], [ 1, 2 ], [ 2, 2 ], [ 2, 1 ] ];
t.ok(inside([ 1.5, 1.5 ], polygon));
t.ok(inside([ 1.2, 1.9 ], polygon));
t.ok(!inside([ 0, 1.9 ], polygon));
t.ok(!inside([ 1.5, 2 ], polygon));
t.ok(!inside([ 1.5, 2.2 ], polygon));
t.ok(!inside([ 3, 5 ], polygon));
t.end();
});
/**
* Flag shape:
*************
* *
* *
* *
* *
* *
*************
*/
test('flag', function (t) {
var polygon = [ [ 1, 1 ], [ 10, 1 ], [ 5, 5 ], [ 10, 10 ], [ 1, 10 ] ];
t.ok(inside([ 2, 5 ], polygon));
t.ok(inside([ 3, 5 ], polygon));
t.ok(inside([ 4, 5 ], polygon));
t.ok(!inside([ 10, 5 ], polygon));
t.ok(!inside([ 11, 5 ], polygon));
t.ok(!inside([ 9, 5 ], polygon));
t.end();
});

View File

@@ -0,0 +1,24 @@
var test = require('tape');
var pointInPolygon = require('../');
test('flat box with offsets', function (t) {
var polygon = [ 100, 101, 102, 1, 1, 1, 2, 2, 2, 2, 1, 500, 501, 502, 503 ];
t.ok(pointInPolygon([ 1.5, 1.5 ], polygon, 3, 11));
t.ok(pointInPolygon([ 1.2, 1.9 ], polygon, 3, 11));
t.ok(!pointInPolygon([ 0, 1.9 ], polygon, 3, 11));
t.ok(!pointInPolygon([ 1.5, 2 ], polygon, 3, 11));
t.ok(!pointInPolygon([ 1.5, 2.2 ], polygon, 3, 11));
t.ok(!pointInPolygon([ 3, 5 ], polygon, 3, 11));
t.end();
});
test('flat flag with offsets', function (t) {
var polygon = [ 101, 102, 1, 1, 10, 1, 5, 5, 10, 10, 1, 10, 500 ];
t.ok(pointInPolygon([ 2, 5 ], polygon, 2, 12));
t.ok(pointInPolygon([ 3, 5 ], polygon, 2, 12));
t.ok(pointInPolygon([ 4, 5 ], polygon, 2, 12));
t.ok(!pointInPolygon([ 10, 5 ], polygon, 2, 12));
t.ok(!pointInPolygon([ 11, 5 ], polygon, 2, 12));
t.ok(!pointInPolygon([ 9, 5 ], polygon, 2, 12));
t.end();
});

24
frontend/node_modules/point-in-polygon/test/flat.js generated vendored Normal file
View File

@@ -0,0 +1,24 @@
var test = require('tape');
var inside = require('../');
test('flat box', function (t) {
var polygon = [ 1, 1, 1, 2, 2, 2, 2, 1 ];
t.ok(inside([ 1.5, 1.5 ], polygon));
t.ok(inside([ 1.2, 1.9 ], polygon));
t.ok(!inside([ 0, 1.9 ], polygon));
t.ok(!inside([ 1.5, 2 ], polygon));
t.ok(!inside([ 1.5, 2.2 ], polygon));
t.ok(!inside([ 3, 5 ], polygon));
t.end();
});
test('flat flag', function (t) {
var polygon = [ 1, 1, 10, 1, 5, 5, 10, 10, 1, 10 ];
t.ok(inside([ 2, 5 ], polygon));
t.ok(inside([ 3, 5 ], polygon));
t.ok(inside([ 4, 5 ], polygon));
t.ok(!inside([ 10, 5 ], polygon));
t.ok(!inside([ 11, 5 ], polygon));
t.ok(!inside([ 9, 5 ], polygon));
t.end();
});