add immoweb ui
This commit is contained in:
parent
7e8c79d3d1
commit
151da16c27
266 changed files with 264879 additions and 0 deletions
20
immoweb/node_modules/@turf/hex-grid/LICENSE
generated
vendored
Normal file
20
immoweb/node_modules/@turf/hex-grid/LICENSE
generated
vendored
Normal 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.
|
||||
53
immoweb/node_modules/@turf/hex-grid/README.md
generated
vendored
Normal file
53
immoweb/node_modules/@turf/hex-grid/README.md
generated
vendored
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
# @turf/hex-grid
|
||||
|
||||
# hexGrid
|
||||
|
||||
Takes a bounding box and a cell size in degrees and returns a [FeatureCollection](http://geojson.org/geojson-spec.html#feature-collection-objects) of flat-topped
|
||||
hexagons ([Polygon](http://geojson.org/geojson-spec.html#polygon) features) aligned in an "odd-q" vertical grid as
|
||||
described in [Hexagonal Grids](http://www.redblobgames.com/grids/hexagons/).
|
||||
|
||||
**Parameters**
|
||||
|
||||
- `bbox` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)>** extent in [minX, minY, maxX, maxY] order
|
||||
- `cellSize` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** dimension of cell in specified units
|
||||
- `units` **\[[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)]** used in calculating cellSize, can be degrees, radians, miles, or kilometers (optional, default `kilometers`)
|
||||
- `triangles` **\[[boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)]** whether to return as triangles instead of hexagons (optional, default `false`)
|
||||
|
||||
**Examples**
|
||||
|
||||
```javascript
|
||||
var bbox = [-96,31,-84,40];
|
||||
var cellSize = 50;
|
||||
var units = 'miles';
|
||||
|
||||
var hexgrid = turf.hexGrid(bbox, cellSize, units);
|
||||
|
||||
//=hexgrid
|
||||
```
|
||||
|
||||
Returns **[FeatureCollection](http://geojson.org/geojson-spec.html#feature-collection-objects)<[Polygon](http://geojson.org/geojson-spec.html#polygon)>** a hexagonal grid
|
||||
|
||||
<!-- 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
|
||||
```
|
||||
8
immoweb/node_modules/@turf/hex-grid/index.d.ts
generated
vendored
Normal file
8
immoweb/node_modules/@turf/hex-grid/index.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
import {Units, BBox, Polygons} from '@turf/helpers'
|
||||
|
||||
/**
|
||||
* http://turfjs.org/docs/#hexgrid
|
||||
*/
|
||||
declare function hexGrid(bbox: BBox, cellSize: number, units?: Units, triangles?: boolean): Polygons;
|
||||
declare namespace hexGrid { }
|
||||
export = hexGrid;
|
||||
130
immoweb/node_modules/@turf/hex-grid/index.js
generated
vendored
Normal file
130
immoweb/node_modules/@turf/hex-grid/index.js
generated
vendored
Normal file
|
|
@ -0,0 +1,130 @@
|
|||
var point = require('@turf/helpers').point;
|
||||
var polygon = require('@turf/helpers').polygon;
|
||||
var distance = require('@turf/distance');
|
||||
var featurecollection = require('@turf/helpers').featureCollection;
|
||||
|
||||
//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));
|
||||
}
|
||||
|
||||
/**
|
||||
* Takes a bounding box and a cell size in degrees and returns a {@link FeatureCollection} of flat-topped
|
||||
* hexagons ({@link Polygon} features) aligned in an "odd-q" vertical grid as
|
||||
* described in [Hexagonal Grids](http://www.redblobgames.com/grids/hexagons/).
|
||||
*
|
||||
* @name hexGrid
|
||||
* @param {Array<number>} bbox extent in [minX, minY, maxX, maxY] order
|
||||
* @param {number} cellSize dimension of cell in specified units
|
||||
* @param {string} [units=kilometers] used in calculating cellSize, can be degrees, radians, miles, or kilometers
|
||||
* @param {boolean} [triangles=false] whether to return as triangles instead of hexagons
|
||||
* @returns {FeatureCollection<Polygon>} a hexagonal grid
|
||||
* @example
|
||||
* var bbox = [-96,31,-84,40];
|
||||
* var cellSize = 50;
|
||||
* var units = 'miles';
|
||||
*
|
||||
* var hexgrid = turf.hexGrid(bbox, cellSize, units);
|
||||
*
|
||||
* //=hexgrid
|
||||
*/
|
||||
module.exports = function hexGrid(bbox, cellSize, units, triangles) {
|
||||
var xFraction = cellSize / (distance(point([bbox[0], bbox[1]]), point([bbox[2], bbox[1]]), units));
|
||||
var cellWidth = xFraction * (bbox[2] - bbox[0]);
|
||||
var yFraction = cellSize / (distance(point([bbox[0], bbox[1]]), point([bbox[0], bbox[3]]), units));
|
||||
var cellHeight = yFraction * (bbox[3] - bbox[1]);
|
||||
var radius = cellWidth / 2;
|
||||
|
||||
var hex_width = radius * 2;
|
||||
var hex_height = Math.sqrt(3) / 2 * cellHeight;
|
||||
|
||||
var box_width = bbox[2] - bbox[0];
|
||||
var box_height = bbox[3] - bbox[1];
|
||||
|
||||
var x_interval = 3 / 4 * hex_width;
|
||||
var y_interval = hex_height;
|
||||
|
||||
var x_span = box_width / (hex_width - radius / 2);
|
||||
var x_count = Math.ceil(x_span);
|
||||
if (Math.round(x_span) === x_count) {
|
||||
x_count++;
|
||||
}
|
||||
|
||||
var x_adjust = ((x_count * x_interval - radius / 2) - box_width) / 2 - radius / 2;
|
||||
|
||||
var y_count = Math.ceil(box_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;
|
||||
}
|
||||
|
||||
var fc = featurecollection([]);
|
||||
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 + bbox[0] - x_adjust;
|
||||
var center_y = y * y_interval + bbox[1] + y_adjust;
|
||||
|
||||
if (isOdd) {
|
||||
center_y -= hex_height / 2;
|
||||
}
|
||||
if (triangles) {
|
||||
fc.features.push.apply(fc.features, hexTriangles([center_x, center_y], cellWidth / 2, cellHeight / 2));
|
||||
} else {
|
||||
fc.features.push(hexagon([center_x, center_y], cellWidth / 2, cellHeight / 2));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return fc;
|
||||
};
|
||||
|
||||
//Center should be [x, y]
|
||||
function hexagon(center, rx, ry) {
|
||||
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]);
|
||||
return polygon([vertices]);
|
||||
}
|
||||
|
||||
//Center should be [x, y]
|
||||
function hexTriangles(center, rx, ry) {
|
||||
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]));
|
||||
}
|
||||
return triangles;
|
||||
}
|
||||
91
immoweb/node_modules/@turf/hex-grid/package.json
generated
vendored
Normal file
91
immoweb/node_modules/@turf/hex-grid/package.json
generated
vendored
Normal file
|
|
@ -0,0 +1,91 @@
|
|||
{
|
||||
"_from": "@turf/hex-grid@^3.10.3",
|
||||
"_id": "@turf/hex-grid@3.14.0",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha1-noA28SceUWS/ao8BfenA9JAtmp8=",
|
||||
"_location": "/@turf/hex-grid",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "@turf/hex-grid@^3.10.3",
|
||||
"name": "@turf/hex-grid",
|
||||
"escapedName": "@turf%2fhex-grid",
|
||||
"scope": "@turf",
|
||||
"rawSpec": "^3.10.3",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "^3.10.3"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/hexgrid-heatmap"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/@turf/hex-grid/-/hex-grid-3.14.0.tgz",
|
||||
"_shasum": "9e8036f1271e5164bf6a8f017de9c0f4902d9a9f",
|
||||
"_spec": "@turf/hex-grid@^3.10.3",
|
||||
"_where": "/home/kadir/workspace/webimmo/node_modules/hexgrid-heatmap",
|
||||
"author": {
|
||||
"name": "Turf Authors"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/Turfjs/turf/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"contributors": [
|
||||
{
|
||||
"name": "jseppi"
|
||||
},
|
||||
{
|
||||
"name": "jvail"
|
||||
},
|
||||
{
|
||||
"name": "lyzidiamond"
|
||||
},
|
||||
{
|
||||
"name": "tmcw"
|
||||
}
|
||||
],
|
||||
"dependencies": {
|
||||
"@turf/distance": "^3.14.0",
|
||||
"@turf/helpers": "^3.13.0"
|
||||
},
|
||||
"deprecated": false,
|
||||
"description": "turf hex-grid module",
|
||||
"devDependencies": {
|
||||
"@turf/bbox-polygon": "^3.14.0",
|
||||
"@turf/explode": "^3.14.0",
|
||||
"@turf/inside": "^3.14.0",
|
||||
"@turf/truncate": "^3.13.0",
|
||||
"benchmark": "^1.0.0",
|
||||
"eslint": "^3.15.0",
|
||||
"eslint-config-mourner": "^2.0.1",
|
||||
"load-json-file": "^2.0.0",
|
||||
"tape": "^3.5.0",
|
||||
"write-json-file": "^2.0.0"
|
||||
},
|
||||
"files": [
|
||||
"index.js",
|
||||
"index.d.ts"
|
||||
],
|
||||
"homepage": "https://github.com/Turfjs/turf",
|
||||
"keywords": [
|
||||
"turf",
|
||||
"grid",
|
||||
"hexgrid",
|
||||
"hexbin",
|
||||
"points",
|
||||
"geojson"
|
||||
],
|
||||
"license": "MIT",
|
||||
"main": "index.js",
|
||||
"name": "@turf/hex-grid",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/Turfjs/turf.git"
|
||||
},
|
||||
"scripts": {
|
||||
"bench": "node bench.js",
|
||||
"test": "node test.js"
|
||||
},
|
||||
"types": "index.d.ts",
|
||||
"version": "3.14.0"
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue