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

20
frontend/node_modules/@turf/hex-grid/LICENSE generated vendored Normal file
View File

@@ -0,0 +1,20 @@
The MIT License (MIT)
Copyright (c) 2017 TurfJS
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.

82
frontend/node_modules/@turf/hex-grid/README.md generated vendored Normal file
View File

@@ -0,0 +1,82 @@
# @turf/hex-grid
<!-- Generated by documentation.js. Update this documentation by updating the source code. -->
## hexGrid
Takes a bounding box and the diameter of the cell and returns a [FeatureCollection][1] of flat-topped
hexagons or triangles ([Polygon][2] features) aligned in an "odd-q" vertical grid as
described in [Hexagonal Grids][3].
**Parameters**
- `bbox` **[BBox][4]** extent in [minX, minY, maxX, maxY] order
- `cellSide` **[number][5]** length of the side of the the hexagons or triangles, in units. It will also coincide with the
radius of the circumcircle of the hexagons.
- `options` **[Object][6]** Optional parameters (optional, default `{}`)
- `options.units` **[string][7]** used in calculating cell size, can be degrees, radians, miles, or kilometers (optional, default `'kilometers'`)
- `options.properties` **[Object][6]** passed to each hexagon or triangle of the grid (optional, default `{}`)
- `options.mask` **[Feature][8]&lt;[Polygon][9]>?** if passed a Polygon or MultiPolygon, the grid Points will be created only inside it
- `options.triangles` **[boolean][10]** whether to return as triangles instead of hexagons (optional, default `false`)
**Examples**
```javascript
var bbox = [-96,31,-84,40];
var cellSide = 50;
var options = {units: 'miles'};
var hexgrid = turf.hexGrid(bbox, cellSide, options);
//addToMap
var addToMap = [hexgrid];
```
Returns **[FeatureCollection][11]&lt;[Polygon][9]>** a hexagonal grid
[1]: https://tools.ietf.org/html/rfc7946#section-3.3
[2]: https://tools.ietf.org/html/rfc7946#section-3.1.6
[3]: http://www.redblobgames.com/grids/hexagons/
[4]: https://tools.ietf.org/html/rfc7946#section-5
[5]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number
[6]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object
[7]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String
[8]: https://tools.ietf.org/html/rfc7946#section-3.2
[9]: https://tools.ietf.org/html/rfc7946#section-3.1.6
[10]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean
[11]: https://tools.ietf.org/html/rfc7946#section-3.3
<!-- This file is automatically generated. Please don't edit it directly:
if you find an error, edit the source file (likely index.js), and re-run
./scripts/generate-readmes in the turf project. -->
---
This module is part of the [Turfjs project](http://turfjs.org/), an open source
module collection dedicated to geographic algorithms. It is maintained in the
[Turfjs/turf](https://github.com/Turfjs/turf) repository, where you can create
PRs and issues.
### Installation
Install this module individually:
```sh
$ npm install @turf/hex-grid
```
Or install the Turf module that includes it as a function:
```sh
$ npm install @turf/turf
```

157
frontend/node_modules/@turf/hex-grid/dist/es/index.js generated vendored Executable file
View File

@@ -0,0 +1,157 @@
import distance from "@turf/distance";
import intersect from "@turf/intersect";
import { polygon, featureCollection, } from "@turf/helpers";
/**
* Takes a bounding box and the diameter of the cell and returns a {@link FeatureCollection} of flat-topped
* hexagons or triangles ({@link Polygon} features) aligned in an "odd-q" vertical grid as
* described in [Hexagonal Grids](http://www.redblobgames.com/grids/hexagons/).
*
* @name hexGrid
* @param {BBox} bbox extent in [minX, minY, maxX, maxY] order
* @param {number} cellSide length of the side of the the hexagons or triangles, in units. It will also coincide with the
* radius of the circumcircle of the hexagons.
* @param {Object} [options={}] Optional parameters
* @param {string} [options.units='kilometers'] used in calculating cell size, can be degrees, radians, miles, or kilometers
* @param {Object} [options.properties={}] passed to each hexagon or triangle of the grid
* @param {Feature<Polygon>} [options.mask] if passed a Polygon or MultiPolygon, the grid Points will be created only inside it
* @param {boolean} [options.triangles=false] whether to return as triangles instead of hexagons
* @returns {FeatureCollection<Polygon>} a hexagonal grid
* @example
* var bbox = [-96,31,-84,40];
* var cellSide = 50;
* var options = {units: 'miles'};
*
* var hexgrid = turf.hexGrid(bbox, cellSide, options);
*
* //addToMap
* var addToMap = [hexgrid];
*/
function hexGrid(bbox, cellSide, options) {
if (options === void 0) { options = {}; }
// Issue => https://github.com/Turfjs/turf/issues/1284
var clonedProperties = JSON.stringify(options.properties || {});
var west = bbox[0], south = bbox[1], east = bbox[2], north = bbox[3];
var centerY = (south + north) / 2;
var centerX = (west + east) / 2;
// https://github.com/Turfjs/turf/issues/758
var xFraction = (cellSide * 2) / distance([west, centerY], [east, centerY], options);
var cellWidth = xFraction * (east - west);
var yFraction = (cellSide * 2) / distance([centerX, south], [centerX, north], options);
var cellHeight = yFraction * (north - south);
var radius = cellWidth / 2;
var hex_width = radius * 2;
var hex_height = (Math.sqrt(3) / 2) * cellHeight;
var box_width = east - west;
var box_height = north - south;
var x_interval = (3 / 4) * hex_width;
var y_interval = hex_height;
// adjust box_width so all hexagons will be inside the bbox
var x_span = (box_width - hex_width) / (hex_width - radius / 2);
var x_count = Math.floor(x_span);
var x_adjust = (x_count * x_interval - radius / 2 - box_width) / 2 -
radius / 2 +
x_interval / 2;
// adjust box_height so all hexagons will be inside the bbox
var y_count = Math.floor((box_height - hex_height) / hex_height);
var y_adjust = (box_height - y_count * hex_height) / 2;
var hasOffsetY = y_count * hex_height - box_height > hex_height / 2;
if (hasOffsetY) {
y_adjust -= hex_height / 4;
}
// Precompute cosines and sines of angles used in hexagon creation for performance gain
var cosines = [];
var sines = [];
for (var i = 0; i < 6; i++) {
var angle = ((2 * Math.PI) / 6) * i;
cosines.push(Math.cos(angle));
sines.push(Math.sin(angle));
}
var results = [];
for (var x = 0; x <= x_count; x++) {
for (var y = 0; y <= y_count; y++) {
var isOdd = x % 2 === 1;
if (y === 0 && isOdd)
continue;
if (y === 0 && hasOffsetY)
continue;
var center_x = x * x_interval + west - x_adjust;
var center_y = y * y_interval + south + y_adjust;
if (isOdd) {
center_y -= hex_height / 2;
}
if (options.triangles === true) {
hexTriangles([center_x, center_y], cellWidth / 2, cellHeight / 2, JSON.parse(clonedProperties), cosines, sines).forEach(function (triangle) {
if (options.mask) {
if (intersect(options.mask, triangle))
results.push(triangle);
}
else {
results.push(triangle);
}
});
}
else {
var hex = hexagon([center_x, center_y], cellWidth / 2, cellHeight / 2, JSON.parse(clonedProperties), cosines, sines);
if (options.mask) {
if (intersect(options.mask, hex))
results.push(hex);
}
else {
results.push(hex);
}
}
}
}
return featureCollection(results);
}
/**
* Creates hexagon
*
* @private
* @param {Array<number>} center of the hexagon
* @param {number} rx half hexagon width
* @param {number} ry half hexagon height
* @param {Object} properties passed to each hexagon
* @param {Array<number>} cosines precomputed
* @param {Array<number>} sines precomputed
* @returns {Feature<Polygon>} hexagon
*/
function hexagon(center, rx, ry, properties, cosines, sines) {
var vertices = [];
for (var i = 0; i < 6; i++) {
var x = center[0] + rx * cosines[i];
var y = center[1] + ry * sines[i];
vertices.push([x, y]);
}
//first and last vertex must be the same
vertices.push(vertices[0].slice());
return polygon([vertices], properties);
}
/**
* Creates triangles composing an hexagon
*
* @private
* @param {Array<number>} center of the hexagon
* @param {number} rx half triangle width
* @param {number} ry half triangle height
* @param {Object} properties passed to each triangle
* @param {Array<number>} cosines precomputed
* @param {Array<number>} sines precomputed
* @returns {Array<Feature<Polygon>>} triangles
*/
function hexTriangles(center, rx, ry, properties, cosines, sines) {
var triangles = [];
for (var i = 0; i < 6; i++) {
var vertices = [];
vertices.push(center);
vertices.push([center[0] + rx * cosines[i], center[1] + ry * sines[i]]);
vertices.push([
center[0] + rx * cosines[(i + 1) % 6],
center[1] + ry * sines[(i + 1) % 6],
]);
vertices.push(center);
triangles.push(polygon([vertices], properties));
}
return triangles;
}
export default hexGrid;

View File

@@ -0,0 +1 @@
{"type":"module"}

33
frontend/node_modules/@turf/hex-grid/dist/js/index.d.ts generated vendored Executable file
View File

@@ -0,0 +1,33 @@
import { Feature, FeatureCollection, Units, Properties, Polygon, BBox } from "@turf/helpers";
/**
* Takes a bounding box and the diameter of the cell and returns a {@link FeatureCollection} of flat-topped
* hexagons or triangles ({@link Polygon} features) aligned in an "odd-q" vertical grid as
* described in [Hexagonal Grids](http://www.redblobgames.com/grids/hexagons/).
*
* @name hexGrid
* @param {BBox} bbox extent in [minX, minY, maxX, maxY] order
* @param {number} cellSide length of the side of the the hexagons or triangles, in units. It will also coincide with the
* radius of the circumcircle of the hexagons.
* @param {Object} [options={}] Optional parameters
* @param {string} [options.units='kilometers'] used in calculating cell size, can be degrees, radians, miles, or kilometers
* @param {Object} [options.properties={}] passed to each hexagon or triangle of the grid
* @param {Feature<Polygon>} [options.mask] if passed a Polygon or MultiPolygon, the grid Points will be created only inside it
* @param {boolean} [options.triangles=false] whether to return as triangles instead of hexagons
* @returns {FeatureCollection<Polygon>} a hexagonal grid
* @example
* var bbox = [-96,31,-84,40];
* var cellSide = 50;
* var options = {units: 'miles'};
*
* var hexgrid = turf.hexGrid(bbox, cellSide, options);
*
* //addToMap
* var addToMap = [hexgrid];
*/
declare function hexGrid<P = Properties>(bbox: BBox, cellSide: number, options?: {
units?: Units;
triangles?: boolean;
properties?: P;
mask?: Feature<Polygon> | Polygon;
}): FeatureCollection<Polygon, P>;
export default hexGrid;

162
frontend/node_modules/@turf/hex-grid/dist/js/index.js generated vendored Executable file
View File

@@ -0,0 +1,162 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
var distance_1 = __importDefault(require("@turf/distance"));
var intersect_1 = __importDefault(require("@turf/intersect"));
var helpers_1 = require("@turf/helpers");
/**
* Takes a bounding box and the diameter of the cell and returns a {@link FeatureCollection} of flat-topped
* hexagons or triangles ({@link Polygon} features) aligned in an "odd-q" vertical grid as
* described in [Hexagonal Grids](http://www.redblobgames.com/grids/hexagons/).
*
* @name hexGrid
* @param {BBox} bbox extent in [minX, minY, maxX, maxY] order
* @param {number} cellSide length of the side of the the hexagons or triangles, in units. It will also coincide with the
* radius of the circumcircle of the hexagons.
* @param {Object} [options={}] Optional parameters
* @param {string} [options.units='kilometers'] used in calculating cell size, can be degrees, radians, miles, or kilometers
* @param {Object} [options.properties={}] passed to each hexagon or triangle of the grid
* @param {Feature<Polygon>} [options.mask] if passed a Polygon or MultiPolygon, the grid Points will be created only inside it
* @param {boolean} [options.triangles=false] whether to return as triangles instead of hexagons
* @returns {FeatureCollection<Polygon>} a hexagonal grid
* @example
* var bbox = [-96,31,-84,40];
* var cellSide = 50;
* var options = {units: 'miles'};
*
* var hexgrid = turf.hexGrid(bbox, cellSide, options);
*
* //addToMap
* var addToMap = [hexgrid];
*/
function hexGrid(bbox, cellSide, options) {
if (options === void 0) { options = {}; }
// Issue => https://github.com/Turfjs/turf/issues/1284
var clonedProperties = JSON.stringify(options.properties || {});
var west = bbox[0], south = bbox[1], east = bbox[2], north = bbox[3];
var centerY = (south + north) / 2;
var centerX = (west + east) / 2;
// https://github.com/Turfjs/turf/issues/758
var xFraction = (cellSide * 2) / distance_1.default([west, centerY], [east, centerY], options);
var cellWidth = xFraction * (east - west);
var yFraction = (cellSide * 2) / distance_1.default([centerX, south], [centerX, north], options);
var cellHeight = yFraction * (north - south);
var radius = cellWidth / 2;
var hex_width = radius * 2;
var hex_height = (Math.sqrt(3) / 2) * cellHeight;
var box_width = east - west;
var box_height = north - south;
var x_interval = (3 / 4) * hex_width;
var y_interval = hex_height;
// adjust box_width so all hexagons will be inside the bbox
var x_span = (box_width - hex_width) / (hex_width - radius / 2);
var x_count = Math.floor(x_span);
var x_adjust = (x_count * x_interval - radius / 2 - box_width) / 2 -
radius / 2 +
x_interval / 2;
// adjust box_height so all hexagons will be inside the bbox
var y_count = Math.floor((box_height - hex_height) / hex_height);
var y_adjust = (box_height - y_count * hex_height) / 2;
var hasOffsetY = y_count * hex_height - box_height > hex_height / 2;
if (hasOffsetY) {
y_adjust -= hex_height / 4;
}
// Precompute cosines and sines of angles used in hexagon creation for performance gain
var cosines = [];
var sines = [];
for (var i = 0; i < 6; i++) {
var angle = ((2 * Math.PI) / 6) * i;
cosines.push(Math.cos(angle));
sines.push(Math.sin(angle));
}
var results = [];
for (var x = 0; x <= x_count; x++) {
for (var y = 0; y <= y_count; y++) {
var isOdd = x % 2 === 1;
if (y === 0 && isOdd)
continue;
if (y === 0 && hasOffsetY)
continue;
var center_x = x * x_interval + west - x_adjust;
var center_y = y * y_interval + south + y_adjust;
if (isOdd) {
center_y -= hex_height / 2;
}
if (options.triangles === true) {
hexTriangles([center_x, center_y], cellWidth / 2, cellHeight / 2, JSON.parse(clonedProperties), cosines, sines).forEach(function (triangle) {
if (options.mask) {
if (intersect_1.default(options.mask, triangle))
results.push(triangle);
}
else {
results.push(triangle);
}
});
}
else {
var hex = hexagon([center_x, center_y], cellWidth / 2, cellHeight / 2, JSON.parse(clonedProperties), cosines, sines);
if (options.mask) {
if (intersect_1.default(options.mask, hex))
results.push(hex);
}
else {
results.push(hex);
}
}
}
}
return helpers_1.featureCollection(results);
}
/**
* Creates hexagon
*
* @private
* @param {Array<number>} center of the hexagon
* @param {number} rx half hexagon width
* @param {number} ry half hexagon height
* @param {Object} properties passed to each hexagon
* @param {Array<number>} cosines precomputed
* @param {Array<number>} sines precomputed
* @returns {Feature<Polygon>} hexagon
*/
function hexagon(center, rx, ry, properties, cosines, sines) {
var vertices = [];
for (var i = 0; i < 6; i++) {
var x = center[0] + rx * cosines[i];
var y = center[1] + ry * sines[i];
vertices.push([x, y]);
}
//first and last vertex must be the same
vertices.push(vertices[0].slice());
return helpers_1.polygon([vertices], properties);
}
/**
* Creates triangles composing an hexagon
*
* @private
* @param {Array<number>} center of the hexagon
* @param {number} rx half triangle width
* @param {number} ry half triangle height
* @param {Object} properties passed to each triangle
* @param {Array<number>} cosines precomputed
* @param {Array<number>} sines precomputed
* @returns {Array<Feature<Polygon>>} triangles
*/
function hexTriangles(center, rx, ry, properties, cosines, sines) {
var triangles = [];
for (var i = 0; i < 6; i++) {
var vertices = [];
vertices.push(center);
vertices.push([center[0] + rx * cosines[i], center[1] + ry * sines[i]]);
vertices.push([
center[0] + rx * cosines[(i + 1) % 6],
center[1] + ry * sines[(i + 1) % 6],
]);
vertices.push(center);
triangles.push(helpers_1.polygon([vertices], properties));
}
return triangles;
}
exports.default = hexGrid;

79
frontend/node_modules/@turf/hex-grid/package.json generated vendored Normal file
View File

@@ -0,0 +1,79 @@
{
"name": "@turf/hex-grid",
"version": "6.5.0",
"description": "turf hex-grid module",
"author": "Turf Authors",
"contributors": [
"James Seppi <@jseppi>",
"Morgan Herlocker <@morganherlocker>",
"Tom MacWright <@tmcw>",
"Jan Vaillant <@jvail>",
"Lyzi Diamond <@lyzidiamond>",
"Denis Carriere <@DenisCarriere>"
],
"license": "MIT",
"bugs": {
"url": "https://github.com/Turfjs/turf/issues"
},
"homepage": "https://github.com/Turfjs/turf",
"repository": {
"type": "git",
"url": "git://github.com/Turfjs/turf.git"
},
"funding": "https://opencollective.com/turf",
"publishConfig": {
"access": "public"
},
"keywords": [
"turf",
"grid",
"hexgrid",
"hexbin",
"points",
"geojson"
],
"main": "dist/js/index.js",
"module": "dist/es/index.js",
"exports": {
"./package.json": "./package.json",
".": {
"import": "./dist/es/index.js",
"require": "./dist/js/index.js"
}
},
"types": "dist/js/index.d.ts",
"sideEffects": false,
"files": [
"dist"
],
"scripts": {
"bench": "ts-node bench.js",
"build": "npm-run-all build:*",
"build:es": "tsc --outDir dist/es --module esnext --declaration false && echo '{\"type\":\"module\"}' > dist/es/package.json",
"build:js": "tsc",
"docs": "node ../../scripts/generate-readmes",
"test": "npm-run-all test:*",
"test:tape": "ts-node -r esm test.js",
"test:types": "tsc --esModuleInterop --noEmit types.ts"
},
"devDependencies": {
"@turf/bbox-polygon": "^6.5.0",
"@turf/truncate": "^6.5.0",
"@types/tape": "*",
"benchmark": "*",
"load-json-file": "*",
"npm-run-all": "*",
"tape": "*",
"ts-node": "*",
"tslint": "*",
"typescript": "*",
"write-json-file": "*"
},
"dependencies": {
"@turf/distance": "^6.5.0",
"@turf/helpers": "^6.5.0",
"@turf/intersect": "^6.5.0",
"@turf/invariant": "^6.5.0"
},
"gitHead": "5375941072b90d489389db22b43bfe809d5e451e"
}