@deck.gl/extensions 8.7.0-alpha.1 → 8.7.0-alpha.10
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 +397 -349
- package/dist/es5/brushing/brushing.js +1 -1
- package/dist/es5/brushing/brushing.js.map +1 -1
- package/dist/es5/brushing/shader-module.js.map +1 -1
- package/dist/es5/clip/clip.js +1 -1
- package/dist/es5/clip/clip.js.map +1 -1
- package/dist/es5/data-filter/aggregator.js +1 -1
- package/dist/es5/data-filter/aggregator.js.map +1 -1
- package/dist/es5/data-filter/data-filter.js +8 -4
- package/dist/es5/data-filter/data-filter.js.map +1 -1
- package/dist/es5/data-filter/shader-module.js.map +1 -1
- package/dist/es5/fill-style/fill-style.js +1 -1
- package/dist/es5/fill-style/fill-style.js.map +1 -1
- package/dist/es5/fill-style/shaders.glsl.js.map +1 -1
- package/dist/es5/fp64/fp64.js +1 -1
- package/dist/es5/fp64/fp64.js.map +1 -1
- package/dist/es5/fp64/project64.js.map +1 -1
- package/dist/es5/index.js.map +1 -1
- package/dist/es5/path-style/path-style.js +1 -1
- package/dist/es5/path-style/path-style.js.map +1 -1
- package/dist/esm/clip/clip.js.map +1 -1
- package/dist/esm/data-filter/aggregator.js.map +1 -1
- package/dist/esm/fill-style/fill-style.js.map +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist.min.js +1 -1
- package/package.json +2 -2
- package/src/clip/clip.js +1 -1
- package/src/data-filter/aggregator.js +107 -107
- /package/src/{index.js → index.ts} +0 -0
package/dist/dist.dev.js
CHANGED
|
@@ -91,7 +91,7 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
|
91
91
|
/******/
|
|
92
92
|
/******/
|
|
93
93
|
/******/ // Load entry module and return exports
|
|
94
|
-
/******/ return __webpack_require__(__webpack_require__.s = "./bundle.
|
|
94
|
+
/******/ return __webpack_require__(__webpack_require__.s = "./bundle.ts");
|
|
95
95
|
/******/ })
|
|
96
96
|
/************************************************************************/
|
|
97
97
|
/******/ ({
|
|
@@ -6295,7 +6295,7 @@ class MathArray extends _extendableBuiltin(Array) {
|
|
|
6295
6295
|
string += (i > 0 ? ', ' : '') + Object(_lib_common__WEBPACK_IMPORTED_MODULE_0__["formatValue"])(this[i], opts);
|
|
6296
6296
|
}
|
|
6297
6297
|
|
|
6298
|
-
return
|
|
6298
|
+
return "".concat(opts.printTypes ? this.constructor.name : '', "[").concat(string, "]");
|
|
6299
6299
|
}
|
|
6300
6300
|
|
|
6301
6301
|
equals(array) {
|
|
@@ -6459,7 +6459,7 @@ class MathArray extends _extendableBuiltin(Array) {
|
|
|
6459
6459
|
|
|
6460
6460
|
check() {
|
|
6461
6461
|
if (_lib_common__WEBPACK_IMPORTED_MODULE_0__["config"].debug && !this.validate()) {
|
|
6462
|
-
throw new Error(
|
|
6462
|
+
throw new Error("math.gl: ".concat(this.constructor.name, " some fields set to invalid numbers'"));
|
|
6463
6463
|
}
|
|
6464
6464
|
|
|
6465
6465
|
return this;
|
|
@@ -6517,14 +6517,14 @@ class Matrix extends _math_array__WEBPACK_IMPORTED_MODULE_0__["default"] {
|
|
|
6517
6517
|
|
|
6518
6518
|
for (let row = 0; row < this.RANK; ++row) {
|
|
6519
6519
|
for (let col = 0; col < this.RANK; ++col) {
|
|
6520
|
-
string +=
|
|
6520
|
+
string += " ".concat(this[col * this.RANK + row]);
|
|
6521
6521
|
}
|
|
6522
6522
|
}
|
|
6523
6523
|
} else {
|
|
6524
6524
|
string += 'column-major:';
|
|
6525
6525
|
|
|
6526
6526
|
for (let i = 0; i < this.ELEMENTS; ++i) {
|
|
6527
|
-
string +=
|
|
6527
|
+
string += " ".concat(this[i]);
|
|
6528
6528
|
}
|
|
6529
6529
|
}
|
|
6530
6530
|
|
|
@@ -7019,7 +7019,7 @@ class Euler extends _base_math_array__WEBPACK_IMPORTED_MODULE_0__["default"] {
|
|
|
7019
7019
|
getQuaternion() {
|
|
7020
7020
|
const q = new _quaternion__WEBPACK_IMPORTED_MODULE_3__["default"]();
|
|
7021
7021
|
|
|
7022
|
-
switch (this[
|
|
7022
|
+
switch (this[3]) {
|
|
7023
7023
|
case Euler.XYZ:
|
|
7024
7024
|
return q.rotateX(this[0]).rotateY(this[1]).rotateZ(this[2]);
|
|
7025
7025
|
|
|
@@ -8412,8 +8412,7 @@ class SphericalCoordinates {
|
|
|
8412
8412
|
printTypes = false
|
|
8413
8413
|
}) {
|
|
8414
8414
|
const f = _lib_common__WEBPACK_IMPORTED_MODULE_0__["formatValue"];
|
|
8415
|
-
return
|
|
8416
|
-
[rho:${f(this.radius)},theta:${f(this.theta)},phi:${f(this.phi)}]`;
|
|
8415
|
+
return "".concat(printTypes ? 'Spherical' : '', "[rho:").concat(f(this.radius), ",theta:").concat(f(this.theta), ",phi:").concat(f(this.phi), "]");
|
|
8417
8416
|
}
|
|
8418
8417
|
|
|
8419
8418
|
equals(other) {
|
|
@@ -9060,7 +9059,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
9060
9059
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return assert; });
|
|
9061
9060
|
function assert(condition, message) {
|
|
9062
9061
|
if (!condition) {
|
|
9063
|
-
throw new Error(
|
|
9062
|
+
throw new Error("math.gl assertion ".concat(message));
|
|
9064
9063
|
}
|
|
9065
9064
|
}
|
|
9066
9065
|
//# sourceMappingURL=assert.js.map
|
|
@@ -9125,7 +9124,7 @@ function formatValue(value, {
|
|
|
9125
9124
|
precision = config.precision || 4
|
|
9126
9125
|
} = {}) {
|
|
9127
9126
|
value = round(value);
|
|
9128
|
-
return
|
|
9127
|
+
return "".concat(parseFloat(value.toPrecision(precision)));
|
|
9129
9128
|
}
|
|
9130
9129
|
function isArray(value) {
|
|
9131
9130
|
return Array.isArray(value) || ArrayBuffer.isView(value) && !(value instanceof DataView);
|
|
@@ -9416,14 +9415,14 @@ function validateVector(v, length) {
|
|
|
9416
9415
|
}
|
|
9417
9416
|
function checkNumber(value) {
|
|
9418
9417
|
if (!Number.isFinite(value)) {
|
|
9419
|
-
throw new Error(
|
|
9418
|
+
throw new Error("Invalid number ".concat(value));
|
|
9420
9419
|
}
|
|
9421
9420
|
|
|
9422
9421
|
return value;
|
|
9423
9422
|
}
|
|
9424
9423
|
function checkVector(v, length, callerName = '') {
|
|
9425
9424
|
if (_common__WEBPACK_IMPORTED_MODULE_0__["config"].debug && !validateVector(v, length)) {
|
|
9426
|
-
throw new Error(
|
|
9425
|
+
throw new Error("math.gl: ".concat(callerName, " some fields set to invalid numbers'"));
|
|
9427
9426
|
}
|
|
9428
9427
|
|
|
9429
9428
|
return v;
|
|
@@ -9432,7 +9431,7 @@ const map = {};
|
|
|
9432
9431
|
function deprecated(method, version) {
|
|
9433
9432
|
if (!map[method]) {
|
|
9434
9433
|
map[method] = true;
|
|
9435
|
-
console.warn(
|
|
9434
|
+
console.warn("".concat(method, " has been removed in version ").concat(version, ", see upgrade guide for more information"));
|
|
9436
9435
|
}
|
|
9437
9436
|
}
|
|
9438
9437
|
//# sourceMappingURL=validators.js.map
|
|
@@ -15216,27 +15215,23 @@ var forEach = function () {
|
|
|
15216
15215
|
|
|
15217
15216
|
/***/ }),
|
|
15218
15217
|
|
|
15219
|
-
/***/ "./bundle.
|
|
15218
|
+
/***/ "./bundle.ts":
|
|
15220
15219
|
/*!*******************!*\
|
|
15221
|
-
!*** ./bundle.
|
|
15220
|
+
!*** ./bundle.ts ***!
|
|
15222
15221
|
\*******************/
|
|
15223
15222
|
/*! no static exports found */
|
|
15224
15223
|
/***/ (function(module, exports, __webpack_require__) {
|
|
15225
15224
|
|
|
15226
|
-
const Extensions = __webpack_require__(/*! ./src */ "./src/index.
|
|
15225
|
+
const Extensions = __webpack_require__(/*! ./src */ "./src/index.ts");
|
|
15227
15226
|
|
|
15228
|
-
|
|
15229
|
-
const _global = typeof window === 'undefined' ? global : window;
|
|
15230
|
-
const deck = _global.deck || {};
|
|
15227
|
+
const deck = globalThis.deck || {}; // Check if peer dependencies are included
|
|
15231
15228
|
|
|
15232
|
-
// Check if peer dependencies are included
|
|
15233
15229
|
if (!deck.Layer) {
|
|
15234
15230
|
throw new Error('@deck.gl/core is not found');
|
|
15235
15231
|
}
|
|
15236
15232
|
|
|
15237
15233
|
module.exports = Object.assign(deck, Extensions);
|
|
15238
15234
|
|
|
15239
|
-
|
|
15240
15235
|
/***/ }),
|
|
15241
15236
|
|
|
15242
15237
|
/***/ "./src/brushing/brushing.js":
|
|
@@ -15273,16 +15268,15 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
15273
15268
|
// THE SOFTWARE.
|
|
15274
15269
|
|
|
15275
15270
|
|
|
15276
|
-
|
|
15277
|
-
|
|
15278
15271
|
const defaultProps = {
|
|
15279
|
-
getBrushingTarget: {
|
|
15280
|
-
|
|
15272
|
+
getBrushingTarget: {
|
|
15273
|
+
type: 'accessor',
|
|
15274
|
+
value: [0, 0]
|
|
15275
|
+
},
|
|
15281
15276
|
brushingTarget: 'source',
|
|
15282
15277
|
brushingEnabled: true,
|
|
15283
15278
|
brushingRadius: 10000
|
|
15284
15279
|
};
|
|
15285
|
-
|
|
15286
15280
|
class BrushingExtension extends _deck_gl_core__WEBPACK_IMPORTED_MODULE_0__["LayerExtension"] {
|
|
15287
15281
|
getShaders(extension) {
|
|
15288
15282
|
return {
|
|
@@ -15292,6 +15286,7 @@ class BrushingExtension extends _deck_gl_core__WEBPACK_IMPORTED_MODULE_0__["Laye
|
|
|
15292
15286
|
|
|
15293
15287
|
initializeState(context, extension) {
|
|
15294
15288
|
const attributeManager = this.getAttributeManager();
|
|
15289
|
+
|
|
15295
15290
|
if (attributeManager) {
|
|
15296
15291
|
attributeManager.add({
|
|
15297
15292
|
brushingTargets: {
|
|
@@ -15310,13 +15305,14 @@ class BrushingExtension extends _deck_gl_core__WEBPACK_IMPORTED_MODULE_0__["Laye
|
|
|
15310
15305
|
}
|
|
15311
15306
|
}
|
|
15312
15307
|
});
|
|
15313
|
-
}
|
|
15314
|
-
|
|
15315
|
-
// Trigger redraw when mouse moves
|
|
15308
|
+
} // Trigger redraw when mouse moves
|
|
15316
15309
|
// TODO - expose this in a better way
|
|
15310
|
+
|
|
15311
|
+
|
|
15317
15312
|
extension.onMouseMove = () => {
|
|
15318
15313
|
this.getCurrentLayer().setNeedsRedraw();
|
|
15319
15314
|
};
|
|
15315
|
+
|
|
15320
15316
|
if (this.context.deck) {
|
|
15321
15317
|
this.context.deck.eventManager.on({
|
|
15322
15318
|
pointermove: extension.onMouseMove,
|
|
@@ -15340,12 +15336,11 @@ class BrushingExtension extends _deck_gl_core__WEBPACK_IMPORTED_MODULE_0__["Laye
|
|
|
15340
15336
|
attribute.value = new Float32Array(2);
|
|
15341
15337
|
return;
|
|
15342
15338
|
}
|
|
15343
|
-
}
|
|
15344
15339
|
|
|
15340
|
+
}
|
|
15345
15341
|
BrushingExtension.extensionName = 'BrushingExtension';
|
|
15346
15342
|
BrushingExtension.defaultProps = defaultProps;
|
|
15347
15343
|
|
|
15348
|
-
|
|
15349
15344
|
/***/ }),
|
|
15350
15345
|
|
|
15351
15346
|
/***/ "./src/brushing/shader-module.js":
|
|
@@ -15379,7 +15374,6 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
15379
15374
|
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
15380
15375
|
// THE SOFTWARE.
|
|
15381
15376
|
|
|
15382
|
-
|
|
15383
15377
|
const vs = `
|
|
15384
15378
|
uniform bool brushing_enabled;
|
|
15385
15379
|
uniform int brushing_target;
|
|
@@ -15413,19 +15407,16 @@ const vs = `
|
|
|
15413
15407
|
brushing_isVisible = float(visible);
|
|
15414
15408
|
}
|
|
15415
15409
|
`;
|
|
15416
|
-
|
|
15417
15410
|
const fs = `
|
|
15418
15411
|
uniform bool brushing_enabled;
|
|
15419
15412
|
varying float brushing_isVisible;
|
|
15420
15413
|
`;
|
|
15421
|
-
|
|
15422
15414
|
const TARGET = {
|
|
15423
15415
|
source: 0,
|
|
15424
15416
|
target: 1,
|
|
15425
15417
|
custom: 2,
|
|
15426
15418
|
source_target: 3
|
|
15427
15419
|
};
|
|
15428
|
-
|
|
15429
15420
|
const inject = {
|
|
15430
15421
|
'vs:DECKGL_FILTER_GL_POSITION': `
|
|
15431
15422
|
vec2 brushingTarget;
|
|
@@ -15452,14 +15443,12 @@ const inject = {
|
|
|
15452
15443
|
}
|
|
15453
15444
|
brushing_setVisible(visible);
|
|
15454
15445
|
`,
|
|
15455
|
-
|
|
15456
15446
|
'fs:DECKGL_FILTER_COLOR': `
|
|
15457
15447
|
if (brushing_enabled && brushing_isVisible < 0.5) {
|
|
15458
15448
|
discard;
|
|
15459
15449
|
}
|
|
15460
15450
|
`
|
|
15461
15451
|
};
|
|
15462
|
-
|
|
15463
15452
|
/* harmony default export */ __webpack_exports__["default"] = ({
|
|
15464
15453
|
name: 'brushing',
|
|
15465
15454
|
dependencies: [_deck_gl_core__WEBPACK_IMPORTED_MODULE_0__["project"]],
|
|
@@ -15470,6 +15459,7 @@ const inject = {
|
|
|
15470
15459
|
if (!opts || !opts.viewport) {
|
|
15471
15460
|
return {};
|
|
15472
15461
|
}
|
|
15462
|
+
|
|
15473
15463
|
const {
|
|
15474
15464
|
brushingEnabled = true,
|
|
15475
15465
|
brushingRadius = 10000,
|
|
@@ -15478,19 +15468,14 @@ const inject = {
|
|
|
15478
15468
|
viewport
|
|
15479
15469
|
} = opts;
|
|
15480
15470
|
return {
|
|
15481
|
-
brushing_enabled: Boolean(
|
|
15482
|
-
brushingEnabled && mousePosition && viewport.containsPixel(mousePosition)
|
|
15483
|
-
),
|
|
15471
|
+
brushing_enabled: Boolean(brushingEnabled && mousePosition && viewport.containsPixel(mousePosition)),
|
|
15484
15472
|
brushing_radius: brushingRadius,
|
|
15485
15473
|
brushing_target: TARGET[brushingTarget] || 0,
|
|
15486
|
-
brushing_mousePos: mousePosition
|
|
15487
|
-
? viewport.unproject([mousePosition.x - viewport.x, mousePosition.y - viewport.y])
|
|
15488
|
-
: [0, 0]
|
|
15474
|
+
brushing_mousePos: mousePosition ? viewport.unproject([mousePosition.x - viewport.x, mousePosition.y - viewport.y]) : [0, 0]
|
|
15489
15475
|
};
|
|
15490
15476
|
}
|
|
15491
15477
|
});
|
|
15492
15478
|
|
|
15493
|
-
|
|
15494
15479
|
/***/ }),
|
|
15495
15480
|
|
|
15496
15481
|
/***/ "./src/clip/clip.js":
|
|
@@ -15525,12 +15510,9 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
15525
15510
|
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
15526
15511
|
// THE SOFTWARE.
|
|
15527
15512
|
|
|
15528
|
-
|
|
15529
|
-
|
|
15530
15513
|
const defaultProps = {
|
|
15531
15514
|
clipBounds: [0, 0, 1, 1]
|
|
15532
15515
|
};
|
|
15533
|
-
|
|
15534
15516
|
const shaderFunction = `
|
|
15535
15517
|
uniform vec4 clip_bounds;
|
|
15536
15518
|
|
|
@@ -15538,16 +15520,15 @@ bool clip_isInBounds(vec2 position) {
|
|
|
15538
15520
|
return position.x >= clip_bounds[0] && position.y >= clip_bounds[1] && position.x < clip_bounds[2] && position.y < clip_bounds[3];
|
|
15539
15521
|
}
|
|
15540
15522
|
`;
|
|
15541
|
-
|
|
15542
15523
|
/*
|
|
15543
15524
|
* The vertex-shader version clips geometries by their anchor position
|
|
15544
15525
|
* e.g. ScatterplotLayer - show if the center of a circle is within bounds
|
|
15545
15526
|
*/
|
|
15527
|
+
|
|
15546
15528
|
const shaderModuleVs = {
|
|
15547
15529
|
name: 'clip-vs',
|
|
15548
15530
|
vs: shaderFunction
|
|
15549
15531
|
};
|
|
15550
|
-
|
|
15551
15532
|
const injectionVs = {
|
|
15552
15533
|
'vs:#decl': `
|
|
15553
15534
|
varying float clip_isVisible;
|
|
@@ -15562,16 +15543,15 @@ varying float clip_isVisible;
|
|
|
15562
15543
|
if (clip_isVisible < 0.5) discard;
|
|
15563
15544
|
`
|
|
15564
15545
|
};
|
|
15565
|
-
|
|
15566
15546
|
/*
|
|
15567
15547
|
* The fragment-shader version clips pixels at the bounds
|
|
15568
|
-
* e.g. PolygonLayer - show the part of the polygon that intersect with the bounds
|
|
15548
|
+
* e.g. PolygonLayer - show the part of the polygon that intersect with the bounds
|
|
15569
15549
|
*/
|
|
15550
|
+
|
|
15570
15551
|
const shaderModuleFs = {
|
|
15571
15552
|
name: 'clip-fs',
|
|
15572
15553
|
fs: shaderFunction
|
|
15573
15554
|
};
|
|
15574
|
-
|
|
15575
15555
|
const injectionFs = {
|
|
15576
15556
|
'vs:#decl': `
|
|
15577
15557
|
varying vec2 clip_commonPosition;
|
|
@@ -15586,53 +15566,47 @@ varying vec2 clip_commonPosition;
|
|
|
15586
15566
|
if (!clip_isInBounds(clip_commonPosition)) discard;
|
|
15587
15567
|
`
|
|
15588
15568
|
};
|
|
15589
|
-
|
|
15590
15569
|
class ClipExtension extends _deck_gl_core__WEBPACK_IMPORTED_MODULE_0__["LayerExtension"] {
|
|
15591
15570
|
getShaders() {
|
|
15592
15571
|
// If `clipByInstance: true`, the entire object is shown/hidden based on its anchor position (done by vertex shader)
|
|
15593
15572
|
// Otherwise, the object is trimmed by the clip bounds (done by fragment shader)
|
|
15594
|
-
|
|
15595
15573
|
// Default behavior: consider a layer instanced if it has attribute `instancePositions`
|
|
15596
|
-
let clipByInstance = 'instancePositions' in this.getAttributeManager().attributes;
|
|
15597
|
-
|
|
15574
|
+
let clipByInstance = ('instancePositions' in this.getAttributeManager().attributes); // Users can override by setting the `clipByInstance` prop
|
|
15575
|
+
|
|
15598
15576
|
if ('clipByInstance' in this.props) {
|
|
15599
15577
|
clipByInstance = this.props.clipByInstance;
|
|
15600
15578
|
}
|
|
15601
|
-
this.state.clipByInstance = clipByInstance;
|
|
15602
15579
|
|
|
15603
|
-
|
|
15604
|
-
|
|
15605
|
-
|
|
15606
|
-
|
|
15607
|
-
|
|
15608
|
-
:
|
|
15609
|
-
|
|
15610
|
-
|
|
15611
|
-
};
|
|
15580
|
+
this.state.clipByInstance = clipByInstance;
|
|
15581
|
+
return clipByInstance ? {
|
|
15582
|
+
modules: [shaderModuleVs],
|
|
15583
|
+
inject: injectionVs
|
|
15584
|
+
} : {
|
|
15585
|
+
modules: [shaderModuleFs],
|
|
15586
|
+
inject: injectionFs
|
|
15587
|
+
};
|
|
15612
15588
|
}
|
|
15613
15589
|
|
|
15614
|
-
draw({
|
|
15615
|
-
|
|
15590
|
+
draw({
|
|
15591
|
+
uniforms
|
|
15592
|
+
}) {
|
|
15593
|
+
const {
|
|
15594
|
+
clipBounds = defaultProps.clipBounds
|
|
15595
|
+
} = this.props;
|
|
15596
|
+
|
|
15616
15597
|
if (this.state.clipByInstance) {
|
|
15617
15598
|
uniforms.clip_bounds = clipBounds;
|
|
15618
15599
|
} else {
|
|
15619
15600
|
const corner0 = this.projectPosition([clipBounds[0], clipBounds[1], 0]);
|
|
15620
15601
|
const corner1 = this.projectPosition([clipBounds[2], clipBounds[3], 0]);
|
|
15621
|
-
|
|
15622
|
-
uniforms.clip_bounds = [
|
|
15623
|
-
Math.min(corner0[0], corner1[0]),
|
|
15624
|
-
Math.min(corner0[1], corner1[1]),
|
|
15625
|
-
Math.max(corner0[0], corner1[0]),
|
|
15626
|
-
Math.max(corner0[1], corner1[1])
|
|
15627
|
-
];
|
|
15602
|
+
uniforms.clip_bounds = [Math.min(corner0[0], corner1[0]), Math.min(corner0[1], corner1[1]), Math.max(corner0[0], corner1[0]), Math.max(corner0[1], corner1[1])];
|
|
15628
15603
|
}
|
|
15629
15604
|
}
|
|
15630
|
-
}
|
|
15631
15605
|
|
|
15606
|
+
}
|
|
15632
15607
|
ClipExtension.extensionName = 'ClipExtension';
|
|
15633
15608
|
ClipExtension.defaultProps = defaultProps;
|
|
15634
15609
|
|
|
15635
|
-
|
|
15636
15610
|
/***/ }),
|
|
15637
15611
|
|
|
15638
15612
|
/***/ "./src/data-filter/aggregator.js":
|
|
@@ -15651,115 +15625,105 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
15651
15625
|
/* harmony import */ var _luma_gl_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @luma.gl/core */ "@luma.gl/core");
|
|
15652
15626
|
/* harmony import */ var _luma_gl_core__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_luma_gl_core__WEBPACK_IMPORTED_MODULE_0__);
|
|
15653
15627
|
/* harmony import */ var _luma_gl_constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @luma.gl/constants */ "../../node_modules/@luma.gl/constants/dist/esm/index.js");
|
|
15654
|
-
|
|
15655
|
-
|
|
15656
|
-
|
|
15657
|
-
const AGGREGATE_VS = `\
|
|
15658
|
-
#define SHADER_NAME data-filter-vertex-shader
|
|
15659
|
-
|
|
15660
|
-
#ifdef FLOAT_TARGET
|
|
15661
|
-
attribute float filterIndices;
|
|
15662
|
-
attribute float filterPrevIndices;
|
|
15663
|
-
#else
|
|
15664
|
-
attribute vec2 filterIndices;
|
|
15665
|
-
attribute vec2 filterPrevIndices;
|
|
15666
|
-
#endif
|
|
15667
|
-
|
|
15668
|
-
varying vec4 vColor;
|
|
15669
|
-
const float component = 1.0 / 255.0;
|
|
15670
|
-
|
|
15671
|
-
void main() {
|
|
15672
|
-
#ifdef FLOAT_TARGET
|
|
15673
|
-
dataFilter_value *= float(filterIndices != filterPrevIndices);
|
|
15674
|
-
gl_Position = vec4(0.0, 0.0, 0.0, 1.0);
|
|
15675
|
-
vColor = vec4(0.0, 0.0, 0.0, 1.0);
|
|
15676
|
-
#else
|
|
15677
|
-
// Float texture is not supported: pack result into 4 channels x 256 px x 64px
|
|
15678
|
-
dataFilter_value *= float(filterIndices.x != filterPrevIndices.x);
|
|
15679
|
-
float col = filterIndices.x;
|
|
15680
|
-
float row = filterIndices.y * 4.0;
|
|
15681
|
-
float channel = floor(row);
|
|
15682
|
-
row = fract(row);
|
|
15683
|
-
vColor = component * vec4(bvec4(channel == 0.0, channel == 1.0, channel == 2.0, channel == 3.0));
|
|
15684
|
-
gl_Position = vec4(col * 2.0 - 1.0, row * 2.0 - 1.0, 0.0, 1.0);
|
|
15685
|
-
#endif
|
|
15686
|
-
gl_PointSize = 1.0;
|
|
15687
|
-
}
|
|
15688
|
-
`;
|
|
15689
|
-
|
|
15690
|
-
const AGGREGATE_FS = `\
|
|
15691
|
-
#define SHADER_NAME data-filter-fragment-shader
|
|
15692
|
-
precision highp float;
|
|
15693
|
-
|
|
15694
|
-
varying vec4 vColor;
|
|
15695
|
-
|
|
15696
|
-
void main() {
|
|
15697
|
-
if (dataFilter_value < 0.5) {
|
|
15698
|
-
discard;
|
|
15699
|
-
}
|
|
15700
|
-
gl_FragColor = vColor;
|
|
15701
|
-
}
|
|
15702
|
-
`;
|
|
15703
|
-
|
|
15704
|
-
function supportsFloatTarget(gl) {
|
|
15705
|
-
// https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API/WebGL_best_practices#Support_for_float_textures_doesnt_mean_you_can_render_into_them!
|
|
15706
|
-
return (
|
|
15707
|
-
gl.getExtension('EXT_float_blend') &&
|
|
15708
|
-
// WebGL 2
|
|
15709
|
-
(gl.getExtension('EXT_color_buffer_float') ||
|
|
15710
|
-
// WebGL 1
|
|
15711
|
-
gl.getExtension('WEBGL_color_buffer_float'))
|
|
15712
|
-
);
|
|
15713
|
-
}
|
|
15714
|
-
|
|
15715
|
-
// A 1x1 framebuffer object that encodes the total count of filtered items
|
|
15716
|
-
function getFramebuffer(gl, useFloatTarget) {
|
|
15717
|
-
if (useFloatTarget) {
|
|
15718
|
-
return new _luma_gl_core__WEBPACK_IMPORTED_MODULE_0__["Framebuffer"](gl, {
|
|
15719
|
-
width: 1,
|
|
15720
|
-
height: 1,
|
|
15721
|
-
attachments: {
|
|
15722
|
-
[_luma_gl_constants__WEBPACK_IMPORTED_MODULE_1__["default"].COLOR_ATTACHMENT0]: new _luma_gl_core__WEBPACK_IMPORTED_MODULE_0__["Texture2D"](gl, {
|
|
15723
|
-
format: Object(_luma_gl_core__WEBPACK_IMPORTED_MODULE_0__["isWebGL2"])(gl) ? _luma_gl_constants__WEBPACK_IMPORTED_MODULE_1__["default"].RGBA32F : _luma_gl_constants__WEBPACK_IMPORTED_MODULE_1__["default"].RGBA,
|
|
15724
|
-
type: _luma_gl_constants__WEBPACK_IMPORTED_MODULE_1__["default"].FLOAT,
|
|
15725
|
-
mipmaps: false
|
|
15726
|
-
})
|
|
15727
|
-
}
|
|
15728
|
-
});
|
|
15729
|
-
}
|
|
15730
|
-
return new _luma_gl_core__WEBPACK_IMPORTED_MODULE_0__["Framebuffer"](gl, {
|
|
15731
|
-
width: 256,
|
|
15732
|
-
height: 64,
|
|
15733
|
-
depth: false
|
|
15734
|
-
});
|
|
15735
|
-
}
|
|
15736
|
-
|
|
15737
|
-
// Increments the counter based on dataFilter_value
|
|
15738
|
-
function getModel(gl, shaderOptions, useFloatTarget) {
|
|
15739
|
-
shaderOptions.defines.NON_INSTANCED_MODEL = 1;
|
|
15740
|
-
if (useFloatTarget) {
|
|
15741
|
-
shaderOptions.defines.FLOAT_TARGET = 1;
|
|
15742
|
-
}
|
|
15743
|
-
|
|
15744
|
-
return new _luma_gl_core__WEBPACK_IMPORTED_MODULE_0__["Model"](gl, {
|
|
15745
|
-
id: 'data-filter-aggregation-model',
|
|
15746
|
-
vertexCount: 1,
|
|
15747
|
-
isInstanced: false,
|
|
15748
|
-
drawMode: _luma_gl_constants__WEBPACK_IMPORTED_MODULE_1__["default"].POINTS,
|
|
15749
|
-
vs: AGGREGATE_VS,
|
|
15750
|
-
fs: AGGREGATE_FS,
|
|
15751
|
-
...shaderOptions
|
|
15752
|
-
});
|
|
15753
|
-
}
|
|
15754
|
-
|
|
15755
|
-
const parameters = {
|
|
15756
|
-
blend: true,
|
|
15757
|
-
blendFunc: [_luma_gl_constants__WEBPACK_IMPORTED_MODULE_1__["default"].ONE, _luma_gl_constants__WEBPACK_IMPORTED_MODULE_1__["default"].ONE, _luma_gl_constants__WEBPACK_IMPORTED_MODULE_1__["default"].ONE, _luma_gl_constants__WEBPACK_IMPORTED_MODULE_1__["default"].ONE],
|
|
15758
|
-
blendEquation: [_luma_gl_constants__WEBPACK_IMPORTED_MODULE_1__["default"].FUNC_ADD, _luma_gl_constants__WEBPACK_IMPORTED_MODULE_1__["default"].FUNC_ADD],
|
|
15759
|
-
depthTest: false
|
|
15760
|
-
};
|
|
15761
15628
|
|
|
15762
15629
|
|
|
15630
|
+
const AGGREGATE_VS = `\
|
|
15631
|
+
#define SHADER_NAME data-filter-vertex-shader
|
|
15632
|
+
|
|
15633
|
+
#ifdef FLOAT_TARGET
|
|
15634
|
+
attribute float filterIndices;
|
|
15635
|
+
attribute float filterPrevIndices;
|
|
15636
|
+
#else
|
|
15637
|
+
attribute vec2 filterIndices;
|
|
15638
|
+
attribute vec2 filterPrevIndices;
|
|
15639
|
+
#endif
|
|
15640
|
+
|
|
15641
|
+
varying vec4 vColor;
|
|
15642
|
+
const float component = 1.0 / 255.0;
|
|
15643
|
+
|
|
15644
|
+
void main() {
|
|
15645
|
+
#ifdef FLOAT_TARGET
|
|
15646
|
+
dataFilter_value *= float(filterIndices != filterPrevIndices);
|
|
15647
|
+
gl_Position = vec4(0.0, 0.0, 0.0, 1.0);
|
|
15648
|
+
vColor = vec4(0.0, 0.0, 0.0, 1.0);
|
|
15649
|
+
#else
|
|
15650
|
+
// Float texture is not supported: pack result into 4 channels x 256 px x 64px
|
|
15651
|
+
dataFilter_value *= float(filterIndices.x != filterPrevIndices.x);
|
|
15652
|
+
float col = filterIndices.x;
|
|
15653
|
+
float row = filterIndices.y * 4.0;
|
|
15654
|
+
float channel = floor(row);
|
|
15655
|
+
row = fract(row);
|
|
15656
|
+
vColor = component * vec4(bvec4(channel == 0.0, channel == 1.0, channel == 2.0, channel == 3.0));
|
|
15657
|
+
gl_Position = vec4(col * 2.0 - 1.0, row * 2.0 - 1.0, 0.0, 1.0);
|
|
15658
|
+
#endif
|
|
15659
|
+
gl_PointSize = 1.0;
|
|
15660
|
+
}
|
|
15661
|
+
`;
|
|
15662
|
+
const AGGREGATE_FS = `\
|
|
15663
|
+
#define SHADER_NAME data-filter-fragment-shader
|
|
15664
|
+
precision highp float;
|
|
15665
|
+
|
|
15666
|
+
varying vec4 vColor;
|
|
15667
|
+
|
|
15668
|
+
void main() {
|
|
15669
|
+
if (dataFilter_value < 0.5) {
|
|
15670
|
+
discard;
|
|
15671
|
+
}
|
|
15672
|
+
gl_FragColor = vColor;
|
|
15673
|
+
}
|
|
15674
|
+
`;
|
|
15675
|
+
function supportsFloatTarget(gl) {
|
|
15676
|
+
// https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API/WebGL_best_practices#Support_for_float_textures_doesnt_mean_you_can_render_into_them!
|
|
15677
|
+
return gl.getExtension('EXT_float_blend') && (gl.getExtension('EXT_color_buffer_float') || // WebGL 1
|
|
15678
|
+
gl.getExtension('WEBGL_color_buffer_float'));
|
|
15679
|
+
} // A 1x1 framebuffer object that encodes the total count of filtered items
|
|
15680
|
+
|
|
15681
|
+
function getFramebuffer(gl, useFloatTarget) {
|
|
15682
|
+
if (useFloatTarget) {
|
|
15683
|
+
return new _luma_gl_core__WEBPACK_IMPORTED_MODULE_0__["Framebuffer"](gl, {
|
|
15684
|
+
width: 1,
|
|
15685
|
+
height: 1,
|
|
15686
|
+
attachments: {
|
|
15687
|
+
[_luma_gl_constants__WEBPACK_IMPORTED_MODULE_1__["default"].COLOR_ATTACHMENT0]: new _luma_gl_core__WEBPACK_IMPORTED_MODULE_0__["Texture2D"](gl, {
|
|
15688
|
+
format: Object(_luma_gl_core__WEBPACK_IMPORTED_MODULE_0__["isWebGL2"])(gl) ? _luma_gl_constants__WEBPACK_IMPORTED_MODULE_1__["default"].RGBA32F : _luma_gl_constants__WEBPACK_IMPORTED_MODULE_1__["default"].RGBA,
|
|
15689
|
+
type: _luma_gl_constants__WEBPACK_IMPORTED_MODULE_1__["default"].FLOAT,
|
|
15690
|
+
mipmaps: false
|
|
15691
|
+
})
|
|
15692
|
+
}
|
|
15693
|
+
});
|
|
15694
|
+
}
|
|
15695
|
+
|
|
15696
|
+
return new _luma_gl_core__WEBPACK_IMPORTED_MODULE_0__["Framebuffer"](gl, {
|
|
15697
|
+
width: 256,
|
|
15698
|
+
height: 64,
|
|
15699
|
+
depth: false
|
|
15700
|
+
});
|
|
15701
|
+
} // Increments the counter based on dataFilter_value
|
|
15702
|
+
|
|
15703
|
+
function getModel(gl, shaderOptions, useFloatTarget) {
|
|
15704
|
+
shaderOptions.defines.NON_INSTANCED_MODEL = 1;
|
|
15705
|
+
|
|
15706
|
+
if (useFloatTarget) {
|
|
15707
|
+
shaderOptions.defines.FLOAT_TARGET = 1;
|
|
15708
|
+
}
|
|
15709
|
+
|
|
15710
|
+
return new _luma_gl_core__WEBPACK_IMPORTED_MODULE_0__["Model"](gl, {
|
|
15711
|
+
id: 'data-filter-aggregation-model',
|
|
15712
|
+
vertexCount: 1,
|
|
15713
|
+
isInstanced: false,
|
|
15714
|
+
drawMode: _luma_gl_constants__WEBPACK_IMPORTED_MODULE_1__["default"].POINTS,
|
|
15715
|
+
vs: AGGREGATE_VS,
|
|
15716
|
+
fs: AGGREGATE_FS,
|
|
15717
|
+
...shaderOptions
|
|
15718
|
+
});
|
|
15719
|
+
}
|
|
15720
|
+
const parameters = {
|
|
15721
|
+
blend: true,
|
|
15722
|
+
blendFunc: [_luma_gl_constants__WEBPACK_IMPORTED_MODULE_1__["default"].ONE, _luma_gl_constants__WEBPACK_IMPORTED_MODULE_1__["default"].ONE, _luma_gl_constants__WEBPACK_IMPORTED_MODULE_1__["default"].ONE, _luma_gl_constants__WEBPACK_IMPORTED_MODULE_1__["default"].ONE],
|
|
15723
|
+
blendEquation: [_luma_gl_constants__WEBPACK_IMPORTED_MODULE_1__["default"].FUNC_ADD, _luma_gl_constants__WEBPACK_IMPORTED_MODULE_1__["default"].FUNC_ADD],
|
|
15724
|
+
depthTest: false
|
|
15725
|
+
};
|
|
15726
|
+
|
|
15763
15727
|
/***/ }),
|
|
15764
15728
|
|
|
15765
15729
|
/***/ "./src/data-filter/data-filter.js":
|
|
@@ -15803,38 +15767,50 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
15803
15767
|
|
|
15804
15768
|
|
|
15805
15769
|
|
|
15806
|
-
|
|
15807
|
-
|
|
15808
15770
|
const defaultProps = {
|
|
15809
|
-
getFilterValue: {
|
|
15810
|
-
|
|
15811
|
-
|
|
15771
|
+
getFilterValue: {
|
|
15772
|
+
type: 'accessor',
|
|
15773
|
+
value: 0
|
|
15774
|
+
},
|
|
15775
|
+
onFilteredItemsChange: {
|
|
15776
|
+
type: 'function',
|
|
15777
|
+
value: null,
|
|
15778
|
+
compare: false
|
|
15779
|
+
},
|
|
15812
15780
|
filterEnabled: true,
|
|
15813
15781
|
filterRange: [-1, 1],
|
|
15814
15782
|
filterSoftRange: null,
|
|
15815
15783
|
filterTransformSize: true,
|
|
15816
15784
|
filterTransformColor: true
|
|
15817
15785
|
};
|
|
15818
|
-
|
|
15819
15786
|
const DATA_TYPE_FROM_SIZE = {
|
|
15820
15787
|
1: 'float',
|
|
15821
15788
|
2: 'vec2',
|
|
15822
15789
|
3: 'vec3',
|
|
15823
15790
|
4: 'vec4'
|
|
15824
15791
|
};
|
|
15825
|
-
|
|
15826
15792
|
class DataFilterExtension extends _deck_gl_core__WEBPACK_IMPORTED_MODULE_0__["LayerExtension"] {
|
|
15827
|
-
constructor({
|
|
15793
|
+
constructor({
|
|
15794
|
+
filterSize = 1,
|
|
15795
|
+
fp64 = false,
|
|
15796
|
+
countItems = false
|
|
15797
|
+
} = {}) {
|
|
15828
15798
|
if (!DATA_TYPE_FROM_SIZE[filterSize]) {
|
|
15829
15799
|
throw new Error('filterSize out of range');
|
|
15830
15800
|
}
|
|
15831
15801
|
|
|
15832
|
-
super({
|
|
15802
|
+
super({
|
|
15803
|
+
filterSize,
|
|
15804
|
+
fp64,
|
|
15805
|
+
countItems
|
|
15806
|
+
});
|
|
15833
15807
|
}
|
|
15834
15808
|
|
|
15835
15809
|
getShaders(extension) {
|
|
15836
|
-
const {
|
|
15837
|
-
|
|
15810
|
+
const {
|
|
15811
|
+
filterSize,
|
|
15812
|
+
fp64
|
|
15813
|
+
} = extension.opts;
|
|
15838
15814
|
return {
|
|
15839
15815
|
modules: [fp64 ? _shader_module__WEBPACK_IMPORTED_MODULE_1__["shaderModule64"] : _shader_module__WEBPACK_IMPORTED_MODULE_1__["shaderModule"]],
|
|
15840
15816
|
defines: {
|
|
@@ -15846,6 +15822,7 @@ class DataFilterExtension extends _deck_gl_core__WEBPACK_IMPORTED_MODULE_0__["La
|
|
|
15846
15822
|
|
|
15847
15823
|
initializeState(context, extension) {
|
|
15848
15824
|
const attributeManager = this.getAttributeManager();
|
|
15825
|
+
|
|
15849
15826
|
if (attributeManager) {
|
|
15850
15827
|
attributeManager.add({
|
|
15851
15828
|
filterValues: {
|
|
@@ -15864,19 +15841,24 @@ class DataFilterExtension extends _deck_gl_core__WEBPACK_IMPORTED_MODULE_0__["La
|
|
|
15864
15841
|
});
|
|
15865
15842
|
}
|
|
15866
15843
|
|
|
15867
|
-
const {
|
|
15844
|
+
const {
|
|
15845
|
+
gl
|
|
15846
|
+
} = this.context;
|
|
15847
|
+
|
|
15868
15848
|
if (attributeManager && extension.opts.countItems) {
|
|
15869
|
-
const useFloatTarget = _aggregator__WEBPACK_IMPORTED_MODULE_2__["supportsFloatTarget"](gl);
|
|
15870
|
-
// This attribute is needed for variable-width data, e.g. Path, SolidPolygon, Text
|
|
15849
|
+
const useFloatTarget = _aggregator__WEBPACK_IMPORTED_MODULE_2__["supportsFloatTarget"](gl); // This attribute is needed for variable-width data, e.g. Path, SolidPolygon, Text
|
|
15871
15850
|
// The vertex shader checks if a vertex has the same "index" as the previous vertex
|
|
15872
15851
|
// so that we only write one count cross multiple vertices of the same object
|
|
15852
|
+
|
|
15873
15853
|
attributeManager.add({
|
|
15874
15854
|
filterIndices: {
|
|
15875
15855
|
size: useFloatTarget ? 1 : 2,
|
|
15876
15856
|
vertexOffset: 1,
|
|
15877
15857
|
type: _luma_gl_constants__WEBPACK_IMPORTED_MODULE_4__["default"].UNSIGNED_BYTE,
|
|
15878
15858
|
normalized: true,
|
|
15879
|
-
accessor: (object, {
|
|
15859
|
+
accessor: (object, {
|
|
15860
|
+
index
|
|
15861
|
+
}) => {
|
|
15880
15862
|
const i = object && object.__source ? object.__source.index : index;
|
|
15881
15863
|
return useFloatTarget ? (i + 1) % 255 : [(i + 1) % 255, Math.floor(i / 255) % 255];
|
|
15882
15864
|
},
|
|
@@ -15890,77 +15872,96 @@ class DataFilterExtension extends _deck_gl_core__WEBPACK_IMPORTED_MODULE_0__["La
|
|
|
15890
15872
|
}
|
|
15891
15873
|
}
|
|
15892
15874
|
});
|
|
15893
|
-
|
|
15894
15875
|
const filterFBO = _aggregator__WEBPACK_IMPORTED_MODULE_2__["getFramebuffer"](gl, useFloatTarget);
|
|
15895
15876
|
const filterModel = _aggregator__WEBPACK_IMPORTED_MODULE_2__["getModel"](gl, extension.getShaders(extension), useFloatTarget);
|
|
15896
|
-
this.setState({
|
|
15877
|
+
this.setState({
|
|
15878
|
+
filterFBO,
|
|
15879
|
+
filterModel
|
|
15880
|
+
});
|
|
15897
15881
|
}
|
|
15898
15882
|
}
|
|
15899
15883
|
|
|
15900
|
-
updateState({
|
|
15884
|
+
updateState({
|
|
15885
|
+
props,
|
|
15886
|
+
oldProps
|
|
15887
|
+
}) {
|
|
15901
15888
|
if (this.state.filterModel) {
|
|
15902
15889
|
const attributeManager = this.getAttributeManager();
|
|
15903
|
-
const filterNeedsUpdate =
|
|
15904
|
-
|
|
15905
|
-
props.filterEnabled !== oldProps.filterEnabled ||
|
|
15906
|
-
props.filterRange !== oldProps.filterRange ||
|
|
15907
|
-
props.filterSoftRange !== oldProps.filterSoftRange;
|
|
15890
|
+
const filterNeedsUpdate = attributeManager.attributes.filterValues.needsUpdate() || props.filterEnabled !== oldProps.filterEnabled || props.filterRange !== oldProps.filterRange || props.filterSoftRange !== oldProps.filterSoftRange;
|
|
15891
|
+
|
|
15908
15892
|
if (filterNeedsUpdate) {
|
|
15909
|
-
this.setState({
|
|
15893
|
+
this.setState({
|
|
15894
|
+
filterNeedsUpdate
|
|
15895
|
+
});
|
|
15910
15896
|
}
|
|
15911
15897
|
}
|
|
15912
15898
|
}
|
|
15913
15899
|
|
|
15914
15900
|
draw(params, extension) {
|
|
15915
|
-
const {
|
|
15916
|
-
|
|
15901
|
+
const {
|
|
15902
|
+
filterFBO,
|
|
15903
|
+
filterModel,
|
|
15904
|
+
filterNeedsUpdate
|
|
15905
|
+
} = this.state;
|
|
15906
|
+
const {
|
|
15907
|
+
onFilteredItemsChange
|
|
15908
|
+
} = this.props;
|
|
15909
|
+
|
|
15917
15910
|
if (filterNeedsUpdate && onFilteredItemsChange && filterModel) {
|
|
15918
15911
|
const {
|
|
15919
|
-
attributes: {
|
|
15912
|
+
attributes: {
|
|
15913
|
+
filterValues,
|
|
15914
|
+
filterIndices
|
|
15915
|
+
}
|
|
15920
15916
|
} = this.getAttributeManager();
|
|
15921
15917
|
filterModel.setVertexCount(this.getNumInstances());
|
|
15922
|
-
|
|
15923
|
-
|
|
15924
|
-
|
|
15925
|
-
|
|
15926
|
-
|
|
15927
|
-
|
|
15928
|
-
|
|
15929
|
-
|
|
15930
|
-
|
|
15931
|
-
|
|
15932
|
-
|
|
15933
|
-
|
|
15934
|
-
|
|
15935
|
-
|
|
15936
|
-
|
|
15937
|
-
}
|
|
15938
|
-
});
|
|
15918
|
+
const {
|
|
15919
|
+
gl
|
|
15920
|
+
} = this.context;
|
|
15921
|
+
Object(_luma_gl_core__WEBPACK_IMPORTED_MODULE_3__["clear"])(gl, {
|
|
15922
|
+
framebuffer: filterFBO,
|
|
15923
|
+
color: [0, 0, 0, 0]
|
|
15924
|
+
});
|
|
15925
|
+
filterModel.updateModuleSettings(params.moduleParameters).setAttributes({ ...filterValues.getShaderAttributes(),
|
|
15926
|
+
...(filterIndices && filterIndices.getShaderAttributes())
|
|
15927
|
+
}).draw({
|
|
15928
|
+
framebuffer: filterFBO,
|
|
15929
|
+
parameters: { ..._aggregator__WEBPACK_IMPORTED_MODULE_2__["parameters"],
|
|
15930
|
+
viewport: [0, 0, filterFBO.width, filterFBO.height]
|
|
15931
|
+
}
|
|
15932
|
+
});
|
|
15939
15933
|
const color = Object(_luma_gl_core__WEBPACK_IMPORTED_MODULE_3__["readPixelsToArray"])(filterFBO);
|
|
15940
15934
|
let count = 0;
|
|
15935
|
+
|
|
15941
15936
|
for (let i = 0; i < color.length; i++) {
|
|
15942
15937
|
count += color[i];
|
|
15943
15938
|
}
|
|
15944
|
-
onFilteredItemsChange({id: this.id, count});
|
|
15945
15939
|
|
|
15940
|
+
onFilteredItemsChange({
|
|
15941
|
+
id: this.id,
|
|
15942
|
+
count
|
|
15943
|
+
});
|
|
15946
15944
|
this.state.filterNeedsUpdate = false;
|
|
15947
15945
|
}
|
|
15948
15946
|
}
|
|
15949
15947
|
|
|
15950
15948
|
finalizeState() {
|
|
15951
|
-
const {
|
|
15949
|
+
const {
|
|
15950
|
+
filterFBO,
|
|
15951
|
+
filterModel
|
|
15952
|
+
} = this.state;
|
|
15953
|
+
|
|
15952
15954
|
if (filterFBO) {
|
|
15953
15955
|
filterFBO.color.delete();
|
|
15954
15956
|
filterFBO.delete();
|
|
15955
15957
|
filterModel.delete();
|
|
15956
15958
|
}
|
|
15957
15959
|
}
|
|
15958
|
-
}
|
|
15959
15960
|
|
|
15961
|
+
}
|
|
15960
15962
|
DataFilterExtension.extensionName = 'DataFilterExtension';
|
|
15961
15963
|
DataFilterExtension.defaultProps = defaultProps;
|
|
15962
15964
|
|
|
15963
|
-
|
|
15964
15965
|
/***/ }),
|
|
15965
15966
|
|
|
15966
15967
|
/***/ "./src/data-filter/shader-module.js":
|
|
@@ -16033,7 +16034,6 @@ void dataFilter_setValue(DATAFILTER_TYPE valueFromMin, DATAFILTER_TYPE valueFrom
|
|
|
16033
16034
|
}
|
|
16034
16035
|
}
|
|
16035
16036
|
`;
|
|
16036
|
-
|
|
16037
16037
|
const fs = `
|
|
16038
16038
|
uniform bool filter_transformColor;
|
|
16039
16039
|
varying float dataFilter_value;
|
|
@@ -16043,6 +16043,7 @@ const getUniforms = opts => {
|
|
|
16043
16043
|
if (!opts || !opts.extensions) {
|
|
16044
16044
|
return {};
|
|
16045
16045
|
}
|
|
16046
|
+
|
|
16046
16047
|
const {
|
|
16047
16048
|
filterRange = [-1, 1],
|
|
16048
16049
|
filterEnabled = true,
|
|
@@ -16050,25 +16051,21 @@ const getUniforms = opts => {
|
|
|
16050
16051
|
filterTransformColor = true
|
|
16051
16052
|
} = opts;
|
|
16052
16053
|
const filterSoftRange = opts.filterSoftRange || filterRange;
|
|
16053
|
-
|
|
16054
|
-
|
|
16055
|
-
|
|
16056
|
-
|
|
16057
|
-
|
|
16058
|
-
|
|
16059
|
-
|
|
16060
|
-
|
|
16061
|
-
:
|
|
16062
|
-
|
|
16063
|
-
|
|
16064
|
-
filter_softMax: filterSoftRange.map(r => r[1]),
|
|
16065
|
-
filter_max: filterRange.map(r => r[1])
|
|
16066
|
-
};
|
|
16054
|
+
const uniforms = Number.isFinite(filterRange[0]) ? {
|
|
16055
|
+
filter_min: filterRange[0],
|
|
16056
|
+
filter_softMin: filterSoftRange[0],
|
|
16057
|
+
filter_softMax: filterSoftRange[1],
|
|
16058
|
+
filter_max: filterRange[1]
|
|
16059
|
+
} : {
|
|
16060
|
+
filter_min: filterRange.map(r => r[0]),
|
|
16061
|
+
filter_softMin: filterSoftRange.map(r => r[0]),
|
|
16062
|
+
filter_softMax: filterSoftRange.map(r => r[1]),
|
|
16063
|
+
filter_max: filterRange.map(r => r[1])
|
|
16064
|
+
};
|
|
16067
16065
|
uniforms.filter_enabled = filterEnabled;
|
|
16068
16066
|
uniforms.filter_useSoftMargin = Boolean(opts.filterSoftRange);
|
|
16069
16067
|
uniforms.filter_transformSize = filterEnabled && filterTransformSize;
|
|
16070
16068
|
uniforms.filter_transformColor = filterEnabled && filterTransformColor;
|
|
16071
|
-
|
|
16072
16069
|
return uniforms;
|
|
16073
16070
|
};
|
|
16074
16071
|
|
|
@@ -16076,13 +16073,14 @@ const getUniforms64 = opts => {
|
|
|
16076
16073
|
if (!opts || !opts.extensions) {
|
|
16077
16074
|
return {};
|
|
16078
16075
|
}
|
|
16076
|
+
|
|
16079
16077
|
const uniforms = getUniforms(opts);
|
|
16078
|
+
|
|
16080
16079
|
if (Number.isFinite(uniforms.filter_min)) {
|
|
16081
16080
|
const min64High = Math.fround(uniforms.filter_min);
|
|
16082
16081
|
uniforms.filter_min -= min64High;
|
|
16083
16082
|
uniforms.filter_softMin -= min64High;
|
|
16084
16083
|
uniforms.filter_min64High = min64High;
|
|
16085
|
-
|
|
16086
16084
|
const max64High = Math.fround(uniforms.filter_max);
|
|
16087
16085
|
uniforms.filter_max -= max64High;
|
|
16088
16086
|
uniforms.filter_softMax -= max64High;
|
|
@@ -16092,12 +16090,12 @@ const getUniforms64 = opts => {
|
|
|
16092
16090
|
uniforms.filter_min = uniforms.filter_min.map((x, i) => x - min64High[i]);
|
|
16093
16091
|
uniforms.filter_softMin = uniforms.filter_softMin.map((x, i) => x - min64High[i]);
|
|
16094
16092
|
uniforms.filter_min64High = min64High;
|
|
16095
|
-
|
|
16096
16093
|
const max64High = uniforms.filter_max.map(Math.fround);
|
|
16097
16094
|
uniforms.filter_max = uniforms.filter_max.map((x, i) => x - max64High[i]);
|
|
16098
16095
|
uniforms.filter_softMax = uniforms.filter_softMax.map((x, i) => x - max64High[i]);
|
|
16099
16096
|
uniforms.filter_max64High = max64High;
|
|
16100
16097
|
}
|
|
16098
|
+
|
|
16101
16099
|
return uniforms;
|
|
16102
16100
|
};
|
|
16103
16101
|
|
|
@@ -16112,13 +16110,11 @@ const inject = {
|
|
|
16112
16110
|
dataFilter_setValue(DATAFILTER_ATTRIB, DATAFILTER_ATTRIB);
|
|
16113
16111
|
#endif
|
|
16114
16112
|
`,
|
|
16115
|
-
|
|
16116
16113
|
'vs:DECKGL_FILTER_SIZE': `
|
|
16117
16114
|
if (filter_transformSize) {
|
|
16118
16115
|
size = size * dataFilter_value;
|
|
16119
16116
|
}
|
|
16120
16117
|
`,
|
|
16121
|
-
|
|
16122
16118
|
'fs:DECKGL_FILTER_COLOR': `
|
|
16123
16119
|
if (dataFilter_value == 0.0) discard;
|
|
16124
16120
|
if (filter_transformColor) {
|
|
@@ -16126,7 +16122,6 @@ const inject = {
|
|
|
16126
16122
|
}
|
|
16127
16123
|
`
|
|
16128
16124
|
};
|
|
16129
|
-
|
|
16130
16125
|
const shaderModule = {
|
|
16131
16126
|
name: 'data-filter',
|
|
16132
16127
|
vs,
|
|
@@ -16134,7 +16129,6 @@ const shaderModule = {
|
|
|
16134
16129
|
inject,
|
|
16135
16130
|
getUniforms
|
|
16136
16131
|
};
|
|
16137
|
-
|
|
16138
16132
|
const shaderModule64 = {
|
|
16139
16133
|
name: 'data-filter-fp64',
|
|
16140
16134
|
vs,
|
|
@@ -16143,7 +16137,6 @@ const shaderModule64 = {
|
|
|
16143
16137
|
getUniforms: getUniforms64
|
|
16144
16138
|
};
|
|
16145
16139
|
|
|
16146
|
-
|
|
16147
16140
|
/***/ }),
|
|
16148
16141
|
|
|
16149
16142
|
/***/ "./src/fill-style/fill-style.js":
|
|
@@ -16166,18 +16159,24 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
16166
16159
|
|
|
16167
16160
|
|
|
16168
16161
|
|
|
16169
|
-
|
|
16170
|
-
|
|
16171
16162
|
const defaultProps = {
|
|
16172
16163
|
fillPatternEnabled: true,
|
|
16173
16164
|
fillPatternAtlas: null,
|
|
16174
16165
|
fillPatternMapping: null,
|
|
16175
16166
|
fillPatternMask: true,
|
|
16176
|
-
getFillPattern: {
|
|
16177
|
-
|
|
16178
|
-
|
|
16167
|
+
getFillPattern: {
|
|
16168
|
+
type: 'accessor',
|
|
16169
|
+
value: d => d.pattern
|
|
16170
|
+
},
|
|
16171
|
+
getFillPatternScale: {
|
|
16172
|
+
type: 'accessor',
|
|
16173
|
+
value: 1
|
|
16174
|
+
},
|
|
16175
|
+
getFillPatternOffset: {
|
|
16176
|
+
type: 'accessor',
|
|
16177
|
+
value: [0, 0]
|
|
16178
|
+
}
|
|
16179
16179
|
};
|
|
16180
|
-
|
|
16181
16180
|
const DEFAULT_TEXTURE_PARAMETERS = {
|
|
16182
16181
|
[_luma_gl_constants__WEBPACK_IMPORTED_MODULE_2__["default"].TEXTURE_MIN_FILTER]: _luma_gl_constants__WEBPACK_IMPORTED_MODULE_2__["default"].LINEAR,
|
|
16183
16182
|
// GL.LINEAR is the default value but explicitly set it here
|
|
@@ -16186,10 +16185,13 @@ const DEFAULT_TEXTURE_PARAMETERS = {
|
|
|
16186
16185
|
[_luma_gl_constants__WEBPACK_IMPORTED_MODULE_2__["default"].TEXTURE_WRAP_S]: _luma_gl_constants__WEBPACK_IMPORTED_MODULE_2__["default"].CLAMP_TO_EDGE,
|
|
16187
16186
|
[_luma_gl_constants__WEBPACK_IMPORTED_MODULE_2__["default"].TEXTURE_WRAP_T]: _luma_gl_constants__WEBPACK_IMPORTED_MODULE_2__["default"].CLAMP_TO_EDGE
|
|
16188
16187
|
};
|
|
16189
|
-
|
|
16190
16188
|
class FillStyleExtension extends _deck_gl_core__WEBPACK_IMPORTED_MODULE_0__["LayerExtension"] {
|
|
16191
|
-
constructor({
|
|
16192
|
-
|
|
16189
|
+
constructor({
|
|
16190
|
+
pattern = false
|
|
16191
|
+
} = {}) {
|
|
16192
|
+
super({
|
|
16193
|
+
pattern
|
|
16194
|
+
});
|
|
16193
16195
|
}
|
|
16194
16196
|
|
|
16195
16197
|
isEnabled(layer) {
|
|
@@ -16255,6 +16257,7 @@ class FillStyleExtension extends _deck_gl_core__WEBPACK_IMPORTED_MODULE_0__["Lay
|
|
|
16255
16257
|
}
|
|
16256
16258
|
});
|
|
16257
16259
|
}
|
|
16260
|
+
|
|
16258
16261
|
this.setState({
|
|
16259
16262
|
emptyTexture: new _luma_gl_core__WEBPACK_IMPORTED_MODULE_1__["Texture2D"](this.context.gl, {
|
|
16260
16263
|
data: new Uint8Array(4),
|
|
@@ -16264,7 +16267,10 @@ class FillStyleExtension extends _deck_gl_core__WEBPACK_IMPORTED_MODULE_0__["Lay
|
|
|
16264
16267
|
});
|
|
16265
16268
|
}
|
|
16266
16269
|
|
|
16267
|
-
updateState({
|
|
16270
|
+
updateState({
|
|
16271
|
+
props,
|
|
16272
|
+
oldProps
|
|
16273
|
+
}, extension) {
|
|
16268
16274
|
if (!extension.isEnabled(this)) {
|
|
16269
16275
|
return;
|
|
16270
16276
|
}
|
|
@@ -16272,6 +16278,7 @@ class FillStyleExtension extends _deck_gl_core__WEBPACK_IMPORTED_MODULE_0__["Lay
|
|
|
16272
16278
|
if (props.fillPatternAtlas && props.fillPatternAtlas !== oldProps.fillPatternAtlas) {
|
|
16273
16279
|
extension.loadPatternAtlas.call(this, props);
|
|
16274
16280
|
}
|
|
16281
|
+
|
|
16275
16282
|
if (props.fillPatternMapping && props.fillPatternMapping !== oldProps.fillPatternMapping) {
|
|
16276
16283
|
extension.loadPatternMapping.call(this, props);
|
|
16277
16284
|
}
|
|
@@ -16282,60 +16289,84 @@ class FillStyleExtension extends _deck_gl_core__WEBPACK_IMPORTED_MODULE_0__["Lay
|
|
|
16282
16289
|
return;
|
|
16283
16290
|
}
|
|
16284
16291
|
|
|
16285
|
-
const {
|
|
16292
|
+
const {
|
|
16293
|
+
patternTexture
|
|
16294
|
+
} = this.state;
|
|
16286
16295
|
this.setModuleParameters({
|
|
16287
16296
|
fillPatternTexture: patternTexture || this.state.emptyTexture
|
|
16288
16297
|
});
|
|
16289
16298
|
}
|
|
16290
16299
|
|
|
16291
16300
|
finalizeState() {
|
|
16292
|
-
const {
|
|
16301
|
+
const {
|
|
16302
|
+
patternTexture,
|
|
16303
|
+
emptyTexture
|
|
16304
|
+
} = this.state;
|
|
16293
16305
|
patternTexture?.delete();
|
|
16294
16306
|
emptyTexture?.delete();
|
|
16295
16307
|
}
|
|
16296
16308
|
|
|
16297
|
-
async loadPatternAtlas({
|
|
16309
|
+
async loadPatternAtlas({
|
|
16310
|
+
fillPatternAtlas,
|
|
16311
|
+
fetch
|
|
16312
|
+
}) {
|
|
16298
16313
|
this.state.patternTexture?.delete();
|
|
16299
|
-
this.setState({
|
|
16314
|
+
this.setState({
|
|
16315
|
+
patternTexture: null
|
|
16316
|
+
});
|
|
16300
16317
|
let image = fillPatternAtlas;
|
|
16318
|
+
|
|
16301
16319
|
if (typeof image === 'string') {
|
|
16302
|
-
image = await fetch(image, {
|
|
16320
|
+
image = await fetch(image, {
|
|
16321
|
+
propName: 'fillPatternAtlas',
|
|
16322
|
+
layer: this
|
|
16323
|
+
});
|
|
16303
16324
|
}
|
|
16304
|
-
|
|
16305
|
-
|
|
16306
|
-
|
|
16307
|
-
|
|
16308
|
-
|
|
16309
|
-
|
|
16310
|
-
|
|
16311
|
-
|
|
16312
|
-
}
|
|
16313
|
-
|
|
16314
|
-
async loadPatternMapping({
|
|
16315
|
-
|
|
16325
|
+
|
|
16326
|
+
const patternTexture = image instanceof _luma_gl_core__WEBPACK_IMPORTED_MODULE_1__["Texture2D"] ? image : new _luma_gl_core__WEBPACK_IMPORTED_MODULE_1__["Texture2D"](this.context.gl, {
|
|
16327
|
+
data: image,
|
|
16328
|
+
parameters: DEFAULT_TEXTURE_PARAMETERS
|
|
16329
|
+
});
|
|
16330
|
+
this.setState({
|
|
16331
|
+
patternTexture
|
|
16332
|
+
});
|
|
16333
|
+
}
|
|
16334
|
+
|
|
16335
|
+
async loadPatternMapping({
|
|
16336
|
+
fillPatternMapping,
|
|
16337
|
+
fetch
|
|
16338
|
+
}) {
|
|
16339
|
+
this.setState({
|
|
16340
|
+
patternMapping: null
|
|
16341
|
+
});
|
|
16316
16342
|
let patternMapping = fillPatternMapping;
|
|
16343
|
+
|
|
16317
16344
|
if (typeof patternMapping === 'string') {
|
|
16318
16345
|
patternMapping = await fetch(patternMapping, {
|
|
16319
16346
|
propName: 'fillPatternMapping',
|
|
16320
16347
|
layer: this
|
|
16321
16348
|
});
|
|
16322
16349
|
}
|
|
16323
|
-
|
|
16350
|
+
|
|
16351
|
+
this.setState({
|
|
16352
|
+
patternMapping
|
|
16353
|
+
});
|
|
16324
16354
|
this.getAttributeManager().invalidate('getFillPattern');
|
|
16325
16355
|
this.setNeedsUpdate();
|
|
16326
16356
|
}
|
|
16327
16357
|
|
|
16328
16358
|
getPatternFrame(name) {
|
|
16329
|
-
const {
|
|
16359
|
+
const {
|
|
16360
|
+
patternMapping
|
|
16361
|
+
} = this.state;
|
|
16330
16362
|
const def = patternMapping && patternMapping[name];
|
|
16331
16363
|
return def ? [def.x, def.y, def.width, def.height] : [0, 0, 0, 0];
|
|
16332
16364
|
}
|
|
16333
|
-
}
|
|
16334
16365
|
|
|
16366
|
+
}
|
|
16335
16367
|
FillStyleExtension.extensionName = 'FillStyleExtension';
|
|
16336
16368
|
FillStyleExtension.defaultProps = defaultProps;
|
|
16337
16369
|
|
|
16338
|
-
|
|
16339
16370
|
/***/ }),
|
|
16340
16371
|
|
|
16341
16372
|
/***/ "./src/fill-style/shaders.glsl.js":
|
|
@@ -16351,10 +16382,10 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
16351
16382
|
/* harmony import */ var _deck_gl_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @deck.gl/core */ "@deck.gl/core");
|
|
16352
16383
|
/* harmony import */ var _deck_gl_core__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_deck_gl_core__WEBPACK_IMPORTED_MODULE_0__);
|
|
16353
16384
|
|
|
16354
|
-
|
|
16355
16385
|
/*
|
|
16356
16386
|
* fill pattern shader module
|
|
16357
16387
|
*/
|
|
16388
|
+
|
|
16358
16389
|
const patternVs = `
|
|
16359
16390
|
#ifdef NON_INSTANCED_MODEL
|
|
16360
16391
|
#define FILL_PATTERN_FRAME_ATTRIB fillPatternFrames
|
|
@@ -16377,7 +16408,6 @@ varying vec2 fill_uv;
|
|
|
16377
16408
|
varying vec4 fill_patternBounds;
|
|
16378
16409
|
varying vec3 fill_patternPlacement;
|
|
16379
16410
|
`;
|
|
16380
|
-
|
|
16381
16411
|
const patternFs = `
|
|
16382
16412
|
uniform bool fill_patternEnabled;
|
|
16383
16413
|
uniform bool fill_patternMask;
|
|
@@ -16390,12 +16420,10 @@ varying vec2 fill_uv;
|
|
|
16390
16420
|
|
|
16391
16421
|
const float FILL_UV_SCALE = 512.0 / 40000000.0;
|
|
16392
16422
|
`;
|
|
16393
|
-
|
|
16394
16423
|
const inject = {
|
|
16395
16424
|
'vs:DECKGL_FILTER_GL_POSITION': `
|
|
16396
16425
|
fill_uv = geometry.position.xy;
|
|
16397
16426
|
`,
|
|
16398
|
-
|
|
16399
16427
|
'vs:DECKGL_FILTER_COLOR': `
|
|
16400
16428
|
if (fill_patternEnabled) {
|
|
16401
16429
|
fill_patternBounds = FILL_PATTERN_FRAME_ATTRIB / vec4(fill_patternTextureSize, fill_patternTextureSize);
|
|
@@ -16403,7 +16431,6 @@ const inject = {
|
|
|
16403
16431
|
fill_patternPlacement.z = FILL_PATTERN_SCALE_ATTRIB * FILL_PATTERN_FRAME_ATTRIB.w;
|
|
16404
16432
|
}
|
|
16405
16433
|
`,
|
|
16406
|
-
|
|
16407
16434
|
'fs:DECKGL_FILTER_COLOR': `
|
|
16408
16435
|
if (fill_patternEnabled) {
|
|
16409
16436
|
float scale = FILL_UV_SCALE * fill_patternPlacement.z;
|
|
@@ -16423,27 +16450,33 @@ const inject = {
|
|
|
16423
16450
|
|
|
16424
16451
|
function getPatternUniforms(opts = {}, uniforms) {
|
|
16425
16452
|
if ('fillPatternTexture' in opts) {
|
|
16426
|
-
const {
|
|
16453
|
+
const {
|
|
16454
|
+
fillPatternTexture
|
|
16455
|
+
} = opts;
|
|
16427
16456
|
return {
|
|
16428
16457
|
fill_patternTexture: fillPatternTexture,
|
|
16429
16458
|
fill_patternTextureSize: [fillPatternTexture.width, fillPatternTexture.height]
|
|
16430
16459
|
};
|
|
16431
16460
|
}
|
|
16432
|
-
if (opts.viewport) {
|
|
16433
|
-
const {viewport, fillPatternMask = true, fillPatternEnabled = true} = opts;
|
|
16434
|
-
const {project_uCoordinateOrigin, project_uCoordinateSystem} = uniforms;
|
|
16435
|
-
|
|
16436
|
-
const coordinateOriginCommon =
|
|
16437
|
-
project_uCoordinateSystem === _deck_gl_core__WEBPACK_IMPORTED_MODULE_0__["COORDINATE_SYSTEM"].CARTESIAN
|
|
16438
|
-
? project_uCoordinateOrigin
|
|
16439
|
-
: viewport.projectPosition(project_uCoordinateOrigin);
|
|
16440
16461
|
|
|
16462
|
+
if (opts.viewport) {
|
|
16463
|
+
const {
|
|
16464
|
+
viewport,
|
|
16465
|
+
fillPatternMask = true,
|
|
16466
|
+
fillPatternEnabled = true
|
|
16467
|
+
} = opts;
|
|
16468
|
+
const {
|
|
16469
|
+
project_uCoordinateOrigin,
|
|
16470
|
+
project_uCoordinateSystem
|
|
16471
|
+
} = uniforms;
|
|
16472
|
+
const coordinateOriginCommon = project_uCoordinateSystem === _deck_gl_core__WEBPACK_IMPORTED_MODULE_0__["COORDINATE_SYSTEM"].CARTESIAN ? project_uCoordinateOrigin : viewport.projectPosition(project_uCoordinateOrigin);
|
|
16441
16473
|
return {
|
|
16442
16474
|
fill_uvCoordinateOrigin: coordinateOriginCommon.slice(0, 2),
|
|
16443
16475
|
fill_patternMask: fillPatternMask,
|
|
16444
16476
|
fill_patternEnabled: fillPatternEnabled
|
|
16445
16477
|
};
|
|
16446
16478
|
}
|
|
16479
|
+
|
|
16447
16480
|
return {};
|
|
16448
16481
|
}
|
|
16449
16482
|
|
|
@@ -16456,7 +16489,6 @@ const patternShaders = {
|
|
|
16456
16489
|
getUniforms: getPatternUniforms
|
|
16457
16490
|
};
|
|
16458
16491
|
|
|
16459
|
-
|
|
16460
16492
|
/***/ }),
|
|
16461
16493
|
|
|
16462
16494
|
/***/ "./src/fp64/fp64.js":
|
|
@@ -16493,15 +16525,13 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
16493
16525
|
// THE SOFTWARE.
|
|
16494
16526
|
|
|
16495
16527
|
|
|
16496
|
-
|
|
16497
|
-
|
|
16498
16528
|
class Fp64Extension extends _deck_gl_core__WEBPACK_IMPORTED_MODULE_0__["LayerExtension"] {
|
|
16499
16529
|
getShaders(opts) {
|
|
16500
|
-
const {
|
|
16501
|
-
|
|
16502
|
-
|
|
16503
|
-
|
|
16504
|
-
) {
|
|
16530
|
+
const {
|
|
16531
|
+
coordinateSystem
|
|
16532
|
+
} = this.props;
|
|
16533
|
+
|
|
16534
|
+
if (coordinateSystem !== _deck_gl_core__WEBPACK_IMPORTED_MODULE_0__["COORDINATE_SYSTEM"].LNGLAT && coordinateSystem !== _deck_gl_core__WEBPACK_IMPORTED_MODULE_0__["COORDINATE_SYSTEM"].DEFAULT) {
|
|
16505
16535
|
throw new Error('fp64: coordinateSystem must be LNGLAT');
|
|
16506
16536
|
}
|
|
16507
16537
|
|
|
@@ -16509,11 +16539,10 @@ class Fp64Extension extends _deck_gl_core__WEBPACK_IMPORTED_MODULE_0__["LayerExt
|
|
|
16509
16539
|
modules: [_project64__WEBPACK_IMPORTED_MODULE_1__["default"]]
|
|
16510
16540
|
};
|
|
16511
16541
|
}
|
|
16512
|
-
}
|
|
16513
16542
|
|
|
16543
|
+
}
|
|
16514
16544
|
Fp64Extension.extensionName = 'Fp64Extension';
|
|
16515
16545
|
|
|
16516
|
-
|
|
16517
16546
|
/***/ }),
|
|
16518
16547
|
|
|
16519
16548
|
/***/ "./src/fp64/project64.glsl.js":
|
|
@@ -16544,7 +16573,6 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
16544
16573
|
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
16545
16574
|
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
16546
16575
|
// THE SOFTWARE.
|
|
16547
|
-
|
|
16548
16576
|
/* harmony default export */ __webpack_exports__["default"] = (`\
|
|
16549
16577
|
|
|
16550
16578
|
const vec2 WORLD_SCALE_FP64 = vec2(81.4873275756836, 0.0000032873668232014097);
|
|
@@ -16627,7 +16655,6 @@ vec4 project_position_to_clipspace(
|
|
|
16627
16655
|
}
|
|
16628
16656
|
`);
|
|
16629
16657
|
|
|
16630
|
-
|
|
16631
16658
|
/***/ }),
|
|
16632
16659
|
|
|
16633
16660
|
/***/ "./src/fp64/project64.js":
|
|
@@ -16663,10 +16690,10 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
16663
16690
|
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
16664
16691
|
// THE SOFTWARE.
|
|
16665
16692
|
|
|
16666
|
-
|
|
16667
|
-
|
|
16668
|
-
|
|
16669
|
-
|
|
16693
|
+
const {
|
|
16694
|
+
fp64ify,
|
|
16695
|
+
fp64ifyMatrix4
|
|
16696
|
+
} = _luma_gl_shadertools__WEBPACK_IMPORTED_MODULE_0__["fp64"];
|
|
16670
16697
|
|
|
16671
16698
|
|
|
16672
16699
|
/* harmony default export */ __webpack_exports__["default"] = ({
|
|
@@ -16674,9 +16701,7 @@ const {fp64ify, fp64ifyMatrix4} = _luma_gl_shadertools__WEBPACK_IMPORTED_MODULE_
|
|
|
16674
16701
|
dependencies: [_deck_gl_core__WEBPACK_IMPORTED_MODULE_1__["project"], _luma_gl_shadertools__WEBPACK_IMPORTED_MODULE_0__["fp64"]],
|
|
16675
16702
|
vs: _project64_glsl__WEBPACK_IMPORTED_MODULE_2__["default"],
|
|
16676
16703
|
getUniforms
|
|
16677
|
-
});
|
|
16678
|
-
|
|
16679
|
-
// TODO - this module should calculate the 64 bit uniforms
|
|
16704
|
+
}); // TODO - this module should calculate the 64 bit uniforms
|
|
16680
16705
|
// It is currently done by project to minimize duplicated work
|
|
16681
16706
|
|
|
16682
16707
|
const DEFAULT_MODULE_OPTIONS = {};
|
|
@@ -16684,17 +16709,26 @@ const getMemoizedUniforms = Object(_deck_gl_core__WEBPACK_IMPORTED_MODULE_1__["_
|
|
|
16684
16709
|
|
|
16685
16710
|
function getUniforms(opts = DEFAULT_MODULE_OPTIONS) {
|
|
16686
16711
|
if (opts.viewport) {
|
|
16687
|
-
const {
|
|
16688
|
-
|
|
16689
|
-
|
|
16712
|
+
const {
|
|
16713
|
+
viewProjectionMatrix,
|
|
16714
|
+
scale
|
|
16715
|
+
} = opts.viewport; // We only need to update fp64 uniforms if fp32 projection is being updated
|
|
16716
|
+
|
|
16717
|
+
return getMemoizedUniforms({
|
|
16718
|
+
viewProjectionMatrix,
|
|
16719
|
+
scale
|
|
16720
|
+
});
|
|
16690
16721
|
}
|
|
16722
|
+
|
|
16691
16723
|
return {};
|
|
16692
16724
|
}
|
|
16693
16725
|
|
|
16694
|
-
function calculateUniforms({
|
|
16726
|
+
function calculateUniforms({
|
|
16727
|
+
viewProjectionMatrix,
|
|
16728
|
+
scale
|
|
16729
|
+
}) {
|
|
16695
16730
|
const glViewProjectionMatrixFP64 = fp64ifyMatrix4(viewProjectionMatrix);
|
|
16696
16731
|
const scaleFP64 = fp64ify(scale);
|
|
16697
|
-
|
|
16698
16732
|
return {
|
|
16699
16733
|
project_uViewProjectionMatrixFP64: glViewProjectionMatrixFP64,
|
|
16700
16734
|
project64_uViewProjectionMatrix: glViewProjectionMatrixFP64,
|
|
@@ -16702,12 +16736,11 @@ function calculateUniforms({viewProjectionMatrix, scale}) {
|
|
|
16702
16736
|
};
|
|
16703
16737
|
}
|
|
16704
16738
|
|
|
16705
|
-
|
|
16706
16739
|
/***/ }),
|
|
16707
16740
|
|
|
16708
|
-
/***/ "./src/index.
|
|
16741
|
+
/***/ "./src/index.ts":
|
|
16709
16742
|
/*!**********************!*\
|
|
16710
|
-
!*** ./src/index.
|
|
16743
|
+
!*** ./src/index.ts ***!
|
|
16711
16744
|
\**********************/
|
|
16712
16745
|
/*! exports provided: BrushingExtension, DataFilterExtension, Fp64Extension, PathStyleExtension, FillStyleExtension, ClipExtension, project64 */
|
|
16713
16746
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
@@ -16740,9 +16773,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
16740
16773
|
|
|
16741
16774
|
|
|
16742
16775
|
|
|
16743
|
-
|
|
16744
|
-
|
|
16745
|
-
// Shader module
|
|
16776
|
+
// Shader module
|
|
16746
16777
|
|
|
16747
16778
|
|
|
16748
16779
|
|
|
@@ -16784,18 +16815,29 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
16784
16815
|
|
|
16785
16816
|
|
|
16786
16817
|
|
|
16787
|
-
|
|
16788
|
-
|
|
16789
16818
|
const defaultProps = {
|
|
16790
|
-
getDashArray: {
|
|
16791
|
-
|
|
16819
|
+
getDashArray: {
|
|
16820
|
+
type: 'accessor',
|
|
16821
|
+
value: [0, 0]
|
|
16822
|
+
},
|
|
16823
|
+
getOffset: {
|
|
16824
|
+
type: 'accessor',
|
|
16825
|
+
value: 0
|
|
16826
|
+
},
|
|
16792
16827
|
dashJustified: false,
|
|
16793
16828
|
dashGapPickable: false
|
|
16794
16829
|
};
|
|
16795
|
-
|
|
16796
16830
|
class PathStyleExtension extends _deck_gl_core__WEBPACK_IMPORTED_MODULE_0__["LayerExtension"] {
|
|
16797
|
-
constructor({
|
|
16798
|
-
|
|
16831
|
+
constructor({
|
|
16832
|
+
dash = false,
|
|
16833
|
+
offset = false,
|
|
16834
|
+
highPrecisionDash = false
|
|
16835
|
+
} = {}) {
|
|
16836
|
+
super({
|
|
16837
|
+
dash: dash || highPrecisionDash,
|
|
16838
|
+
offset,
|
|
16839
|
+
highPrecisionDash
|
|
16840
|
+
});
|
|
16799
16841
|
}
|
|
16800
16842
|
|
|
16801
16843
|
isEnabled(layer) {
|
|
@@ -16805,13 +16847,15 @@ class PathStyleExtension extends _deck_gl_core__WEBPACK_IMPORTED_MODULE_0__["Lay
|
|
|
16805
16847
|
getShaders(extension) {
|
|
16806
16848
|
if (!extension.isEnabled(this)) {
|
|
16807
16849
|
return null;
|
|
16808
|
-
}
|
|
16850
|
+
} // Merge shader injection
|
|
16851
|
+
|
|
16809
16852
|
|
|
16810
|
-
// Merge shader injection
|
|
16811
16853
|
let result = {};
|
|
16854
|
+
|
|
16812
16855
|
if (extension.opts.dash) {
|
|
16813
16856
|
result = Object(_deck_gl_core__WEBPACK_IMPORTED_MODULE_0__["_mergeShaders"])(result, _shaders_glsl__WEBPACK_IMPORTED_MODULE_1__["dashShaders"]);
|
|
16814
16857
|
}
|
|
16858
|
+
|
|
16815
16859
|
if (extension.opts.offset) {
|
|
16816
16860
|
result = Object(_deck_gl_core__WEBPACK_IMPORTED_MODULE_0__["_mergeShaders"])(result, _shaders_glsl__WEBPACK_IMPORTED_MODULE_1__["offsetShaders"]);
|
|
16817
16861
|
}
|
|
@@ -16821,6 +16865,7 @@ class PathStyleExtension extends _deck_gl_core__WEBPACK_IMPORTED_MODULE_0__["Lay
|
|
|
16821
16865
|
|
|
16822
16866
|
initializeState(context, extension) {
|
|
16823
16867
|
const attributeManager = this.getAttributeManager();
|
|
16868
|
+
|
|
16824
16869
|
if (!attributeManager || !extension.isEnabled(this)) {
|
|
16825
16870
|
// This extension only works with the PathLayer
|
|
16826
16871
|
return;
|
|
@@ -16830,9 +16875,13 @@ class PathStyleExtension extends _deck_gl_core__WEBPACK_IMPORTED_MODULE_0__["Lay
|
|
|
16830
16875
|
|
|
16831
16876
|
if (extension.opts.dash) {
|
|
16832
16877
|
attributeManager.addInstanced({
|
|
16833
|
-
instanceDashArrays: {
|
|
16878
|
+
instanceDashArrays: {
|
|
16879
|
+
size: 2,
|
|
16880
|
+
accessor: 'getDashArray'
|
|
16881
|
+
}
|
|
16834
16882
|
});
|
|
16835
16883
|
}
|
|
16884
|
+
|
|
16836
16885
|
if (extension.opts.highPrecisionDash) {
|
|
16837
16886
|
attributeManager.addInstanced({
|
|
16838
16887
|
instanceDashOffsets: {
|
|
@@ -16842,9 +16891,13 @@ class PathStyleExtension extends _deck_gl_core__WEBPACK_IMPORTED_MODULE_0__["Lay
|
|
|
16842
16891
|
}
|
|
16843
16892
|
});
|
|
16844
16893
|
}
|
|
16894
|
+
|
|
16845
16895
|
if (extension.opts.offset) {
|
|
16846
16896
|
attributeManager.addInstanced({
|
|
16847
|
-
instanceOffsets: {
|
|
16897
|
+
instanceOffsets: {
|
|
16898
|
+
size: 1,
|
|
16899
|
+
accessor: 'getOffset'
|
|
16900
|
+
}
|
|
16848
16901
|
});
|
|
16849
16902
|
}
|
|
16850
16903
|
}
|
|
@@ -16869,9 +16922,9 @@ class PathStyleExtension extends _deck_gl_core__WEBPACK_IMPORTED_MODULE_0__["Lay
|
|
|
16869
16922
|
const positionSize = this.props.positionFormat === 'XY' ? 2 : 3;
|
|
16870
16923
|
const isNested = Array.isArray(path[0]);
|
|
16871
16924
|
const geometrySize = isNested ? path.length : path.length / positionSize;
|
|
16872
|
-
|
|
16873
16925
|
let p;
|
|
16874
16926
|
let prevP;
|
|
16927
|
+
|
|
16875
16928
|
for (let i = 0; i < geometrySize - 1; i++) {
|
|
16876
16929
|
p = isNested ? path[i] : path.slice(i * positionSize, i * positionSize + positionSize);
|
|
16877
16930
|
p = this.projectPosition(p);
|
|
@@ -16882,14 +16935,14 @@ class PathStyleExtension extends _deck_gl_core__WEBPACK_IMPORTED_MODULE_0__["Lay
|
|
|
16882
16935
|
|
|
16883
16936
|
prevP = p;
|
|
16884
16937
|
}
|
|
16938
|
+
|
|
16885
16939
|
return result;
|
|
16886
16940
|
}
|
|
16887
|
-
}
|
|
16888
16941
|
|
|
16942
|
+
}
|
|
16889
16943
|
PathStyleExtension.extensionName = 'PathStyleExtension';
|
|
16890
16944
|
PathStyleExtension.defaultProps = defaultProps;
|
|
16891
16945
|
|
|
16892
|
-
|
|
16893
16946
|
/***/ }),
|
|
16894
16947
|
|
|
16895
16948
|
/***/ "./src/path-style/shaders.glsl.js":
|
|
@@ -16911,12 +16964,10 @@ attribute float instanceDashOffsets;
|
|
|
16911
16964
|
varying vec2 vDashArray;
|
|
16912
16965
|
varying float vDashOffset;
|
|
16913
16966
|
`,
|
|
16914
|
-
|
|
16915
16967
|
'vs:#main-end': `
|
|
16916
16968
|
vDashArray = instanceDashArrays;
|
|
16917
16969
|
vDashOffset = instanceDashOffsets / width.x;
|
|
16918
16970
|
`,
|
|
16919
|
-
|
|
16920
16971
|
'fs:#decl': `
|
|
16921
16972
|
uniform float dashAlignMode;
|
|
16922
16973
|
uniform float capType;
|
|
@@ -16928,7 +16979,6 @@ float round(float x) {
|
|
|
16928
16979
|
return floor(x + 0.5);
|
|
16929
16980
|
}
|
|
16930
16981
|
`,
|
|
16931
|
-
|
|
16932
16982
|
// if given position is in the gap part of the dashed line
|
|
16933
16983
|
// dashArray.x: solid stroke length, relative to width
|
|
16934
16984
|
// dashArray.y: gap length, relative to width
|
|
@@ -16976,7 +17026,6 @@ float round(float x) {
|
|
|
16976
17026
|
`
|
|
16977
17027
|
}
|
|
16978
17028
|
};
|
|
16979
|
-
|
|
16980
17029
|
const offsetShaders = {
|
|
16981
17030
|
inject: {
|
|
16982
17031
|
'vs:#decl': `
|
|
@@ -17001,7 +17050,6 @@ attribute float instanceOffsets;
|
|
|
17001
17050
|
}
|
|
17002
17051
|
};
|
|
17003
17052
|
|
|
17004
|
-
|
|
17005
17053
|
/***/ }),
|
|
17006
17054
|
|
|
17007
17055
|
/***/ "@deck.gl/core":
|