@deck.gl/aggregation-layers 8.8.0-alpha.3 → 8.8.0-alpha.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/dist.dev.js +30 -25
- package/dist/es5/heatmap-layer/heatmap-layer-utils.js +5 -2
- package/dist/es5/heatmap-layer/heatmap-layer-utils.js.map +1 -1
- package/dist/es5/heatmap-layer/heatmap-layer.js +2 -1
- package/dist/es5/heatmap-layer/heatmap-layer.js.map +1 -1
- package/dist/esm/heatmap-layer/heatmap-layer-utils.js +5 -2
- package/dist/esm/heatmap-layer/heatmap-layer-utils.js.map +1 -1
- package/dist/esm/heatmap-layer/heatmap-layer.js +2 -1
- package/dist/esm/heatmap-layer/heatmap-layer.js.map +1 -1
- package/dist.min.js +1 -1
- package/package.json +5 -4
- package/src/heatmap-layer/heatmap-layer-utils.js +10 -5
- package/src/heatmap-layer/heatmap-layer.js +6 -2
- package/typed/aggregation-layer.d.ts +33 -0
- package/typed/aggregation-layer.d.ts.map +1 -0
- package/typed/contour-layer/contour-layer.d.ts +39 -0
- package/typed/contour-layer/contour-layer.d.ts.map +1 -0
- package/typed/contour-layer/contour-utils.d.ts +19 -0
- package/typed/contour-layer/contour-utils.d.ts.map +1 -0
- package/typed/contour-layer/marching-squares-codes.d.ts +32 -0
- package/typed/contour-layer/marching-squares-codes.d.ts.map +1 -0
- package/typed/contour-layer/marching-squares.d.ts +10 -0
- package/typed/contour-layer/marching-squares.d.ts.map +1 -0
- package/typed/cpu-grid-layer/cpu-grid-layer.d.ts +131 -0
- package/typed/cpu-grid-layer/cpu-grid-layer.d.ts.map +1 -0
- package/typed/cpu-grid-layer/grid-aggregator.d.ts +23 -0
- package/typed/cpu-grid-layer/grid-aggregator.d.ts.map +1 -0
- package/typed/gpu-grid-layer/gpu-grid-cell-layer-fragment.glsl.d.ts +3 -0
- package/typed/gpu-grid-layer/gpu-grid-cell-layer-fragment.glsl.d.ts.map +1 -0
- package/typed/gpu-grid-layer/gpu-grid-cell-layer-vertex.glsl.d.ts +3 -0
- package/typed/gpu-grid-layer/gpu-grid-cell-layer-vertex.glsl.d.ts.map +1 -0
- package/typed/gpu-grid-layer/gpu-grid-cell-layer.d.ts +85 -0
- package/typed/gpu-grid-layer/gpu-grid-cell-layer.d.ts.map +1 -0
- package/typed/gpu-grid-layer/gpu-grid-layer.d.ts +65 -0
- package/typed/gpu-grid-layer/gpu-grid-layer.d.ts.map +1 -0
- package/typed/grid-aggregation-layer.d.ts +19 -0
- package/typed/grid-aggregation-layer.d.ts.map +1 -0
- package/typed/grid-layer/grid-layer.d.ts +93 -0
- package/typed/grid-layer/grid-layer.d.ts.map +1 -0
- package/typed/heatmap-layer/heatmap-layer-utils.d.ts +13 -0
- package/typed/heatmap-layer/heatmap-layer-utils.d.ts.map +1 -0
- package/typed/heatmap-layer/heatmap-layer.d.ts +96 -0
- package/typed/heatmap-layer/heatmap-layer.d.ts.map +1 -0
- package/typed/heatmap-layer/max-fs.glsl.d.ts +3 -0
- package/typed/heatmap-layer/max-fs.glsl.d.ts.map +1 -0
- package/typed/heatmap-layer/max-vs.glsl.d.ts +3 -0
- package/typed/heatmap-layer/max-vs.glsl.d.ts.map +1 -0
- package/typed/heatmap-layer/triangle-layer-fragment.glsl.d.ts +3 -0
- package/typed/heatmap-layer/triangle-layer-fragment.glsl.d.ts.map +1 -0
- package/typed/heatmap-layer/triangle-layer-vertex.glsl.d.ts +3 -0
- package/typed/heatmap-layer/triangle-layer-vertex.glsl.d.ts.map +1 -0
- package/typed/heatmap-layer/triangle-layer.d.ts +10 -0
- package/typed/heatmap-layer/triangle-layer.d.ts.map +1 -0
- package/typed/heatmap-layer/weights-fs.glsl.d.ts +3 -0
- package/typed/heatmap-layer/weights-fs.glsl.d.ts.map +1 -0
- package/typed/heatmap-layer/weights-vs.glsl.d.ts +3 -0
- package/typed/heatmap-layer/weights-vs.glsl.d.ts.map +1 -0
- package/typed/hexagon-layer/hexagon-aggregator.d.ts +24 -0
- package/typed/hexagon-layer/hexagon-aggregator.d.ts.map +1 -0
- package/typed/hexagon-layer/hexagon-layer.d.ts +130 -0
- package/typed/hexagon-layer/hexagon-layer.d.ts.map +1 -0
- package/typed/index.d.ts +13 -0
- package/typed/index.d.ts.map +1 -0
- package/typed/package.json +6 -0
- package/typed/screen-grid-layer/screen-grid-cell-layer.d.ts +33 -0
- package/typed/screen-grid-layer/screen-grid-cell-layer.d.ts.map +1 -0
- package/typed/screen-grid-layer/screen-grid-layer-fragment.glsl.d.ts +3 -0
- package/typed/screen-grid-layer/screen-grid-layer-fragment.glsl.d.ts.map +1 -0
- package/typed/screen-grid-layer/screen-grid-layer-vertex.glsl.d.ts +3 -0
- package/typed/screen-grid-layer/screen-grid-layer-vertex.glsl.d.ts.map +1 -0
- package/typed/screen-grid-layer/screen-grid-layer.d.ts +34 -0
- package/typed/screen-grid-layer/screen-grid-layer.d.ts.map +1 -0
- package/typed/utils/aggregation-operation-utils.d.ts +13 -0
- package/typed/utils/aggregation-operation-utils.d.ts.map +1 -0
- package/typed/utils/bin-sorter.d.ts +46 -0
- package/typed/utils/bin-sorter.d.ts.map +1 -0
- package/typed/utils/color-utils.d.ts +3 -0
- package/typed/utils/color-utils.d.ts.map +1 -0
- package/typed/utils/cpu-aggregator.d.ts +155 -0
- package/typed/utils/cpu-aggregator.d.ts.map +1 -0
- package/typed/utils/gpu-grid-aggregation/aggregate-all-fs.glsl.d.ts +3 -0
- package/typed/utils/gpu-grid-aggregation/aggregate-all-fs.glsl.d.ts.map +1 -0
- package/typed/utils/gpu-grid-aggregation/aggregate-all-vs.glsl.d.ts +3 -0
- package/typed/utils/gpu-grid-aggregation/aggregate-all-vs.glsl.d.ts.map +1 -0
- package/typed/utils/gpu-grid-aggregation/aggregate-to-grid-fs.glsl.d.ts +3 -0
- package/typed/utils/gpu-grid-aggregation/aggregate-to-grid-fs.glsl.d.ts.map +1 -0
- package/typed/utils/gpu-grid-aggregation/aggregate-to-grid-vs.glsl.d.ts +3 -0
- package/typed/utils/gpu-grid-aggregation/aggregate-to-grid-vs.glsl.d.ts.map +1 -0
- package/typed/utils/gpu-grid-aggregation/gpu-grid-aggregator-constants.d.ts +36 -0
- package/typed/utils/gpu-grid-aggregation/gpu-grid-aggregator-constants.d.ts.map +1 -0
- package/typed/utils/gpu-grid-aggregation/gpu-grid-aggregator-utils.d.ts +1 -0
- package/typed/utils/gpu-grid-aggregation/gpu-grid-aggregator-utils.d.ts.map +1 -0
- package/typed/utils/gpu-grid-aggregation/gpu-grid-aggregator.d.ts +66 -0
- package/typed/utils/gpu-grid-aggregation/gpu-grid-aggregator.d.ts.map +1 -0
- package/typed/utils/gpu-grid-aggregation/transform-mean-vs.glsl.d.ts +3 -0
- package/typed/utils/gpu-grid-aggregation/transform-mean-vs.glsl.d.ts.map +1 -0
- package/typed/utils/grid-aggregation-utils.d.ts +24 -0
- package/typed/utils/grid-aggregation-utils.d.ts.map +1 -0
- package/typed/utils/prop-utils.d.ts +2 -0
- package/typed/utils/prop-utils.d.ts.map +1 -0
- package/typed/utils/resource-utils.d.ts +4 -0
- package/typed/utils/resource-utils.d.ts.map +1 -0
- package/typed/utils/scale-utils.d.ts +15 -0
- package/typed/utils/scale-utils.d.ts.map +1 -0
package/dist/dist.dev.js
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
exports["deck"] = factory(require("deck"), require("luma"));
|
|
8
8
|
else
|
|
9
9
|
root["deck"] = factory(root["deck"], root["luma"]);
|
|
10
|
-
})(window, function(
|
|
10
|
+
})(window, function(__WEBPACK_EXTERNAL_MODULE__deck_gl_layers__, __WEBPACK_EXTERNAL_MODULE__luma_gl_core__) {
|
|
11
11
|
return /******/ (function(modules) { // webpackBootstrap
|
|
12
12
|
/******/ // The module cache
|
|
13
13
|
/******/ var installedModules = {};
|
|
@@ -15573,7 +15573,7 @@ module.exports = Object.assign(deck, deckGLLayers);
|
|
|
15573
15573
|
"use strict";
|
|
15574
15574
|
__webpack_require__.r(__webpack_exports__);
|
|
15575
15575
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return AggregationLayer; });
|
|
15576
|
-
/* harmony import */ var _deck_gl_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @deck.gl/core */ "@deck.gl/
|
|
15576
|
+
/* harmony import */ var _deck_gl_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @deck.gl/core */ "@deck.gl/layers");
|
|
15577
15577
|
/* harmony import */ var _deck_gl_core__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_deck_gl_core__WEBPACK_IMPORTED_MODULE_0__);
|
|
15578
15578
|
/* harmony import */ var _luma_gl_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @luma.gl/core */ "@luma.gl/core");
|
|
15579
15579
|
/* harmony import */ var _luma_gl_core__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_luma_gl_core__WEBPACK_IMPORTED_MODULE_1__);
|
|
@@ -15795,7 +15795,7 @@ AggregationLayer.layerName = 'AggregationLayer';
|
|
|
15795
15795
|
__webpack_require__.r(__webpack_exports__);
|
|
15796
15796
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ContourLayer; });
|
|
15797
15797
|
/* harmony import */ var _luma_gl_constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @luma.gl/constants */ "../../node_modules/@luma.gl/constants/dist/esm/index.js");
|
|
15798
|
-
/* harmony import */ var _deck_gl_layers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @deck.gl/layers */ "@deck.gl/
|
|
15798
|
+
/* harmony import */ var _deck_gl_layers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @deck.gl/layers */ "@deck.gl/layers");
|
|
15799
15799
|
/* harmony import */ var _deck_gl_layers__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_deck_gl_layers__WEBPACK_IMPORTED_MODULE_1__);
|
|
15800
15800
|
/* harmony import */ var _contour_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./contour-utils */ "./src/contour-layer/contour-utils.js");
|
|
15801
15801
|
/* harmony import */ var _utils_gpu_grid_aggregation_gpu_grid_aggregator__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../utils/gpu-grid-aggregation/gpu-grid-aggregator */ "./src/utils/gpu-grid-aggregation/gpu-grid-aggregator.js");
|
|
@@ -16530,7 +16530,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
16530
16530
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CONTOUR_TYPE", function() { return CONTOUR_TYPE; });
|
|
16531
16531
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getCode", function() { return getCode; });
|
|
16532
16532
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getVertices", function() { return getVertices; });
|
|
16533
|
-
/* harmony import */ var _deck_gl_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @deck.gl/core */ "@deck.gl/
|
|
16533
|
+
/* harmony import */ var _deck_gl_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @deck.gl/core */ "@deck.gl/layers");
|
|
16534
16534
|
/* harmony import */ var _deck_gl_core__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_deck_gl_core__WEBPACK_IMPORTED_MODULE_0__);
|
|
16535
16535
|
/* harmony import */ var _marching_squares_codes__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./marching-squares-codes */ "./src/contour-layer/marching-squares-codes.js");
|
|
16536
16536
|
// All utility methods needed to implement Marching Squares algorithm
|
|
@@ -16728,7 +16728,7 @@ function getVertices(opts) {
|
|
|
16728
16728
|
"use strict";
|
|
16729
16729
|
__webpack_require__.r(__webpack_exports__);
|
|
16730
16730
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return CPUGridLayer; });
|
|
16731
|
-
/* harmony import */ var _deck_gl_layers__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @deck.gl/layers */ "@deck.gl/
|
|
16731
|
+
/* harmony import */ var _deck_gl_layers__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @deck.gl/layers */ "@deck.gl/layers");
|
|
16732
16732
|
/* harmony import */ var _deck_gl_layers__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_deck_gl_layers__WEBPACK_IMPORTED_MODULE_0__);
|
|
16733
16733
|
/* harmony import */ var _utils_color_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils/color-utils */ "./src/utils/color-utils.js");
|
|
16734
16734
|
/* harmony import */ var _grid_aggregator__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./grid-aggregator */ "./src/cpu-grid-layer/grid-aggregator.js");
|
|
@@ -16958,7 +16958,7 @@ CPUGridLayer.defaultProps = defaultProps;
|
|
|
16958
16958
|
"use strict";
|
|
16959
16959
|
__webpack_require__.r(__webpack_exports__);
|
|
16960
16960
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "pointToDensityGridDataCPU", function() { return pointToDensityGridDataCPU; });
|
|
16961
|
-
/* harmony import */ var _deck_gl_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @deck.gl/core */ "@deck.gl/
|
|
16961
|
+
/* harmony import */ var _deck_gl_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @deck.gl/core */ "@deck.gl/layers");
|
|
16962
16962
|
/* harmony import */ var _deck_gl_core__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_deck_gl_core__WEBPACK_IMPORTED_MODULE_0__);
|
|
16963
16963
|
/* harmony import */ var _utils_grid_aggregation_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils/grid-aggregation-utils */ "./src/utils/grid-aggregation-utils.js");
|
|
16964
16964
|
// Copyright (c) 2015 - 2017 Uber Technologies, Inc.
|
|
@@ -17365,7 +17365,7 @@ void main(void) {
|
|
|
17365
17365
|
"use strict";
|
|
17366
17366
|
__webpack_require__.r(__webpack_exports__);
|
|
17367
17367
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return GPUGridCellLayer; });
|
|
17368
|
-
/* harmony import */ var _deck_gl_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @deck.gl/core */ "@deck.gl/
|
|
17368
|
+
/* harmony import */ var _deck_gl_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @deck.gl/core */ "@deck.gl/layers");
|
|
17369
17369
|
/* harmony import */ var _deck_gl_core__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_deck_gl_core__WEBPACK_IMPORTED_MODULE_0__);
|
|
17370
17370
|
/* harmony import */ var _luma_gl_constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @luma.gl/constants */ "../../node_modules/@luma.gl/constants/dist/esm/index.js");
|
|
17371
17371
|
/* harmony import */ var _luma_gl_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @luma.gl/core */ "@luma.gl/core");
|
|
@@ -17605,7 +17605,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
17605
17605
|
/* harmony import */ var _luma_gl_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @luma.gl/core */ "@luma.gl/core");
|
|
17606
17606
|
/* harmony import */ var _luma_gl_core__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_luma_gl_core__WEBPACK_IMPORTED_MODULE_0__);
|
|
17607
17607
|
/* harmony import */ var _luma_gl_constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @luma.gl/constants */ "../../node_modules/@luma.gl/constants/dist/esm/index.js");
|
|
17608
|
-
/* harmony import */ var _deck_gl_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @deck.gl/core */ "@deck.gl/
|
|
17608
|
+
/* harmony import */ var _deck_gl_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @deck.gl/core */ "@deck.gl/layers");
|
|
17609
17609
|
/* harmony import */ var _deck_gl_core__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_deck_gl_core__WEBPACK_IMPORTED_MODULE_2__);
|
|
17610
17610
|
/* harmony import */ var _utils_gpu_grid_aggregation_gpu_grid_aggregator__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../utils/gpu-grid-aggregation/gpu-grid-aggregator */ "./src/utils/gpu-grid-aggregation/gpu-grid-aggregator.js");
|
|
17611
17611
|
/* harmony import */ var _utils_aggregation_operation_utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../utils/aggregation-operation-utils */ "./src/utils/aggregation-operation-utils.js");
|
|
@@ -18063,7 +18063,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
18063
18063
|
/* harmony import */ var _utils_gpu_grid_aggregation_gpu_grid_aggregator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./utils/gpu-grid-aggregation/gpu-grid-aggregator */ "./src/utils/gpu-grid-aggregation/gpu-grid-aggregator.js");
|
|
18064
18064
|
/* harmony import */ var _luma_gl_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @luma.gl/core */ "@luma.gl/core");
|
|
18065
18065
|
/* harmony import */ var _luma_gl_core__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_luma_gl_core__WEBPACK_IMPORTED_MODULE_2__);
|
|
18066
|
-
/* harmony import */ var _deck_gl_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @deck.gl/core */ "@deck.gl/
|
|
18066
|
+
/* harmony import */ var _deck_gl_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @deck.gl/core */ "@deck.gl/layers");
|
|
18067
18067
|
/* harmony import */ var _deck_gl_core__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_deck_gl_core__WEBPACK_IMPORTED_MODULE_3__);
|
|
18068
18068
|
/* harmony import */ var _luma_gl_constants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @luma.gl/constants */ "../../node_modules/@luma.gl/constants/dist/esm/index.js");
|
|
18069
18069
|
/* harmony import */ var _utils_bin_sorter__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./utils/bin-sorter */ "./src/utils/bin-sorter.js");
|
|
@@ -18346,7 +18346,7 @@ GridAggregationLayer.layerName = 'GridAggregationLayer';
|
|
|
18346
18346
|
"use strict";
|
|
18347
18347
|
__webpack_require__.r(__webpack_exports__);
|
|
18348
18348
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return GridLayer; });
|
|
18349
|
-
/* harmony import */ var _deck_gl_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @deck.gl/core */ "@deck.gl/
|
|
18349
|
+
/* harmony import */ var _deck_gl_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @deck.gl/core */ "@deck.gl/layers");
|
|
18350
18350
|
/* harmony import */ var _deck_gl_core__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_deck_gl_core__WEBPACK_IMPORTED_MODULE_0__);
|
|
18351
18351
|
/* harmony import */ var _utils_gpu_grid_aggregation_gpu_grid_aggregator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils/gpu-grid-aggregation/gpu-grid-aggregator */ "./src/utils/gpu-grid-aggregation/gpu-grid-aggregator.js");
|
|
18352
18352
|
/* harmony import */ var _gpu_grid_layer_gpu_grid_layer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../gpu-grid-layer/gpu-grid-layer */ "./src/gpu-grid-layer/gpu-grid-layer.js");
|
|
@@ -18520,10 +18520,13 @@ function getTextureParams({
|
|
|
18520
18520
|
gl,
|
|
18521
18521
|
floatTargetSupport
|
|
18522
18522
|
}) {
|
|
18523
|
-
return {
|
|
18523
|
+
return floatTargetSupport ? {
|
|
18524
18524
|
// format: should be RGBA32F on WebGL2 (float textures), RGBA in WebGL1 for float or non float textures
|
|
18525
18525
|
format: Object(_luma_gl_core__WEBPACK_IMPORTED_MODULE_1__["isWebGL2"])(gl) ? _luma_gl_constants__WEBPACK_IMPORTED_MODULE_0__["default"].RGBA32F : _luma_gl_constants__WEBPACK_IMPORTED_MODULE_0__["default"].RGBA,
|
|
18526
|
-
type:
|
|
18526
|
+
type: _luma_gl_constants__WEBPACK_IMPORTED_MODULE_0__["default"].FLOAT
|
|
18527
|
+
} : {
|
|
18528
|
+
format: _luma_gl_constants__WEBPACK_IMPORTED_MODULE_0__["default"].RGBA,
|
|
18529
|
+
type: _luma_gl_constants__WEBPACK_IMPORTED_MODULE_0__["default"].UNSIGNED_BYTE
|
|
18527
18530
|
};
|
|
18528
18531
|
}
|
|
18529
18532
|
|
|
@@ -18543,7 +18546,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
18543
18546
|
/* harmony import */ var _heatmap_layer_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./heatmap-layer-utils */ "./src/heatmap-layer/heatmap-layer-utils.js");
|
|
18544
18547
|
/* harmony import */ var _luma_gl_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @luma.gl/core */ "@luma.gl/core");
|
|
18545
18548
|
/* harmony import */ var _luma_gl_core__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_luma_gl_core__WEBPACK_IMPORTED_MODULE_2__);
|
|
18546
|
-
/* harmony import */ var _deck_gl_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @deck.gl/core */ "@deck.gl/
|
|
18549
|
+
/* harmony import */ var _deck_gl_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @deck.gl/core */ "@deck.gl/layers");
|
|
18547
18550
|
/* harmony import */ var _deck_gl_core__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_deck_gl_core__WEBPACK_IMPORTED_MODULE_3__);
|
|
18548
18551
|
/* harmony import */ var _triangle_layer__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./triangle-layer */ "./src/heatmap-layer/triangle-layer.js");
|
|
18549
18552
|
/* harmony import */ var _aggregation_layer__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../aggregation-layer */ "./src/aggregation-layer.js");
|
|
@@ -18650,7 +18653,9 @@ const defaultProps = {
|
|
|
18650
18653
|
};
|
|
18651
18654
|
const REQUIRED_FEATURES = [_luma_gl_core__WEBPACK_IMPORTED_MODULE_2__["FEATURES"].BLEND_EQUATION_MINMAX, // max weight calculation
|
|
18652
18655
|
_luma_gl_core__WEBPACK_IMPORTED_MODULE_2__["FEATURES"].TEXTURE_FLOAT // weight-map as texture
|
|
18653
|
-
|
|
18656
|
+
];
|
|
18657
|
+
const FLOAT_TARGET_FEATURES = [_luma_gl_core__WEBPACK_IMPORTED_MODULE_2__["FEATURES"].COLOR_ATTACHMENT_RGBA32F, // ability to render to float texture
|
|
18658
|
+
_luma_gl_core__WEBPACK_IMPORTED_MODULE_2__["FEATURES"].FLOAT_BLEND // ability to blend when rendering to float texture
|
|
18654
18659
|
];
|
|
18655
18660
|
const DIMENSIONS = {
|
|
18656
18661
|
data: {
|
|
@@ -18894,7 +18899,7 @@ class HeatmapLayer extends _aggregation_layer__WEBPACK_IMPORTED_MODULE_5__["defa
|
|
|
18894
18899
|
weightsTextureSize
|
|
18895
18900
|
} = this.props;
|
|
18896
18901
|
const textureSize = Math.min(weightsTextureSize, Object(_luma_gl_core__WEBPACK_IMPORTED_MODULE_2__["getParameters"])(gl, gl.MAX_TEXTURE_SIZE));
|
|
18897
|
-
const floatTargetSupport = Object(_luma_gl_core__WEBPACK_IMPORTED_MODULE_2__["hasFeatures"])(gl,
|
|
18902
|
+
const floatTargetSupport = Object(_luma_gl_core__WEBPACK_IMPORTED_MODULE_2__["hasFeatures"])(gl, FLOAT_TARGET_FEATURES);
|
|
18898
18903
|
const {
|
|
18899
18904
|
format,
|
|
18900
18905
|
type
|
|
@@ -19440,7 +19445,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
19440
19445
|
/* harmony import */ var _luma_gl_constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @luma.gl/constants */ "../../node_modules/@luma.gl/constants/dist/esm/index.js");
|
|
19441
19446
|
/* harmony import */ var _luma_gl_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @luma.gl/core */ "@luma.gl/core");
|
|
19442
19447
|
/* harmony import */ var _luma_gl_core__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_luma_gl_core__WEBPACK_IMPORTED_MODULE_1__);
|
|
19443
|
-
/* harmony import */ var _deck_gl_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @deck.gl/core */ "@deck.gl/
|
|
19448
|
+
/* harmony import */ var _deck_gl_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @deck.gl/core */ "@deck.gl/layers");
|
|
19444
19449
|
/* harmony import */ var _deck_gl_core__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_deck_gl_core__WEBPACK_IMPORTED_MODULE_2__);
|
|
19445
19450
|
/* harmony import */ var _triangle_layer_vertex_glsl__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./triangle-layer-vertex.glsl */ "./src/heatmap-layer/triangle-layer-vertex.glsl.js");
|
|
19446
19451
|
/* harmony import */ var _triangle_layer_fragment_glsl__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./triangle-layer-fragment.glsl */ "./src/heatmap-layer/triangle-layer-fragment.glsl.js");
|
|
@@ -19620,7 +19625,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
19620
19625
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getPointsCenter", function() { return getPointsCenter; });
|
|
19621
19626
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getRadiusInCommon", function() { return getRadiusInCommon; });
|
|
19622
19627
|
/* harmony import */ var d3_hexbin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3-hexbin */ "../../node_modules/d3-hexbin/index.js");
|
|
19623
|
-
/* harmony import */ var _deck_gl_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @deck.gl/core */ "@deck.gl/
|
|
19628
|
+
/* harmony import */ var _deck_gl_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @deck.gl/core */ "@deck.gl/layers");
|
|
19624
19629
|
/* harmony import */ var _deck_gl_core__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_deck_gl_core__WEBPACK_IMPORTED_MODULE_1__);
|
|
19625
19630
|
// Copyright (c) 2015 - 2017 Uber Technologies, Inc.
|
|
19626
19631
|
//
|
|
@@ -19767,7 +19772,7 @@ function getRadiusInCommon(radius, viewport, center) {
|
|
|
19767
19772
|
"use strict";
|
|
19768
19773
|
__webpack_require__.r(__webpack_exports__);
|
|
19769
19774
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return HexagonLayer; });
|
|
19770
|
-
/* harmony import */ var _deck_gl_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @deck.gl/core */ "@deck.gl/
|
|
19775
|
+
/* harmony import */ var _deck_gl_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @deck.gl/core */ "@deck.gl/layers");
|
|
19771
19776
|
/* harmony import */ var _deck_gl_core__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_deck_gl_core__WEBPACK_IMPORTED_MODULE_0__);
|
|
19772
19777
|
/* harmony import */ var _utils_color_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils/color-utils */ "./src/utils/color-utils.js");
|
|
19773
19778
|
/* harmony import */ var _hexagon_aggregator__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./hexagon-aggregator */ "./src/hexagon-layer/hexagon-aggregator.js");
|
|
@@ -20132,7 +20137,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
20132
20137
|
/* harmony import */ var _luma_gl_constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @luma.gl/constants */ "../../node_modules/@luma.gl/constants/dist/esm/index.js");
|
|
20133
20138
|
/* harmony import */ var _luma_gl_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @luma.gl/core */ "@luma.gl/core");
|
|
20134
20139
|
/* harmony import */ var _luma_gl_core__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_luma_gl_core__WEBPACK_IMPORTED_MODULE_1__);
|
|
20135
|
-
/* harmony import */ var _deck_gl_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @deck.gl/core */ "@deck.gl/
|
|
20140
|
+
/* harmony import */ var _deck_gl_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @deck.gl/core */ "@deck.gl/layers");
|
|
20136
20141
|
/* harmony import */ var _deck_gl_core__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_deck_gl_core__WEBPACK_IMPORTED_MODULE_2__);
|
|
20137
20142
|
/* harmony import */ var _utils_color_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../utils/color-utils */ "./src/utils/color-utils.js");
|
|
20138
20143
|
/* harmony import */ var _screen_grid_layer_vertex_glsl__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./screen-grid-layer-vertex.glsl */ "./src/screen-grid-layer/screen-grid-layer-vertex.glsl.js");
|
|
@@ -20525,7 +20530,7 @@ void main(void) {
|
|
|
20525
20530
|
"use strict";
|
|
20526
20531
|
__webpack_require__.r(__webpack_exports__);
|
|
20527
20532
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ScreenGridLayer; });
|
|
20528
|
-
/* harmony import */ var _deck_gl_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @deck.gl/core */ "@deck.gl/
|
|
20533
|
+
/* harmony import */ var _deck_gl_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @deck.gl/core */ "@deck.gl/layers");
|
|
20529
20534
|
/* harmony import */ var _deck_gl_core__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_deck_gl_core__WEBPACK_IMPORTED_MODULE_0__);
|
|
20530
20535
|
/* harmony import */ var _luma_gl_constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @luma.gl/constants */ "../../node_modules/@luma.gl/constants/dist/esm/index.js");
|
|
20531
20536
|
/* harmony import */ var _utils_gpu_grid_aggregation_gpu_grid_aggregator__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils/gpu-grid-aggregation/gpu-grid-aggregator */ "./src/utils/gpu-grid-aggregation/gpu-grid-aggregator.js");
|
|
@@ -22169,7 +22174,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
22169
22174
|
/* harmony import */ var _luma_gl_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @luma.gl/core */ "@luma.gl/core");
|
|
22170
22175
|
/* harmony import */ var _luma_gl_core__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_luma_gl_core__WEBPACK_IMPORTED_MODULE_1__);
|
|
22171
22176
|
/* harmony import */ var _luma_gl_shadertools__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @luma.gl/shadertools */ "../../node_modules/@luma.gl/shadertools/dist/esm/index.js");
|
|
22172
|
-
/* harmony import */ var _deck_gl_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @deck.gl/core */ "@deck.gl/
|
|
22177
|
+
/* harmony import */ var _deck_gl_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @deck.gl/core */ "@deck.gl/layers");
|
|
22173
22178
|
/* harmony import */ var _deck_gl_core__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_deck_gl_core__WEBPACK_IMPORTED_MODULE_3__);
|
|
22174
22179
|
/* harmony import */ var _gpu_grid_aggregator_constants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./gpu-grid-aggregator-constants */ "./src/utils/gpu-grid-aggregation/gpu-grid-aggregator-constants.js");
|
|
22175
22180
|
/* harmony import */ var _aggregation_operation_utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../aggregation-operation-utils */ "./src/utils/aggregation-operation-utils.js");
|
|
@@ -23040,7 +23045,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
23040
23045
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "alignToCell", function() { return alignToCell; });
|
|
23041
23046
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getGridOffset", function() { return getGridOffset; });
|
|
23042
23047
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getGridParams", function() { return getGridParams; });
|
|
23043
|
-
/* harmony import */ var _deck_gl_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @deck.gl/core */ "@deck.gl/
|
|
23048
|
+
/* harmony import */ var _deck_gl_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @deck.gl/core */ "@deck.gl/layers");
|
|
23044
23049
|
/* harmony import */ var _deck_gl_core__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_deck_gl_core__WEBPACK_IMPORTED_MODULE_0__);
|
|
23045
23050
|
|
|
23046
23051
|
const R_EARTH = 6378000;
|
|
@@ -23331,7 +23336,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
23331
23336
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getScaleDomain", function() { return getScaleDomain; });
|
|
23332
23337
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "clamp", function() { return clamp; });
|
|
23333
23338
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getScaleFunctionByScaleType", function() { return getScaleFunctionByScaleType; });
|
|
23334
|
-
/* harmony import */ var _deck_gl_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @deck.gl/core */ "@deck.gl/
|
|
23339
|
+
/* harmony import */ var _deck_gl_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @deck.gl/core */ "@deck.gl/layers");
|
|
23335
23340
|
/* harmony import */ var _deck_gl_core__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_deck_gl_core__WEBPACK_IMPORTED_MODULE_0__);
|
|
23336
23341
|
// Copyright (c) 2015 - 2017 Uber Technologies, Inc.
|
|
23337
23342
|
//
|
|
@@ -23558,14 +23563,14 @@ function getScaleFunctionByScaleType(scaleType) {
|
|
|
23558
23563
|
|
|
23559
23564
|
/***/ }),
|
|
23560
23565
|
|
|
23561
|
-
/***/ "@deck.gl/
|
|
23566
|
+
/***/ "@deck.gl/layers":
|
|
23562
23567
|
/*!***********************!*\
|
|
23563
23568
|
!*** external "deck" ***!
|
|
23564
23569
|
\***********************/
|
|
23565
23570
|
/*! no static exports found */
|
|
23566
23571
|
/***/ (function(module, exports) {
|
|
23567
23572
|
|
|
23568
|
-
module.exports =
|
|
23573
|
+
module.exports = __WEBPACK_EXTERNAL_MODULE__deck_gl_layers__;
|
|
23569
23574
|
|
|
23570
23575
|
/***/ }),
|
|
23571
23576
|
|
|
@@ -111,9 +111,12 @@ function getTextureCoordinates(point, bounds) {
|
|
|
111
111
|
function getTextureParams(_ref) {
|
|
112
112
|
var gl = _ref.gl,
|
|
113
113
|
floatTargetSupport = _ref.floatTargetSupport;
|
|
114
|
-
return {
|
|
114
|
+
return floatTargetSupport ? {
|
|
115
115
|
format: (0, _core.isWebGL2)(gl) ? 34836 : 6408,
|
|
116
|
-
type:
|
|
116
|
+
type: 5126
|
|
117
|
+
} : {
|
|
118
|
+
format: 6408,
|
|
119
|
+
type: 5121
|
|
117
120
|
};
|
|
118
121
|
}
|
|
119
122
|
//# sourceMappingURL=heatmap-layer-utils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/heatmap-layer/heatmap-layer-utils.js"],"names":["getBounds","points","x","map","p","y","xMin","Math","min","apply","xMax","max","yMin","yMax","boundsContain","currentBounds","targetBounds","scratchArray","Float32Array","packVertices","dimensions","index","point","i","scaleToAspectRatio","boundingBox","width","height","currentWidth","currentHeight","newWidth","newHeight","xCenter","yCenter","getTextureCoordinates","bounds","getTextureParams","gl","floatTargetSupport","format","type"],"mappings":";;;;;;;;;;;;;;;;AACA;;;;;;;;AAEO,SAASA,SAAT,CAAmBC,MAAnB,EAA2B;AAEhC,MAAMC,CAAC,GAAGD,MAAM,CAACE,GAAP,CAAW,UAAAC,CAAC;AAAA,WAAIA,CAAC,CAAC,CAAD,CAAL;AAAA,GAAZ,CAAV;AACA,MAAMC,CAAC,GAAGJ,MAAM,CAACE,GAAP,CAAW,UAAAC,CAAC;AAAA,WAAIA,CAAC,CAAC,CAAD,CAAL;AAAA,GAAZ,CAAV;AAEA,MAAME,IAAI,GAAGC,IAAI,CAACC,GAAL,CAASC,KAAT,CAAe,IAAf,EAAqBP,CAArB,CAAb;AACA,MAAMQ,IAAI,GAAGH,IAAI,CAACI,GAAL,CAASF,KAAT,CAAe,IAAf,EAAqBP,CAArB,CAAb;AACA,MAAMU,IAAI,GAAGL,IAAI,CAACC,GAAL,CAASC,KAAT,CAAe,IAAf,EAAqBJ,CAArB,CAAb;AACA,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B;AAAA,MAArBC,kBAAqB,QAArBA,kBAAqB;AACzD,
|
|
1
|
+
{"version":3,"sources":["../../../src/heatmap-layer/heatmap-layer-utils.js"],"names":["getBounds","points","x","map","p","y","xMin","Math","min","apply","xMax","max","yMin","yMax","boundsContain","currentBounds","targetBounds","scratchArray","Float32Array","packVertices","dimensions","index","point","i","scaleToAspectRatio","boundingBox","width","height","currentWidth","currentHeight","newWidth","newHeight","xCenter","yCenter","getTextureCoordinates","bounds","getTextureParams","gl","floatTargetSupport","format","type"],"mappings":";;;;;;;;;;;;;;;;AACA;;;;;;;;AAEO,SAASA,SAAT,CAAmBC,MAAnB,EAA2B;AAEhC,MAAMC,CAAC,GAAGD,MAAM,CAACE,GAAP,CAAW,UAAAC,CAAC;AAAA,WAAIA,CAAC,CAAC,CAAD,CAAL;AAAA,GAAZ,CAAV;AACA,MAAMC,CAAC,GAAGJ,MAAM,CAACE,GAAP,CAAW,UAAAC,CAAC;AAAA,WAAIA,CAAC,CAAC,CAAD,CAAL;AAAA,GAAZ,CAAV;AAEA,MAAME,IAAI,GAAGC,IAAI,CAACC,GAAL,CAASC,KAAT,CAAe,IAAf,EAAqBP,CAArB,CAAb;AACA,MAAMQ,IAAI,GAAGH,IAAI,CAACI,GAAL,CAASF,KAAT,CAAe,IAAf,EAAqBP,CAArB,CAAb;AACA,MAAMU,IAAI,GAAGL,IAAI,CAACC,GAAL,CAASC,KAAT,CAAe,IAAf,EAAqBJ,CAArB,CAAb;AACA,MAAMQ,IAAI,GAAGN,IAAI,CAACI,GAAL,CAASF,KAAT,CAAe,IAAf,EAAqBJ,CAArB,CAAb;AAEA,SAAO,CAACC,IAAD,EAAOM,IAAP,EAAaF,IAAb,EAAmBG,IAAnB,CAAP;AACD;;AAGM,SAASC,aAAT,CAAuBC,aAAvB,EAAsCC,YAAtC,EAAoD;AACzD,MACEA,YAAY,CAAC,CAAD,CAAZ,IAAmBD,aAAa,CAAC,CAAD,CAAhC,IACAC,YAAY,CAAC,CAAD,C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SAAS,GAAIJ,MAAM,GAAGD,KAAV,GAAmBE,YAA/B;AACD;;AAED,MAAIE,QAAQ,GAAGJ,KAAf,EAAsB;AACpBI,IAAAA,QAAQ,GAAGJ,KAAX;AACAK,IAAAA,SAAS,GAAGJ,MAAZ;AACD;;AAED,MAAMK,OAAO,GAAG,CAACtB,IAAI,GAAGJ,IAAR,IAAgB,CAAhC;AACA,MAAM2B,OAAO,GAAG,CAACpB,IAAI,GAAGD,IAAR,IAAgB,CAAhC;AAEA,SAAO,CACLoB,OAAO,GAAGF,QAAQ,GAAG,CADhB,EAELG,OAAO,GAAGF,SAAS,GAAG,CAFjB,EAGLC,OAAO,GAAGF,QAAQ,GAAG,CAHhB,EAILG,OAAO,GAAGF,SAAS,GAAG,CAJjB,CAAP;AAMD;;AAGM,SAASG,qBAAT,CAA+BZ,KAA/B,EAAsCa,MAAtC,EAA8C;AACnD,6CAAiCA,MAAjC;AAAA,MAAO7B,IAAP;AAAA,MAAaM,IAAb;AAAA,MAAmBF,IAAnB;AAAA,MAAyBG,IAAzB;;AACA,SAAO,CAAC,CAACS,KAAK,CAAC,CAAD,CAAL,GAAWhB,IAAZ,KAAqBI,IAAI,GAAGJ,IAA5B,CAAD,EAAoC,CAACgB,KAAK,CAAC,CAAD,CAAL,GAAWV,IAAZ,KAAqBC,IAAI,GAAGD,IAA5B,CAApC,CAAP;AACD;;AAGM,SAASwB,gBAAT,OAAoD;AAAA,MAAzBC,EAAyB,QAAzBA,EAAyB;AAAA,MAArBC,kBAAqB,QAArBA,kBAAqB;AACzD,SAAOA,kBAAkB,GACrB;AAEEC,IAAAA,MAAM,EAAE,oBAASF,EAAT,gBAFV;AAGEG,IAAAA,IAAI;AAHN,GADqB,GAMrB;AACED,IAAAA,MAAM,MADR;AAEEC,IAAAA,IAAI;AAFN,GANJ;AAUD","sourcesContent":["import GL from '@luma.gl/constants';\nimport {isWebGL2} from '@luma.gl/core';\n\nexport function getBounds(points) {\n // Now build bounding box in world space (aligned to world coordiante system)\n const x = points.map(p => p[0]);\n const y = points.map(p => p[1]);\n\n const xMin = Math.min.apply(null, x);\n const xMax = Math.max.apply(null, x);\n const yMin = Math.min.apply(null, y);\n const yMax = Math.max.apply(null, y);\n\n return [xMin, yMin, xMax, yMax];\n}\n\n// true if currentBounds contains targetBounds, false otherwise\nexport function boundsContain(currentBounds, targetBounds) {\n if (\n targetBounds[0] >= currentBounds[0] &&\n targetBounds[2] <= currentBounds[2] &&\n targetBounds[1] >= currentBounds[1] &&\n targetBounds[3] <= currentBounds[3]\n ) {\n return true;\n }\n return false;\n}\n\nconst scratchArray = new Float32Array(12);\n\n// For given rectangle bounds generates two triangles vertices that coverit completely\nexport function packVertices(points, dimensions = 2) {\n let index = 0;\n for (const point of points) {\n for (let i = 0; i < dimensions; i++) {\n scratchArray[index++] = point[i] || 0;\n }\n }\n return scratchArray;\n}\n\n// Expands boundingBox:[xMin, yMin, xMax, yMax] to match aspect ratio of given width and height\nexport function scaleToAspectRatio(boundingBox, width, height) {\n const [xMin, yMin, xMax, yMax] = boundingBox;\n\n const currentWidth = xMax - xMin;\n const currentHeight = yMax - yMin;\n\n let newWidth = currentWidth;\n let newHeight = currentHeight;\n if (currentWidth / currentHeight < width / height) {\n // expand bounding box width\n newWidth = (width / height) * currentHeight;\n } else {\n newHeight = (height / width) * currentWidth;\n }\n\n if (newWidth < width) {\n newWidth = width;\n newHeight = height;\n }\n\n const xCenter = (xMax + xMin) / 2;\n const yCenter = (yMax + yMin) / 2;\n\n return [\n xCenter - newWidth / 2,\n yCenter - newHeight / 2,\n xCenter + newWidth / 2,\n yCenter + newHeight / 2\n ];\n}\n\n// Get texture coordiante of point inside a bounding box\nexport function getTextureCoordinates(point, bounds) {\n const [xMin, yMin, xMax, yMax] = bounds;\n return [(point[0] - xMin) / (xMax - xMin), (point[1] - yMin) / (yMax - yMin)];\n}\n\n// Returns format and type for creating texture objects\nexport function getTextureParams({gl, floatTargetSupport}) {\n return floatTargetSupport\n ? {\n // format: should be RGBA32F on WebGL2 (float textures), RGBA in WebGL1 for float or non float textures\n format: isWebGL2(gl) ? GL.RGBA32F : GL.RGBA,\n type: GL.FLOAT\n }\n : {\n format: GL.RGBA,\n type: GL.UNSIGNED_BYTE\n };\n}\n"],"file":"heatmap-layer-utils.js"}
|
|
@@ -113,6 +113,7 @@ var defaultProps = {
|
|
|
113
113
|
}
|
|
114
114
|
};
|
|
115
115
|
var REQUIRED_FEATURES = [_core.FEATURES.BLEND_EQUATION_MINMAX, _core.FEATURES.TEXTURE_FLOAT];
|
|
116
|
+
var FLOAT_TARGET_FEATURES = [_core.FEATURES.COLOR_ATTACHMENT_RGBA32F, _core.FEATURES.FLOAT_BLEND];
|
|
116
117
|
var DIMENSIONS = {
|
|
117
118
|
data: {
|
|
118
119
|
props: ['radiusPixels']
|
|
@@ -346,7 +347,7 @@ var HeatmapLayer = function (_AggregationLayer) {
|
|
|
346
347
|
var gl = this.context.gl;
|
|
347
348
|
var weightsTextureSize = this.props.weightsTextureSize;
|
|
348
349
|
var textureSize = Math.min(weightsTextureSize, (0, _core.getParameters)(gl, 3379));
|
|
349
|
-
var floatTargetSupport = (0, _core.hasFeatures)(gl,
|
|
350
|
+
var floatTargetSupport = (0, _core.hasFeatures)(gl, FLOAT_TARGET_FEATURES);
|
|
350
351
|
|
|
351
352
|
var _getTextureParams = (0, _heatmapLayerUtils.getTextureParams)({
|
|
352
353
|
gl: gl,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/heatmap-layer/heatmap-layer.js"],"names":["RESOLUTION","TEXTURE_OPTIONS","mipmaps","parameters","dataFormat","DEFAULT_COLOR_DOMAIN","AGGREGATION_MODE","SUM","MEAN","defaultProps","getPosition","type","value","x","position","getWeight","intensity","min","radiusPixels","max","colorRange","defaultColorRange","threshold","colorDomain","optional","aggregation","weightsTextureSize","debounceTimeout","REQUIRED_FEATURES","FEATURES","BLEND_EQUATION_MINMAX","TEXTURE_FLOAT","DIMENSIONS","data","props","HeatmapLayer","gl","context","setState","supported","log","error","id","_setupTextureParams","_setupAttributes","_setupResources","changeFlags","somethingChanged","opts","state","_updateHeatmapState","oldProps","_getChangeFlags","dataChanged","viewportChanged","boundsChanged","_updateBounds","_updateTextureRenderingBounds","clearTimeout","updateTimer","isWeightMapDirty","viewportZoomChanged","_debouncedUpdateWeightmap","_updateColorTexture","_updateWeightmap","zoom","viewport","weightsTexture","triPositionBuffer","triTexCoordBuffer","maxWeightsTexture","colorTexture","updateTriggers","TriangleLayerClass","getSubLayerClass","TriangleLayer","getSubLayerProps","coordinateSystem","COORDINATE_SYSTEM","DEFAULT","attributes","positions","texCoords","vertexCount","maxTexture","aggregationMode","texture","weightsTransform","maxWeightTransform","delete","AttributeManager","stats","dimensions","isAttributeChanged","isAggregationDirty","compareAll","dimension","textureSize","format","Texture2D","width","height","attributeManager","getAttributeManager","add","size","accessor","weights","positionAttributeName","Math","floatTargetSupport","COLOR_ATTACHMENT_RGBA32F","weightsScale","warn","vs","vs_max","_fs","fs_max","weights_vs","weights_fs","shaders","Transform","elementCount","_targetTexture","_targetTextureVarying","_createTextures","weightsTransformShaders","getShaders","_createWeightsTransform","maxWeightsTransformShaders","_sourceTextures","inTexture","Buffer","byteLength","shaderOptions","run","blend","depthTest","blendFunc","blendEquation","forceUpdate","viewportCorners","unproject","map","p","fround","visibleWorldBounds","newState","worldBounds","scaledCommonBounds","_worldToCommonBounds","_commonToWorldBounds","LNGLAT","normalizedCommonBounds","subData","textureBounds","projectPosition","colors","Uint8Array","setImageData","length","commonBounds","useLayerCoordinateSystem","metersPerPixel","distanceScales","metersPerUnit","uniforms","textureWidth","update","getNumInstances","clearRenderTarget","getAttributes","moduleSettings","getModuleSettings","_updateMaxWeightValue","setParameters","fromTimer","setTimeout","bind","minLong","minLat","maxLong","maxLat","offsetMode","LNGLAT_OFFSETS","METER_OFFSETS","offsetOriginCommon","coordinateOrigin","scale","bottomLeftCommon","topRightCommon","xMin","yMin","xMax","yMax","bottomLeftWorld","unpr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,QAAP;AACA,UAAMiI,eAAe,GAAGjI,QAAQ,CAACkI,iBAAT,CAA2B,CAACL,IAAD,EAAOC,IAAP,CAA3B,CAAxB;AACA,UAAMK,aAAa,GAAGnI,QAAQ,CAACkI,iBAAT,CAA2B,CAACH,IAAD,EAAOC,IAAP,CAA3B,CAAtB;AAEA,aAAOC,eAAe,CAACG,KAAhB,CAAsB,CAAtB,EAAyB,CAAzB,EAA4BC,MAA5B,CAAmCF,aAAa,CAACC,KAAd,CAAoB,CAApB,EAAuB,CAAvB,CAAnC,CAAP;AACD;;;EA3euCE,yB;;;AA8e1CrK,YAAY,CAACsK,SAAb,GAAyB,cAAzB;AACAtK,YAAY,CAAC1B,YAAb,GAA4BA,YAA5B","sourcesContent":["// Copyright (c) 2015 - 2019 Uber Technologies, Inc.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n/* global setTimeout clearTimeout */\nimport GL from '@luma.gl/constants';\nimport {\n getBounds,\n boundsContain,\n packVertices,\n scaleToAspectRatio,\n getTextureCoordinates,\n getTextureParams\n} from './heatmap-layer-utils';\nimport {Buffer, Texture2D, Transform, getParameters, FEATURES, hasFeatures} from '@luma.gl/core';\nimport {AttributeManager, COORDINATE_SYSTEM, log} from '@deck.gl/core';\nimport TriangleLayer from './triangle-layer';\nimport AggregationLayer from '../aggregation-layer';\nimport {defaultColorRange, colorRangeToFlatArray} from '../utils/color-utils';\nimport weights_vs from './weights-vs.glsl';\nimport weights_fs from './weights-fs.glsl';\nimport vs_max from './max-vs.glsl';\nimport fs_max from './max-fs.glsl';\n\nconst RESOLUTION = 2; // (number of common space pixels) / (number texels)\nconst TEXTURE_OPTIONS = {\n mipmaps: false,\n parameters: {\n [GL.TEXTURE_MAG_FILTER]: GL.LINEAR,\n [GL.TEXTURE_MIN_FILTER]: GL.LINEAR,\n [GL.TEXTURE_WRAP_S]: GL.CLAMP_TO_EDGE,\n [GL.TEXTURE_WRAP_T]: GL.CLAMP_TO_EDGE\n },\n dataFormat: GL.RGBA\n};\nconst DEFAULT_COLOR_DOMAIN = [0, 0];\nconst AGGREGATION_MODE = {\n SUM: 0,\n MEAN: 1\n};\n\nconst defaultProps = {\n getPosition: {type: 'accessor', value: x => x.position},\n getWeight: {type: 'accessor', value: 1},\n intensity: {type: 'number', min: 0, value: 1},\n radiusPixels: {type: 'number', min: 1, max: 100, value: 50},\n colorRange: defaultColorRange,\n threshold: {type: 'number', min: 0, max: 1, value: 0.05},\n colorDomain: {type: 'array', value: null, optional: true},\n // 'SUM' or 'MEAN'\n aggregation: 'SUM',\n weightsTextureSize: {type: 'number', min: 128, max: 2048, value: 2048},\n debounceTimeout: {type: 'number', min: 0, max: 1000, value: 500}\n};\n\nconst REQUIRED_FEATURES = [\n FEATURES.BLEND_EQUATION_MINMAX, // max weight calculation\n FEATURES.TEXTURE_FLOAT // weight-map as texture\n // FEATURES.FLOAT_BLEND, // implictly supported when TEXTURE_FLOAT is supported\n];\n\nconst DIMENSIONS = {\n data: {\n props: ['radiusPixels']\n }\n};\n\nexport default class HeatmapLayer extends AggregationLayer {\n initializeState() {\n const {gl} = this.context;\n if (!hasFeatures(gl, REQUIRED_FEATURES)) {\n this.setState({supported: false});\n log.error(`HeatmapLayer: ${this.id} is not supported on this browser`)();\n return;\n }\n super.initializeState(DIMENSIONS);\n this.setState({supported: true, colorDomain: DEFAULT_COLOR_DOMAIN});\n this._setupTextureParams();\n this._setupAttributes();\n this._setupResources();\n }\n\n shouldUpdateState({changeFlags}) {\n // Need to be updated when viewport changes\n return changeFlags.somethingChanged;\n }\n\n /* eslint-disable max-statements,complexity */\n updateState(opts) {\n if (!this.state.supported) {\n return;\n }\n super.updateState(opts);\n this._updateHeatmapState(opts);\n }\n\n _updateHeatmapState(opts) {\n const {props, oldProps} = opts;\n const changeFlags = this._getChangeFlags(opts);\n\n if (changeFlags.dataChanged || changeFlags.viewportChanged) {\n // if data is changed, do not debounce and immediately update the weight map\n changeFlags.boundsChanged = this._updateBounds(changeFlags.dataChanged);\n this._updateTextureRenderingBounds();\n }\n\n if (changeFlags.dataChanged || changeFlags.boundsChanged) {\n // Update weight map immediately\n clearTimeout(this.state.updateTimer);\n this.setState({isWeightMapDirty: true});\n } else if (changeFlags.viewportZoomChanged) {\n // Update weight map when zoom stops\n this._debouncedUpdateWeightmap();\n }\n\n if (props.colorRange !== oldProps.colorRange) {\n this._updateColorTexture(opts);\n }\n\n if (this.state.isWeightMapDirty) {\n this._updateWeightmap();\n }\n\n this.setState({zoom: opts.context.viewport.zoom});\n }\n\n renderLayers() {\n if (!this.state.supported) {\n return [];\n }\n const {\n weightsTexture,\n triPositionBuffer,\n triTexCoordBuffer,\n maxWeightsTexture,\n colorTexture,\n colorDomain\n } = this.state;\n const {updateTriggers, intensity, threshold, aggregation} = this.props;\n\n const TriangleLayerClass = this.getSubLayerClass('triangle', TriangleLayer);\n\n return new TriangleLayerClass(\n this.getSubLayerProps({\n id: 'triangle-layer',\n updateTriggers\n }),\n {\n // position buffer is filled with world coordinates generated from viewport.unproject\n // i.e. LNGLAT if geospatial, CARTESIAN otherwise\n coordinateSystem: COORDINATE_SYSTEM.DEFAULT,\n data: {\n attributes: {\n positions: triPositionBuffer,\n texCoords: triTexCoordBuffer\n }\n },\n vertexCount: 4,\n maxTexture: maxWeightsTexture,\n colorTexture,\n aggregationMode: AGGREGATION_MODE[aggregation] || 0,\n texture: weightsTexture,\n intensity,\n threshold,\n colorDomain\n }\n );\n }\n\n finalizeState() {\n super.finalizeState();\n const {\n weightsTransform,\n weightsTexture,\n maxWeightTransform,\n maxWeightsTexture,\n triPositionBuffer,\n triTexCoordBuffer,\n colorTexture,\n updateTimer\n } = this.state;\n weightsTransform?.delete();\n weightsTexture?.delete();\n maxWeightTransform?.delete();\n maxWeightsTexture?.delete();\n triPositionBuffer?.delete();\n triTexCoordBuffer?.delete();\n colorTexture?.delete();\n if (updateTimer) {\n clearTimeout(updateTimer);\n }\n }\n\n // PRIVATE\n\n // override Composite layer private method to create AttributeManager instance\n _getAttributeManager() {\n return new AttributeManager(this.context.gl, {\n id: this.props.id,\n stats: this.context.stats\n });\n }\n\n _getChangeFlags(opts) {\n const changeFlags = {};\n const {dimensions} = this.state;\n changeFlags.dataChanged =\n this.isAttributeChanged() || // if any attribute is changed\n this.isAggregationDirty(opts, {\n compareAll: true,\n dimension: dimensions.data\n });\n changeFlags.viewportChanged = opts.changeFlags.viewportChanged;\n\n const {zoom} = this.state;\n if (!opts.context.viewport || opts.context.viewport.zoom !== zoom) {\n changeFlags.viewportZoomChanged = true;\n }\n\n return changeFlags;\n }\n\n _createTextures() {\n const {gl} = this.context;\n const {textureSize, format, type} = this.state;\n\n this.setState({\n weightsTexture: new Texture2D(gl, {\n width: textureSize,\n height: textureSize,\n format,\n type,\n ...TEXTURE_OPTIONS\n }),\n maxWeightsTexture: new Texture2D(gl, {format, type, ...TEXTURE_OPTIONS}) // 1 X 1 texture,\n });\n }\n\n _setupAttributes() {\n const attributeManager = this.getAttributeManager();\n attributeManager.add({\n positions: {size: 3, type: GL.DOUBLE, accessor: 'getPosition'},\n weights: {size: 1, accessor: 'getWeight'}\n });\n this.setState({positionAttributeName: 'positions'});\n }\n\n _setupTextureParams() {\n const {gl} = this.context;\n const {weightsTextureSize} = this.props;\n\n const textureSize = Math.min(weightsTextureSize, getParameters(gl, gl.MAX_TEXTURE_SIZE));\n const floatTargetSupport = hasFeatures(gl, FEATURES.COLOR_ATTACHMENT_RGBA32F);\n const {format, type} = getTextureParams({gl, floatTargetSupport});\n const weightsScale = floatTargetSupport ? 1 : 1 / 255;\n this.setState({textureSize, format, type, weightsScale});\n if (!floatTargetSupport) {\n log.warn(\n `HeatmapLayer: ${this.id} rendering to float texture not supported, fallingback to low precession format`\n )();\n }\n }\n\n getShaders(type) {\n return super.getShaders(\n type === 'max-weights-transform'\n ? {\n vs: vs_max,\n _fs: fs_max\n }\n : {\n vs: weights_vs,\n _fs: weights_fs\n }\n );\n }\n\n _createWeightsTransform(shaders = {}) {\n const {gl} = this.context;\n let {weightsTransform} = this.state;\n const {weightsTexture} = this.state;\n weightsTransform?.delete();\n\n weightsTransform = new Transform(gl, {\n id: `${this.id}-weights-transform`,\n elementCount: 1,\n _targetTexture: weightsTexture,\n _targetTextureVarying: 'weightsTexture',\n ...shaders\n });\n this.setState({weightsTransform});\n }\n\n _setupResources() {\n const {gl} = this.context;\n this._createTextures();\n const {textureSize, weightsTexture, maxWeightsTexture} = this.state;\n\n const weightsTransformShaders = this.getShaders('weights-transform');\n this._createWeightsTransform(weightsTransformShaders);\n\n const maxWeightsTransformShaders = this.getShaders('max-weights-transform');\n const maxWeightTransform = new Transform(gl, {\n id: `${this.id}-max-weights-transform`,\n _sourceTextures: {\n inTexture: weightsTexture\n },\n _targetTexture: maxWeightsTexture,\n _targetTextureVarying: 'outTexture',\n ...maxWeightsTransformShaders,\n elementCount: textureSize * textureSize\n });\n\n this.setState({\n weightsTexture,\n maxWeightsTexture,\n maxWeightTransform,\n zoom: null,\n triPositionBuffer: new Buffer(gl, {\n byteLength: 48,\n accessor: {size: 3}\n }),\n triTexCoordBuffer: new Buffer(gl, {\n byteLength: 48,\n accessor: {size: 2}\n })\n });\n }\n\n // overwrite super class method to update transform model\n updateShaders(shaderOptions) {\n // sahder params (modules, injects) changed, update model object\n this._createWeightsTransform(shaderOptions);\n }\n\n _updateMaxWeightValue() {\n const {maxWeightTransform} = this.state;\n maxWeightTransform.run({\n parameters: {\n blend: true,\n depthTest: false,\n blendFunc: [GL.ONE, GL.ONE],\n blendEquation: GL.MAX\n }\n });\n }\n\n // Computes world bounds area that needs to be processed for generate heatmap\n _updateBounds(forceUpdate = false) {\n const {viewport} = this.context;\n\n // Unproject all 4 corners of the current screen coordinates into world coordinates (lng/lat)\n // Takes care of viewport has non zero bearing/pitch (i.e axis not aligned with world coordiante system)\n const viewportCorners = [\n viewport.unproject([0, 0]),\n viewport.unproject([viewport.width, 0]),\n viewport.unproject([viewport.width, viewport.height]),\n viewport.unproject([0, viewport.height])\n ].map(p => p.map(Math.fround));\n\n // #1: get world bounds for current viewport extends\n const visibleWorldBounds = getBounds(viewportCorners); // TODO: Change to visible bounds\n\n const newState = {visibleWorldBounds, viewportCorners};\n let boundsChanged = false;\n\n if (\n forceUpdate ||\n !this.state.worldBounds ||\n !boundsContain(this.state.worldBounds, visibleWorldBounds)\n ) {\n // #2 : convert world bounds to common (Flat) bounds\n // #3 : extend common bounds to match aspect ratio with viewport\n const scaledCommonBounds = this._worldToCommonBounds(visibleWorldBounds);\n\n // #4 :convert aligned common bounds to world bounds\n const worldBounds = this._commonToWorldBounds(scaledCommonBounds);\n\n // Clip webmercator projection limits\n if (this.props.coordinateSystem === COORDINATE_SYSTEM.LNGLAT) {\n worldBounds[1] = Math.max(worldBounds[1], -85.051129);\n worldBounds[3] = Math.min(worldBounds[3], 85.051129);\n worldBounds[0] = Math.max(worldBounds[0], -360);\n worldBounds[2] = Math.min(worldBounds[2], 360);\n }\n\n // #5: now convert world bounds to common using Layer's coordiante system and origin\n const normalizedCommonBounds = this._worldToCommonBounds(worldBounds);\n\n newState.worldBounds = worldBounds;\n newState.normalizedCommonBounds = normalizedCommonBounds;\n\n boundsChanged = true;\n }\n this.setState(newState);\n return boundsChanged;\n }\n\n _updateTextureRenderingBounds() {\n // Just render visible portion of the texture\n const {triPositionBuffer, triTexCoordBuffer, normalizedCommonBounds, viewportCorners} =\n this.state;\n\n const {viewport} = this.context;\n\n triPositionBuffer.subData(packVertices(viewportCorners, 3));\n\n const textureBounds = viewportCorners.map(p =>\n getTextureCoordinates(viewport.projectPosition(p), normalizedCommonBounds)\n );\n triTexCoordBuffer.subData(packVertices(textureBounds, 2));\n }\n\n _updateColorTexture(opts) {\n const {colorRange} = opts.props;\n let {colorTexture} = this.state;\n const colors = colorRangeToFlatArray(colorRange, false, Uint8Array);\n\n if (colorTexture) {\n colorTexture.setImageData({\n data: colors,\n width: colorRange.length\n });\n } else {\n colorTexture = new Texture2D(this.context.gl, {\n data: colors,\n width: colorRange.length,\n height: 1,\n ...TEXTURE_OPTIONS\n });\n }\n this.setState({colorTexture});\n }\n\n _updateWeightmap() {\n const {radiusPixels, colorDomain, aggregation} = this.props;\n const {weightsTransform, worldBounds, textureSize, weightsTexture, weightsScale} = this.state;\n this.state.isWeightMapDirty = false;\n\n // convert world bounds to common using Layer's coordiante system and origin\n const commonBounds = this._worldToCommonBounds(worldBounds, {\n useLayerCoordinateSystem: true\n });\n\n if (colorDomain && aggregation === 'SUM') {\n // scale color domain to weight per pixel\n const {viewport} = this.context;\n const metersPerPixel =\n (viewport.distanceScales.metersPerUnit[2] * (commonBounds[2] - commonBounds[0])) /\n textureSize;\n this.state.colorDomain = colorDomain.map(x => x * metersPerPixel * weightsScale);\n } else {\n this.state.colorDomain = colorDomain || DEFAULT_COLOR_DOMAIN;\n }\n\n const uniforms = {\n radiusPixels,\n commonBounds,\n textureWidth: textureSize,\n weightsScale\n };\n // Attribute manager sets data array count as instaceCount on model\n // we need to set that as elementCount on 'weightsTransform'\n weightsTransform.update({\n elementCount: this.getNumInstances()\n });\n weightsTransform.run({\n uniforms,\n parameters: {\n blend: true,\n depthTest: false,\n blendFunc: [GL.ONE, GL.ONE],\n blendEquation: GL.FUNC_ADD\n },\n clearRenderTarget: true,\n attributes: this.getAttributes(),\n moduleSettings: this.getModuleSettings()\n });\n this._updateMaxWeightValue();\n\n // reset filtering parameters (TODO: remove once luma issue#1193 is fixed)\n weightsTexture.setParameters({\n [GL.TEXTURE_MAG_FILTER]: GL.LINEAR,\n [GL.TEXTURE_MIN_FILTER]: GL.LINEAR\n });\n }\n\n _debouncedUpdateWeightmap(fromTimer = false) {\n let {updateTimer} = this.state;\n const {debounceTimeout} = this.props;\n\n if (fromTimer) {\n updateTimer = null;\n // update\n this._updateBounds(true);\n this._updateTextureRenderingBounds();\n this.setState({isWeightMapDirty: true});\n } else {\n this.setState({isWeightMapDirty: false});\n clearTimeout(updateTimer);\n updateTimer = setTimeout(this._debouncedUpdateWeightmap.bind(this, true), debounceTimeout);\n }\n\n this.setState({updateTimer});\n }\n\n // input: worldBounds: [minLong, minLat, maxLong, maxLat]\n // input: opts.useLayerCoordinateSystem : layers coordiante system is used\n // optput: commonBounds: [minX, minY, maxX, maxY] scaled to fit the current texture\n _worldToCommonBounds(worldBounds, opts = {}) {\n const {useLayerCoordinateSystem = false} = opts;\n const [minLong, minLat, maxLong, maxLat] = worldBounds;\n const {viewport} = this.context;\n const {textureSize} = this.state;\n const {coordinateSystem} = this.props;\n\n const offsetMode =\n useLayerCoordinateSystem &&\n (coordinateSystem === COORDINATE_SYSTEM.LNGLAT_OFFSETS ||\n coordinateSystem === COORDINATE_SYSTEM.METER_OFFSETS);\n const offsetOriginCommon = offsetMode\n ? viewport.projectPosition(this.props.coordinateOrigin)\n : [0, 0];\n const size = (textureSize * RESOLUTION) / viewport.scale;\n\n let bottomLeftCommon;\n let topRightCommon;\n\n // Y-axis is flipped between World and Common bounds\n if (useLayerCoordinateSystem && !offsetMode) {\n bottomLeftCommon = this.projectPosition([minLong, minLat, 0]);\n topRightCommon = this.projectPosition([maxLong, maxLat, 0]);\n } else {\n bottomLeftCommon = viewport.projectPosition([minLong, minLat, 0]);\n topRightCommon = viewport.projectPosition([maxLong, maxLat, 0]);\n }\n // Ignore z component\n return scaleToAspectRatio(\n [\n bottomLeftCommon[0] - offsetOriginCommon[0],\n bottomLeftCommon[1] - offsetOriginCommon[1],\n topRightCommon[0] - offsetOriginCommon[0],\n topRightCommon[1] - offsetOriginCommon[1]\n ],\n size,\n size\n );\n }\n\n // input commonBounds: [xMin, yMin, xMax, yMax]\n // output worldBounds: [minLong, minLat, maxLong, maxLat]\n _commonToWorldBounds(commonBounds) {\n const [xMin, yMin, xMax, yMax] = commonBounds;\n const {viewport} = this.context;\n const bottomLeftWorld = viewport.unprojectPosition([xMin, yMin]);\n const topRightWorld = viewport.unprojectPosition([xMax, yMax]);\n\n return bottomLeftWorld.slice(0, 2).concat(topRightWorld.slice(0, 2));\n }\n}\n\nHeatmapLayer.layerName = 'HeatmapLayer';\nHeatmapLayer.defaultProps = defaultProps;\n"],"file":"heatmap-layer.js"}
|
|
1
|
+
{"version":3,"sources":["../../../src/heatmap-layer/heatmap-layer.js"],"names":["RESOLUTION","TEXTURE_OPTIONS","mipmaps","parameters","dataFormat","DEFAULT_COLOR_DOMAIN","AGGREGATION_MODE","SUM","MEAN","defaultProps","getPosition","type","value","x","position","getWeight","intensity","min","radiusPixels","max","colorRange","defaultColorRange","threshold","colorDomain","optional","aggregation","weightsTextureSize","debounceTimeout","REQUIRED_FEATURES","FEATURES","BLEND_EQUATION_MINMAX","TEXTURE_FLOAT","FLOAT_TARGET_FEATURES","COLOR_ATTACHMENT_RGBA32F","FLOAT_BLEND","DIMENSIONS","data","props","HeatmapLayer","gl","context","setState","supported","log","error","id","_setupTextureParams","_setupAttributes","_setupResources","changeFlags","somethingChanged","opts","state","_updateHeatmapState","oldProps","_getChangeFlags","dataChanged","viewportChanged","boundsChanged","_updateBounds","_updateTextureRenderingBounds","clearTimeout","updateTimer","isWeightMapDirty","viewportZoomChanged","_debouncedUpdateWeightmap","_updateColorTexture","_updateWeightmap","zoom","viewport","weightsTexture","triPositionBuffer","triTexCoordBuffer","maxWeightsTexture","colorTexture","updateTriggers","TriangleLayerClass","getSubLayerClass","TriangleLayer","getSubLayerProps","coordinateSystem","COORDINATE_SYSTEM","DEFAULT","attributes","positions","texCoords","vertexCount","maxTexture","aggregationMode","texture","weightsTransform","maxWeightTransform","delete","AttributeManager","stats","dimensions","isAttributeChanged","isAggregationDirty","compareAll","dimension","textureSize","format","Texture2D","width","height","attributeManager","getAttributeManager","add","size","accessor","weights","positionAttributeName","Math","floatTargetSupport","weightsScale","warn","vs","vs_max","_fs","fs_max","weights_vs","weights_fs","shaders","Transform","elementCount","_targetTexture","_targetTextureVarying","_createTextures","weightsTransformShaders","getShaders","_createWeightsTransform","maxWeightsTransformShaders","_sourceTextures","inTexture","Buffer","byteLength","shaderOptions","run","blend","depthTest","blendFunc","blendEquation","forceUpdate","viewportCorners","unproject","map","p","fround","visibleWorldBounds","newState","worldBounds","scaledCommonBounds","_worldToCommonBounds","_commonToWorldBounds","LNGLAT","normalizedCommonBounds","subData","textureBounds","projectPosition","colors","Uint8Array","setImageData","length","commonBounds","useLayerCoordinateSystem","metersPerPixel","distanceScales","metersPerUnit","uniforms","textureWidth","update","getNumInstances","clearRenderTarget","getAttributes","moduleSettings","getModuleSettings","_updateMaxWeightValue","setParameters","fromTimer","setTimeout","bind","minLong","minLat","maxLong","maxLat","offsetMode","LNGLAT_OFFSETS","METER_OFFSETS","offsetOriginCommon","coordinateOrigin","scale","bottomLeftCommon","topRightCommon","xMin","yMin","xMax","yMax","bottomLeftWorld","unprojectPosition","topRightWorld","slice","concat","AggregationLayer","layerName"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAsBA;;AAQA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;;;AAEA,IAAMA,UAAU,GAAG,CAAnB;AACA,IAAMC,eAAe,GAAG;AACtB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,CAA2B,CAACH,IAAD,EAAOC,IAAP,CAA3B,CAAtB;AAEA,aAAOC,eAAe,CAACG,KAAhB,CAAsB,CAAtB,EAAyB,CAAzB,EAA4BC,MAA5B,CAAmCF,aAAa,CAACC,KAAd,CAAoB,CAApB,EAAuB,CAAvB,CAAnC,CAAP;AACD;;;EA3euCE,yB;;;AA8e1CpK,YAAY,CAACqK,SAAb,GAAyB,cAAzB;AACArK,YAAY,CAAC7B,YAAb,GAA4BA,YAA5B","sourcesContent":["// Copyright (c) 2015 - 2019 Uber Technologies, Inc.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n/* global setTimeout clearTimeout */\nimport GL from '@luma.gl/constants';\nimport {\n getBounds,\n boundsContain,\n packVertices,\n scaleToAspectRatio,\n getTextureCoordinates,\n getTextureParams\n} from './heatmap-layer-utils';\nimport {Buffer, Texture2D, Transform, getParameters, FEATURES, hasFeatures} from '@luma.gl/core';\nimport {AttributeManager, COORDINATE_SYSTEM, log} from '@deck.gl/core';\nimport TriangleLayer from './triangle-layer';\nimport AggregationLayer from '../aggregation-layer';\nimport {defaultColorRange, colorRangeToFlatArray} from '../utils/color-utils';\nimport weights_vs from './weights-vs.glsl';\nimport weights_fs from './weights-fs.glsl';\nimport vs_max from './max-vs.glsl';\nimport fs_max from './max-fs.glsl';\n\nconst RESOLUTION = 2; // (number of common space pixels) / (number texels)\nconst TEXTURE_OPTIONS = {\n mipmaps: false,\n parameters: {\n [GL.TEXTURE_MAG_FILTER]: GL.LINEAR,\n [GL.TEXTURE_MIN_FILTER]: GL.LINEAR,\n [GL.TEXTURE_WRAP_S]: GL.CLAMP_TO_EDGE,\n [GL.TEXTURE_WRAP_T]: GL.CLAMP_TO_EDGE\n },\n dataFormat: GL.RGBA\n};\nconst DEFAULT_COLOR_DOMAIN = [0, 0];\nconst AGGREGATION_MODE = {\n SUM: 0,\n MEAN: 1\n};\n\nconst defaultProps = {\n getPosition: {type: 'accessor', value: x => x.position},\n getWeight: {type: 'accessor', value: 1},\n intensity: {type: 'number', min: 0, value: 1},\n radiusPixels: {type: 'number', min: 1, max: 100, value: 50},\n colorRange: defaultColorRange,\n threshold: {type: 'number', min: 0, max: 1, value: 0.05},\n colorDomain: {type: 'array', value: null, optional: true},\n // 'SUM' or 'MEAN'\n aggregation: 'SUM',\n weightsTextureSize: {type: 'number', min: 128, max: 2048, value: 2048},\n debounceTimeout: {type: 'number', min: 0, max: 1000, value: 500}\n};\n\nconst REQUIRED_FEATURES = [\n FEATURES.BLEND_EQUATION_MINMAX, // max weight calculation\n FEATURES.TEXTURE_FLOAT // weight-map as texture\n];\n\nconst FLOAT_TARGET_FEATURES = [\n FEATURES.COLOR_ATTACHMENT_RGBA32F, // ability to render to float texture\n FEATURES.FLOAT_BLEND // ability to blend when rendering to float texture\n];\n\nconst DIMENSIONS = {\n data: {\n props: ['radiusPixels']\n }\n};\n\nexport default class HeatmapLayer extends AggregationLayer {\n initializeState() {\n const {gl} = this.context;\n if (!hasFeatures(gl, REQUIRED_FEATURES)) {\n this.setState({supported: false});\n log.error(`HeatmapLayer: ${this.id} is not supported on this browser`)();\n return;\n }\n super.initializeState(DIMENSIONS);\n this.setState({supported: true, colorDomain: DEFAULT_COLOR_DOMAIN});\n this._setupTextureParams();\n this._setupAttributes();\n this._setupResources();\n }\n\n shouldUpdateState({changeFlags}) {\n // Need to be updated when viewport changes\n return changeFlags.somethingChanged;\n }\n\n /* eslint-disable max-statements,complexity */\n updateState(opts) {\n if (!this.state.supported) {\n return;\n }\n super.updateState(opts);\n this._updateHeatmapState(opts);\n }\n\n _updateHeatmapState(opts) {\n const {props, oldProps} = opts;\n const changeFlags = this._getChangeFlags(opts);\n\n if (changeFlags.dataChanged || changeFlags.viewportChanged) {\n // if data is changed, do not debounce and immediately update the weight map\n changeFlags.boundsChanged = this._updateBounds(changeFlags.dataChanged);\n this._updateTextureRenderingBounds();\n }\n\n if (changeFlags.dataChanged || changeFlags.boundsChanged) {\n // Update weight map immediately\n clearTimeout(this.state.updateTimer);\n this.setState({isWeightMapDirty: true});\n } else if (changeFlags.viewportZoomChanged) {\n // Update weight map when zoom stops\n this._debouncedUpdateWeightmap();\n }\n\n if (props.colorRange !== oldProps.colorRange) {\n this._updateColorTexture(opts);\n }\n\n if (this.state.isWeightMapDirty) {\n this._updateWeightmap();\n }\n\n this.setState({zoom: opts.context.viewport.zoom});\n }\n\n renderLayers() {\n if (!this.state.supported) {\n return [];\n }\n const {\n weightsTexture,\n triPositionBuffer,\n triTexCoordBuffer,\n maxWeightsTexture,\n colorTexture,\n colorDomain\n } = this.state;\n const {updateTriggers, intensity, threshold, aggregation} = this.props;\n\n const TriangleLayerClass = this.getSubLayerClass('triangle', TriangleLayer);\n\n return new TriangleLayerClass(\n this.getSubLayerProps({\n id: 'triangle-layer',\n updateTriggers\n }),\n {\n // position buffer is filled with world coordinates generated from viewport.unproject\n // i.e. LNGLAT if geospatial, CARTESIAN otherwise\n coordinateSystem: COORDINATE_SYSTEM.DEFAULT,\n data: {\n attributes: {\n positions: triPositionBuffer,\n texCoords: triTexCoordBuffer\n }\n },\n vertexCount: 4,\n maxTexture: maxWeightsTexture,\n colorTexture,\n aggregationMode: AGGREGATION_MODE[aggregation] || 0,\n texture: weightsTexture,\n intensity,\n threshold,\n colorDomain\n }\n );\n }\n\n finalizeState() {\n super.finalizeState();\n const {\n weightsTransform,\n weightsTexture,\n maxWeightTransform,\n maxWeightsTexture,\n triPositionBuffer,\n triTexCoordBuffer,\n colorTexture,\n updateTimer\n } = this.state;\n weightsTransform?.delete();\n weightsTexture?.delete();\n maxWeightTransform?.delete();\n maxWeightsTexture?.delete();\n triPositionBuffer?.delete();\n triTexCoordBuffer?.delete();\n colorTexture?.delete();\n if (updateTimer) {\n clearTimeout(updateTimer);\n }\n }\n\n // PRIVATE\n\n // override Composite layer private method to create AttributeManager instance\n _getAttributeManager() {\n return new AttributeManager(this.context.gl, {\n id: this.props.id,\n stats: this.context.stats\n });\n }\n\n _getChangeFlags(opts) {\n const changeFlags = {};\n const {dimensions} = this.state;\n changeFlags.dataChanged =\n this.isAttributeChanged() || // if any attribute is changed\n this.isAggregationDirty(opts, {\n compareAll: true,\n dimension: dimensions.data\n });\n changeFlags.viewportChanged = opts.changeFlags.viewportChanged;\n\n const {zoom} = this.state;\n if (!opts.context.viewport || opts.context.viewport.zoom !== zoom) {\n changeFlags.viewportZoomChanged = true;\n }\n\n return changeFlags;\n }\n\n _createTextures() {\n const {gl} = this.context;\n const {textureSize, format, type} = this.state;\n\n this.setState({\n weightsTexture: new Texture2D(gl, {\n width: textureSize,\n height: textureSize,\n format,\n type,\n ...TEXTURE_OPTIONS\n }),\n maxWeightsTexture: new Texture2D(gl, {format, type, ...TEXTURE_OPTIONS}) // 1 X 1 texture,\n });\n }\n\n _setupAttributes() {\n const attributeManager = this.getAttributeManager();\n attributeManager.add({\n positions: {size: 3, type: GL.DOUBLE, accessor: 'getPosition'},\n weights: {size: 1, accessor: 'getWeight'}\n });\n this.setState({positionAttributeName: 'positions'});\n }\n\n _setupTextureParams() {\n const {gl} = this.context;\n const {weightsTextureSize} = this.props;\n\n const textureSize = Math.min(weightsTextureSize, getParameters(gl, gl.MAX_TEXTURE_SIZE));\n const floatTargetSupport = hasFeatures(gl, FLOAT_TARGET_FEATURES);\n const {format, type} = getTextureParams({gl, floatTargetSupport});\n const weightsScale = floatTargetSupport ? 1 : 1 / 255;\n this.setState({textureSize, format, type, weightsScale});\n if (!floatTargetSupport) {\n log.warn(\n `HeatmapLayer: ${this.id} rendering to float texture not supported, fallingback to low precession format`\n )();\n }\n }\n\n getShaders(type) {\n return super.getShaders(\n type === 'max-weights-transform'\n ? {\n vs: vs_max,\n _fs: fs_max\n }\n : {\n vs: weights_vs,\n _fs: weights_fs\n }\n );\n }\n\n _createWeightsTransform(shaders = {}) {\n const {gl} = this.context;\n let {weightsTransform} = this.state;\n const {weightsTexture} = this.state;\n weightsTransform?.delete();\n\n weightsTransform = new Transform(gl, {\n id: `${this.id}-weights-transform`,\n elementCount: 1,\n _targetTexture: weightsTexture,\n _targetTextureVarying: 'weightsTexture',\n ...shaders\n });\n this.setState({weightsTransform});\n }\n\n _setupResources() {\n const {gl} = this.context;\n this._createTextures();\n const {textureSize, weightsTexture, maxWeightsTexture} = this.state;\n\n const weightsTransformShaders = this.getShaders('weights-transform');\n this._createWeightsTransform(weightsTransformShaders);\n\n const maxWeightsTransformShaders = this.getShaders('max-weights-transform');\n const maxWeightTransform = new Transform(gl, {\n id: `${this.id}-max-weights-transform`,\n _sourceTextures: {\n inTexture: weightsTexture\n },\n _targetTexture: maxWeightsTexture,\n _targetTextureVarying: 'outTexture',\n ...maxWeightsTransformShaders,\n elementCount: textureSize * textureSize\n });\n\n this.setState({\n weightsTexture,\n maxWeightsTexture,\n maxWeightTransform,\n zoom: null,\n triPositionBuffer: new Buffer(gl, {\n byteLength: 48,\n accessor: {size: 3}\n }),\n triTexCoordBuffer: new Buffer(gl, {\n byteLength: 48,\n accessor: {size: 2}\n })\n });\n }\n\n // overwrite super class method to update transform model\n updateShaders(shaderOptions) {\n // sahder params (modules, injects) changed, update model object\n this._createWeightsTransform(shaderOptions);\n }\n\n _updateMaxWeightValue() {\n const {maxWeightTransform} = this.state;\n maxWeightTransform.run({\n parameters: {\n blend: true,\n depthTest: false,\n blendFunc: [GL.ONE, GL.ONE],\n blendEquation: GL.MAX\n }\n });\n }\n\n // Computes world bounds area that needs to be processed for generate heatmap\n _updateBounds(forceUpdate = false) {\n const {viewport} = this.context;\n\n // Unproject all 4 corners of the current screen coordinates into world coordinates (lng/lat)\n // Takes care of viewport has non zero bearing/pitch (i.e axis not aligned with world coordiante system)\n const viewportCorners = [\n viewport.unproject([0, 0]),\n viewport.unproject([viewport.width, 0]),\n viewport.unproject([viewport.width, viewport.height]),\n viewport.unproject([0, viewport.height])\n ].map(p => p.map(Math.fround));\n\n // #1: get world bounds for current viewport extends\n const visibleWorldBounds = getBounds(viewportCorners); // TODO: Change to visible bounds\n\n const newState = {visibleWorldBounds, viewportCorners};\n let boundsChanged = false;\n\n if (\n forceUpdate ||\n !this.state.worldBounds ||\n !boundsContain(this.state.worldBounds, visibleWorldBounds)\n ) {\n // #2 : convert world bounds to common (Flat) bounds\n // #3 : extend common bounds to match aspect ratio with viewport\n const scaledCommonBounds = this._worldToCommonBounds(visibleWorldBounds);\n\n // #4 :convert aligned common bounds to world bounds\n const worldBounds = this._commonToWorldBounds(scaledCommonBounds);\n\n // Clip webmercator projection limits\n if (this.props.coordinateSystem === COORDINATE_SYSTEM.LNGLAT) {\n worldBounds[1] = Math.max(worldBounds[1], -85.051129);\n worldBounds[3] = Math.min(worldBounds[3], 85.051129);\n worldBounds[0] = Math.max(worldBounds[0], -360);\n worldBounds[2] = Math.min(worldBounds[2], 360);\n }\n\n // #5: now convert world bounds to common using Layer's coordiante system and origin\n const normalizedCommonBounds = this._worldToCommonBounds(worldBounds);\n\n newState.worldBounds = worldBounds;\n newState.normalizedCommonBounds = normalizedCommonBounds;\n\n boundsChanged = true;\n }\n this.setState(newState);\n return boundsChanged;\n }\n\n _updateTextureRenderingBounds() {\n // Just render visible portion of the texture\n const {triPositionBuffer, triTexCoordBuffer, normalizedCommonBounds, viewportCorners} =\n this.state;\n\n const {viewport} = this.context;\n\n triPositionBuffer.subData(packVertices(viewportCorners, 3));\n\n const textureBounds = viewportCorners.map(p =>\n getTextureCoordinates(viewport.projectPosition(p), normalizedCommonBounds)\n );\n triTexCoordBuffer.subData(packVertices(textureBounds, 2));\n }\n\n _updateColorTexture(opts) {\n const {colorRange} = opts.props;\n let {colorTexture} = this.state;\n const colors = colorRangeToFlatArray(colorRange, false, Uint8Array);\n\n if (colorTexture) {\n colorTexture.setImageData({\n data: colors,\n width: colorRange.length\n });\n } else {\n colorTexture = new Texture2D(this.context.gl, {\n data: colors,\n width: colorRange.length,\n height: 1,\n ...TEXTURE_OPTIONS\n });\n }\n this.setState({colorTexture});\n }\n\n _updateWeightmap() {\n const {radiusPixels, colorDomain, aggregation} = this.props;\n const {weightsTransform, worldBounds, textureSize, weightsTexture, weightsScale} = this.state;\n this.state.isWeightMapDirty = false;\n\n // convert world bounds to common using Layer's coordiante system and origin\n const commonBounds = this._worldToCommonBounds(worldBounds, {\n useLayerCoordinateSystem: true\n });\n\n if (colorDomain && aggregation === 'SUM') {\n // scale color domain to weight per pixel\n const {viewport} = this.context;\n const metersPerPixel =\n (viewport.distanceScales.metersPerUnit[2] * (commonBounds[2] - commonBounds[0])) /\n textureSize;\n this.state.colorDomain = colorDomain.map(x => x * metersPerPixel * weightsScale);\n } else {\n this.state.colorDomain = colorDomain || DEFAULT_COLOR_DOMAIN;\n }\n\n const uniforms = {\n radiusPixels,\n commonBounds,\n textureWidth: textureSize,\n weightsScale\n };\n // Attribute manager sets data array count as instaceCount on model\n // we need to set that as elementCount on 'weightsTransform'\n weightsTransform.update({\n elementCount: this.getNumInstances()\n });\n weightsTransform.run({\n uniforms,\n parameters: {\n blend: true,\n depthTest: false,\n blendFunc: [GL.ONE, GL.ONE],\n blendEquation: GL.FUNC_ADD\n },\n clearRenderTarget: true,\n attributes: this.getAttributes(),\n moduleSettings: this.getModuleSettings()\n });\n this._updateMaxWeightValue();\n\n // reset filtering parameters (TODO: remove once luma issue#1193 is fixed)\n weightsTexture.setParameters({\n [GL.TEXTURE_MAG_FILTER]: GL.LINEAR,\n [GL.TEXTURE_MIN_FILTER]: GL.LINEAR\n });\n }\n\n _debouncedUpdateWeightmap(fromTimer = false) {\n let {updateTimer} = this.state;\n const {debounceTimeout} = this.props;\n\n if (fromTimer) {\n updateTimer = null;\n // update\n this._updateBounds(true);\n this._updateTextureRenderingBounds();\n this.setState({isWeightMapDirty: true});\n } else {\n this.setState({isWeightMapDirty: false});\n clearTimeout(updateTimer);\n updateTimer = setTimeout(this._debouncedUpdateWeightmap.bind(this, true), debounceTimeout);\n }\n\n this.setState({updateTimer});\n }\n\n // input: worldBounds: [minLong, minLat, maxLong, maxLat]\n // input: opts.useLayerCoordinateSystem : layers coordiante system is used\n // optput: commonBounds: [minX, minY, maxX, maxY] scaled to fit the current texture\n _worldToCommonBounds(worldBounds, opts = {}) {\n const {useLayerCoordinateSystem = false} = opts;\n const [minLong, minLat, maxLong, maxLat] = worldBounds;\n const {viewport} = this.context;\n const {textureSize} = this.state;\n const {coordinateSystem} = this.props;\n\n const offsetMode =\n useLayerCoordinateSystem &&\n (coordinateSystem === COORDINATE_SYSTEM.LNGLAT_OFFSETS ||\n coordinateSystem === COORDINATE_SYSTEM.METER_OFFSETS);\n const offsetOriginCommon = offsetMode\n ? viewport.projectPosition(this.props.coordinateOrigin)\n : [0, 0];\n const size = (textureSize * RESOLUTION) / viewport.scale;\n\n let bottomLeftCommon;\n let topRightCommon;\n\n // Y-axis is flipped between World and Common bounds\n if (useLayerCoordinateSystem && !offsetMode) {\n bottomLeftCommon = this.projectPosition([minLong, minLat, 0]);\n topRightCommon = this.projectPosition([maxLong, maxLat, 0]);\n } else {\n bottomLeftCommon = viewport.projectPosition([minLong, minLat, 0]);\n topRightCommon = viewport.projectPosition([maxLong, maxLat, 0]);\n }\n // Ignore z component\n return scaleToAspectRatio(\n [\n bottomLeftCommon[0] - offsetOriginCommon[0],\n bottomLeftCommon[1] - offsetOriginCommon[1],\n topRightCommon[0] - offsetOriginCommon[0],\n topRightCommon[1] - offsetOriginCommon[1]\n ],\n size,\n size\n );\n }\n\n // input commonBounds: [xMin, yMin, xMax, yMax]\n // output worldBounds: [minLong, minLat, maxLong, maxLat]\n _commonToWorldBounds(commonBounds) {\n const [xMin, yMin, xMax, yMax] = commonBounds;\n const {viewport} = this.context;\n const bottomLeftWorld = viewport.unprojectPosition([xMin, yMin]);\n const topRightWorld = viewport.unprojectPosition([xMax, yMax]);\n\n return bottomLeftWorld.slice(0, 2).concat(topRightWorld.slice(0, 2));\n }\n}\n\nHeatmapLayer.layerName = 'HeatmapLayer';\nHeatmapLayer.defaultProps = defaultProps;\n"],"file":"heatmap-layer.js"}
|
|
@@ -57,9 +57,12 @@ export function getTextureParams({
|
|
|
57
57
|
gl,
|
|
58
58
|
floatTargetSupport
|
|
59
59
|
}) {
|
|
60
|
-
return {
|
|
60
|
+
return floatTargetSupport ? {
|
|
61
61
|
format: isWebGL2(gl) ? 34836 : 6408,
|
|
62
|
-
type:
|
|
62
|
+
type: 5126
|
|
63
|
+
} : {
|
|
64
|
+
format: 6408,
|
|
65
|
+
type: 5121
|
|
63
66
|
};
|
|
64
67
|
}
|
|
65
68
|
//# sourceMappingURL=heatmap-layer-utils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/heatmap-layer/heatmap-layer-utils.js"],"names":["isWebGL2","getBounds","points","x","map","p","y","xMin","Math","min","apply","xMax","max","yMin","yMax","boundsContain","currentBounds","targetBounds","scratchArray","Float32Array","packVertices","dimensions","index","point","i","scaleToAspectRatio","boundingBox","width","height","currentWidth","currentHeight","newWidth","newHeight","xCenter","yCenter","getTextureCoordinates","bounds","getTextureParams","gl","floatTargetSupport","format","type"],"mappings":"AACA,SAAQA,QAAR,QAA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B,CAAP;AAMD;AAGD,OAAO,SAASG,qBAAT,CAA+BZ,KAA/B,EAAsCa,MAAtC,EAA8C;AACnD,QAAM,CAAC7B,IAAD,EAAOM,IAAP,EAAaF,IAAb,EAAmBG,IAAnB,IAA2BsB,MAAjC;AACA,SAAO,CAAC,CAACb,KAAK,CAAC,CAAD,CAAL,GAAWhB,IAAZ,KAAqBI,IAAI,GAAGJ,IAA5B,CAAD,EAAoC,CAACgB,KAAK,CAAC,CAAD,CAAL,GAAWV,IAAZ,KAAqBC,IAAI,GAAGD,IAA5B,CAApC,CAAP;AACD;AAGD,OAAO,SAASwB,gBAAT,CAA0B;AAACC,EAAAA,EAAD;AAAKC,EAAAA;AAAL,CAA1B,EAAoD;AACzD,
|
|
1
|
+
{"version":3,"sources":["../../../src/heatmap-layer/heatmap-layer-utils.js"],"names":["isWebGL2","getBounds","points","x","map","p","y","xMin","Math","min","apply","xMax","max","yMin","yMax","boundsContain","currentBounds","targetBounds","scratchArray","Float32Array","packVertices","dimensions","index","point","i","scaleToAspectRatio","boundingBox","width","height","currentWidth","currentHeight","newWidth","newHeight","xCenter","yCenter","getTextureCoordinates","bounds","getTextureParams","gl","floatTargetSupport","format","type"],"mappings":"AACA,SAAQA,QAAR,QAAuB,eAAvB;AAEA,OAAO,SAASC,SAAT,CAAmBC,MAAnB,EAA2B;AAEhC,QAAMC,CAAC,GAAGD,MAAM,CAACE,GAAP,CAAWC,CAAC,IAAIA,CAAC,CAAC,CAAD,CAAjB,CAAV;AACA,QAAMC,CAAC,GAAGJ,MAAM,CAACE,GAAP,CAAWC,CAAC,IAAIA,CAAC,CAAC,CAAD,CAAjB,CAAV;AAEA,QAAME,IAAI,GAAGC,IAAI,CAACC,GAAL,CAASC,KAAT,CAAe,IAAf,EAAqBP,CAArB,CAAb;AACA,QAAMQ,IAAI,GAAGH,IAAI,CAACI,GAAL,CAASF,KAAT,CAAe,IAAf,EAAqBP,CAArB,CAAb;AACA,QAAMU,IAAI,GAAGL,IAAI,C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A,kBAAkB,GACrB;AAEEC,IAAAA,MAAM,EAAExC,QAAQ,CAACsC,EAAD,CAAR,eAFV;AAGEG,IAAAA,IAAI;AAHN,GADqB,GAMrB;AACED,IAAAA,MAAM,MADR;AAEEC,IAAAA,IAAI;AAFN,GANJ;AAUD","sourcesContent":["import GL from '@luma.gl/constants';\nimport {isWebGL2} from '@luma.gl/core';\n\nexport function getBounds(points) {\n // Now build bounding box in world space (aligned to world coordiante system)\n const x = points.map(p => p[0]);\n const y = points.map(p => p[1]);\n\n const xMin = Math.min.apply(null, x);\n const xMax = Math.max.apply(null, x);\n const yMin = Math.min.apply(null, y);\n const yMax = Math.max.apply(null, y);\n\n return [xMin, yMin, xMax, yMax];\n}\n\n// true if currentBounds contains targetBounds, false otherwise\nexport function boundsContain(currentBounds, targetBounds) {\n if (\n targetBounds[0] >= currentBounds[0] &&\n targetBounds[2] <= currentBounds[2] &&\n targetBounds[1] >= currentBounds[1] &&\n targetBounds[3] <= currentBounds[3]\n ) {\n return true;\n }\n return false;\n}\n\nconst scratchArray = new Float32Array(12);\n\n// For given rectangle bounds generates two triangles vertices that coverit completely\nexport function packVertices(points, dimensions = 2) {\n let index = 0;\n for (const point of points) {\n for (let i = 0; i < dimensions; i++) {\n scratchArray[index++] = point[i] || 0;\n }\n }\n return scratchArray;\n}\n\n// Expands boundingBox:[xMin, yMin, xMax, yMax] to match aspect ratio of given width and height\nexport function scaleToAspectRatio(boundingBox, width, height) {\n const [xMin, yMin, xMax, yMax] = boundingBox;\n\n const currentWidth = xMax - xMin;\n const currentHeight = yMax - yMin;\n\n let newWidth = currentWidth;\n let newHeight = currentHeight;\n if (currentWidth / currentHeight < width / height) {\n // expand bounding box width\n newWidth = (width / height) * currentHeight;\n } else {\n newHeight = (height / width) * currentWidth;\n }\n\n if (newWidth < width) {\n newWidth = width;\n newHeight = height;\n }\n\n const xCenter = (xMax + xMin) / 2;\n const yCenter = (yMax + yMin) / 2;\n\n return [\n xCenter - newWidth / 2,\n yCenter - newHeight / 2,\n xCenter + newWidth / 2,\n yCenter + newHeight / 2\n ];\n}\n\n// Get texture coordiante of point inside a bounding box\nexport function getTextureCoordinates(point, bounds) {\n const [xMin, yMin, xMax, yMax] = bounds;\n return [(point[0] - xMin) / (xMax - xMin), (point[1] - yMin) / (yMax - yMin)];\n}\n\n// Returns format and type for creating texture objects\nexport function getTextureParams({gl, floatTargetSupport}) {\n return floatTargetSupport\n ? {\n // format: should be RGBA32F on WebGL2 (float textures), RGBA in WebGL1 for float or non float textures\n format: isWebGL2(gl) ? GL.RGBA32F : GL.RGBA,\n type: GL.FLOAT\n }\n : {\n format: GL.RGBA,\n type: GL.UNSIGNED_BYTE\n };\n}\n"],"file":"heatmap-layer-utils.js"}
|
|
@@ -71,6 +71,7 @@ const defaultProps = {
|
|
|
71
71
|
}
|
|
72
72
|
};
|
|
73
73
|
const REQUIRED_FEATURES = [FEATURES.BLEND_EQUATION_MINMAX, FEATURES.TEXTURE_FLOAT];
|
|
74
|
+
const FLOAT_TARGET_FEATURES = [FEATURES.COLOR_ATTACHMENT_RGBA32F, FEATURES.FLOAT_BLEND];
|
|
74
75
|
const DIMENSIONS = {
|
|
75
76
|
data: {
|
|
76
77
|
props: ['radiusPixels']
|
|
@@ -301,7 +302,7 @@ export default class HeatmapLayer extends AggregationLayer {
|
|
|
301
302
|
weightsTextureSize
|
|
302
303
|
} = this.props;
|
|
303
304
|
const textureSize = Math.min(weightsTextureSize, getParameters(gl, 3379));
|
|
304
|
-
const floatTargetSupport = hasFeatures(gl,
|
|
305
|
+
const floatTargetSupport = hasFeatures(gl, FLOAT_TARGET_FEATURES);
|
|
305
306
|
const {
|
|
306
307
|
format,
|
|
307
308
|
type
|