@deck.gl/aggregation-layers 9.0.35 → 9.1.0-beta.1
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/common/aggregation-layer.d.ts +30 -0
- package/dist/common/aggregation-layer.d.ts.map +1 -0
- package/dist/common/aggregation-layer.js +69 -0
- package/dist/common/aggregator/aggregator.d.ts +76 -0
- package/dist/common/aggregator/aggregator.d.ts.map +1 -0
- package/dist/common/aggregator/aggregator.js +4 -0
- package/dist/common/aggregator/cpu-aggregator/aggregate.d.ts +27 -0
- package/dist/common/aggregator/cpu-aggregator/aggregate.d.ts.map +1 -0
- package/dist/common/aggregator/cpu-aggregator/aggregate.js +66 -0
- package/dist/common/aggregator/cpu-aggregator/cpu-aggregator.d.ts +70 -0
- package/dist/common/aggregator/cpu-aggregator/cpu-aggregator.d.ts.map +1 -0
- package/dist/common/aggregator/cpu-aggregator/cpu-aggregator.js +139 -0
- package/dist/common/aggregator/cpu-aggregator/sort-bins.d.ts +15 -0
- package/dist/common/aggregator/cpu-aggregator/sort-bins.d.ts.map +1 -0
- package/dist/common/aggregator/cpu-aggregator/sort-bins.js +43 -0
- package/dist/common/aggregator/cpu-aggregator/vertex-accessor.d.ts +21 -0
- package/dist/common/aggregator/cpu-aggregator/vertex-accessor.d.ts.map +1 -0
- package/dist/common/aggregator/cpu-aggregator/vertex-accessor.js +55 -0
- package/dist/common/aggregator/gpu-aggregator/aggregation-transform-uniforms.d.ts +18 -0
- package/dist/common/aggregator/gpu-aggregator/aggregation-transform-uniforms.d.ts.map +1 -0
- package/dist/common/aggregator/gpu-aggregator/aggregation-transform-uniforms.js +20 -0
- package/dist/common/aggregator/gpu-aggregator/bin-sorter-uniforms.d.ts +14 -0
- package/dist/common/aggregator/gpu-aggregator/bin-sorter-uniforms.d.ts.map +1 -0
- package/dist/common/aggregator/gpu-aggregator/bin-sorter-uniforms.js +17 -0
- package/dist/common/aggregator/gpu-aggregator/utils.d.ts +6 -0
- package/dist/common/aggregator/gpu-aggregator/utils.d.ts.map +1 -0
- package/dist/common/aggregator/gpu-aggregator/utils.js +24 -0
- package/dist/common/aggregator/gpu-aggregator/webgl-aggregation-transform.d.ts +24 -0
- package/dist/common/aggregator/gpu-aggregator/webgl-aggregation-transform.d.ts.map +1 -0
- package/dist/common/aggregator/gpu-aggregator/webgl-aggregation-transform.js +215 -0
- package/dist/common/aggregator/gpu-aggregator/webgl-aggregator.d.ts +81 -0
- package/dist/common/aggregator/gpu-aggregator/webgl-aggregator.d.ts.map +1 -0
- package/dist/common/aggregator/gpu-aggregator/webgl-aggregator.js +201 -0
- package/dist/common/aggregator/gpu-aggregator/webgl-bin-sorter.d.ts +38 -0
- package/dist/common/aggregator/gpu-aggregator/webgl-bin-sorter.d.ts.map +1 -0
- package/dist/common/aggregator/gpu-aggregator/webgl-bin-sorter.js +223 -0
- package/dist/common/aggregator/index.d.ts +6 -0
- package/dist/common/aggregator/index.d.ts.map +1 -0
- package/dist/common/aggregator/index.js +5 -0
- package/dist/common/types.d.ts +11 -0
- package/dist/common/types.d.ts.map +1 -0
- package/dist/common/types.js +4 -0
- package/dist/common/utils/bounds-utils.d.ts +10 -0
- package/dist/common/utils/bounds-utils.d.ts.map +1 -0
- package/dist/common/utils/bounds-utils.js +20 -0
- package/dist/common/utils/color-utils.d.ts +10 -0
- package/dist/common/utils/color-utils.d.ts.map +1 -0
- package/dist/common/utils/color-utils.js +65 -0
- package/dist/common/utils/prop-utils.d.ts.map +1 -0
- package/dist/common/utils/prop-utils.js +12 -0
- package/dist/common/utils/scale-utils.d.ts +46 -0
- package/dist/common/utils/scale-utils.d.ts.map +1 -0
- package/dist/common/utils/scale-utils.js +180 -0
- package/dist/contour-layer/bin-options-uniforms.d.ts +13 -0
- package/dist/contour-layer/bin-options-uniforms.d.ts.map +1 -0
- package/dist/contour-layer/bin-options-uniforms.js +17 -0
- package/dist/contour-layer/contour-layer.d.ts +42 -50
- package/dist/contour-layer/contour-layer.d.ts.map +1 -1
- package/dist/contour-layer/contour-layer.js +232 -192
- package/dist/contour-layer/contour-utils.d.ts +36 -15
- package/dist/contour-layer/contour-utils.d.ts.map +1 -1
- package/dist/contour-layer/contour-utils.js +24 -29
- package/dist/contour-layer/marching-squares-codes.d.ts.map +1 -1
- package/dist/contour-layer/marching-squares-codes.js +3 -0
- package/dist/contour-layer/marching-squares.d.ts +22 -6
- package/dist/contour-layer/marching-squares.d.ts.map +1 -1
- package/dist/contour-layer/marching-squares.js +71 -68
- package/dist/contour-layer/value-reader.d.ts +10 -0
- package/dist/contour-layer/value-reader.d.ts.map +1 -0
- package/dist/contour-layer/value-reader.js +46 -0
- package/dist/dist.dev.js +4842 -4081
- package/dist/grid-layer/bin-options-uniforms.d.ts +13 -0
- package/dist/grid-layer/bin-options-uniforms.d.ts.map +1 -0
- package/dist/grid-layer/bin-options-uniforms.js +17 -0
- package/dist/grid-layer/grid-cell-layer-vertex.glsl.d.ts +3 -0
- package/dist/grid-layer/grid-cell-layer-vertex.glsl.d.ts.map +1 -0
- package/dist/grid-layer/grid-cell-layer-vertex.glsl.js +51 -0
- package/dist/grid-layer/grid-cell-layer.d.ts +32 -0
- package/dist/grid-layer/grid-cell-layer.d.ts.map +1 -0
- package/dist/grid-layer/grid-cell-layer.js +93 -0
- package/dist/grid-layer/grid-layer-uniforms.d.ts +21 -0
- package/dist/grid-layer/grid-layer-uniforms.d.ts.map +1 -0
- package/dist/grid-layer/grid-layer-uniforms.js +23 -0
- package/dist/grid-layer/grid-layer.d.ts +175 -13
- package/dist/grid-layer/grid-layer.d.ts.map +1 -1
- package/dist/grid-layer/grid-layer.js +342 -46
- package/dist/{aggregation-layer.d.ts → heatmap-layer/aggregation-layer.d.ts} +1 -0
- package/dist/heatmap-layer/aggregation-layer.d.ts.map +1 -0
- package/dist/{aggregation-layer.js → heatmap-layer/aggregation-layer.js} +6 -21
- package/dist/heatmap-layer/heatmap-layer-uniforms.d.ts +30 -0
- package/dist/heatmap-layer/heatmap-layer-uniforms.d.ts.map +1 -0
- package/dist/heatmap-layer/heatmap-layer-uniforms.js +32 -0
- package/dist/heatmap-layer/heatmap-layer-utils.d.ts +1 -1
- package/dist/heatmap-layer/heatmap-layer-utils.d.ts.map +1 -1
- package/dist/heatmap-layer/heatmap-layer-utils.js +3 -0
- package/dist/heatmap-layer/heatmap-layer.d.ts +6 -4
- package/dist/heatmap-layer/heatmap-layer.d.ts.map +1 -1
- package/dist/heatmap-layer/heatmap-layer.js +43 -33
- package/dist/heatmap-layer/max-fs.glsl.d.ts.map +1 -1
- package/dist/heatmap-layer/max-fs.glsl.js +3 -0
- package/dist/heatmap-layer/max-vs.glsl.d.ts +1 -1
- package/dist/heatmap-layer/max-vs.glsl.d.ts.map +1 -1
- package/dist/heatmap-layer/max-vs.glsl.js +6 -4
- package/dist/heatmap-layer/triangle-layer-fragment.glsl.d.ts +1 -1
- package/dist/heatmap-layer/triangle-layer-fragment.glsl.d.ts.map +1 -1
- package/dist/heatmap-layer/triangle-layer-fragment.glsl.js +5 -23
- package/dist/heatmap-layer/triangle-layer-uniforms.d.ts +22 -0
- package/dist/heatmap-layer/triangle-layer-uniforms.d.ts.map +1 -0
- package/dist/heatmap-layer/triangle-layer-uniforms.js +22 -0
- package/dist/heatmap-layer/triangle-layer-vertex.glsl.d.ts +1 -1
- package/dist/heatmap-layer/triangle-layer-vertex.glsl.d.ts.map +1 -1
- package/dist/heatmap-layer/triangle-layer-vertex.glsl.js +10 -30
- package/dist/heatmap-layer/triangle-layer.d.ts +4 -10
- package/dist/heatmap-layer/triangle-layer.d.ts.map +1 -1
- package/dist/heatmap-layer/triangle-layer.js +17 -30
- package/dist/heatmap-layer/weights-fs.glsl.d.ts.map +1 -1
- package/dist/heatmap-layer/weights-fs.glsl.js +3 -0
- package/dist/heatmap-layer/weights-vs.glsl.d.ts +1 -1
- package/dist/heatmap-layer/weights-vs.glsl.d.ts.map +1 -1
- package/dist/heatmap-layer/weights-vs.glsl.js +6 -7
- package/dist/hexagon-layer/bin-options-uniforms.d.ts +14 -0
- package/dist/hexagon-layer/bin-options-uniforms.d.ts.map +1 -0
- package/dist/hexagon-layer/bin-options-uniforms.js +17 -0
- package/dist/hexagon-layer/hexagon-cell-layer-vertex.glsl.d.ts +3 -0
- package/dist/hexagon-layer/hexagon-cell-layer-vertex.glsl.d.ts.map +1 -0
- package/dist/hexagon-layer/hexagon-cell-layer-vertex.glsl.js +55 -0
- package/dist/hexagon-layer/hexagon-cell-layer.d.ts +29 -0
- package/dist/hexagon-layer/hexagon-cell-layer.d.ts.map +1 -0
- package/dist/hexagon-layer/hexagon-cell-layer.js +94 -0
- package/dist/hexagon-layer/hexagon-layer-uniforms.d.ts +19 -0
- package/dist/hexagon-layer/hexagon-layer-uniforms.d.ts.map +1 -0
- package/dist/hexagon-layer/hexagon-layer-uniforms.js +21 -0
- package/dist/hexagon-layer/hexagon-layer.d.ts +84 -54
- package/dist/hexagon-layer/hexagon-layer.d.ts.map +1 -1
- package/dist/hexagon-layer/hexagon-layer.js +307 -123
- package/dist/hexagon-layer/hexbin.d.ts +17 -0
- package/dist/hexagon-layer/hexbin.d.ts.map +1 -0
- package/dist/hexagon-layer/hexbin.js +69 -0
- package/dist/index.cjs +3025 -2946
- package/dist/index.cjs.map +4 -4
- package/dist/index.d.ts +7 -13
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -27
- package/dist/screen-grid-layer/bin-options-uniforms.d.ts +11 -0
- package/dist/screen-grid-layer/bin-options-uniforms.d.ts.map +1 -0
- package/dist/screen-grid-layer/bin-options-uniforms.js +15 -0
- package/dist/screen-grid-layer/screen-grid-cell-layer.d.ts +11 -16
- package/dist/screen-grid-layer/screen-grid-cell-layer.d.ts.map +1 -1
- package/dist/screen-grid-layer/screen-grid-cell-layer.js +52 -134
- package/dist/screen-grid-layer/screen-grid-layer-fragment.glsl.d.ts +1 -1
- package/dist/screen-grid-layer/screen-grid-layer-fragment.glsl.d.ts.map +1 -1
- package/dist/screen-grid-layer/screen-grid-layer-fragment.glsl.js +4 -24
- package/dist/screen-grid-layer/screen-grid-layer-uniforms.d.ts +17 -0
- package/dist/screen-grid-layer/screen-grid-layer-uniforms.d.ts.map +1 -0
- package/dist/screen-grid-layer/screen-grid-layer-uniforms.js +19 -0
- package/dist/screen-grid-layer/screen-grid-layer-vertex.glsl.d.ts +1 -1
- package/dist/screen-grid-layer/screen-grid-layer-vertex.glsl.d.ts.map +1 -1
- package/dist/screen-grid-layer/screen-grid-layer-vertex.glsl.js +21 -62
- package/dist/screen-grid-layer/screen-grid-layer.d.ts +33 -40
- package/dist/screen-grid-layer/screen-grid-layer.d.ts.map +1 -1
- package/dist/screen-grid-layer/screen-grid-layer.js +157 -174
- package/dist.min.js +401 -382
- package/package.json +10 -9
- package/src/common/aggregation-layer.ts +107 -0
- package/src/common/aggregator/aggregator.ts +88 -0
- package/src/common/aggregator/cpu-aggregator/aggregate.ts +101 -0
- package/src/common/aggregator/cpu-aggregator/cpu-aggregator.ts +203 -0
- package/src/common/aggregator/cpu-aggregator/sort-bins.ts +63 -0
- package/src/common/aggregator/cpu-aggregator/vertex-accessor.ts +86 -0
- package/src/common/aggregator/gpu-aggregator/aggregation-transform-uniforms.ts +33 -0
- package/src/common/aggregator/gpu-aggregator/bin-sorter-uniforms.ts +27 -0
- package/src/common/aggregator/gpu-aggregator/utils.ts +27 -0
- package/src/common/aggregator/gpu-aggregator/webgl-aggregation-transform.ts +247 -0
- package/src/common/aggregator/gpu-aggregator/webgl-aggregator.ts +274 -0
- package/src/common/aggregator/gpu-aggregator/webgl-bin-sorter.ts +258 -0
- package/src/common/aggregator/index.ts +10 -0
- package/src/{types.ts → common/types.ts} +10 -4
- package/src/common/utils/bounds-utils.ts +34 -0
- package/src/common/utils/color-utils.ts +86 -0
- package/src/common/utils/prop-utils.ts +13 -0
- package/src/common/utils/scale-utils.ts +236 -0
- package/src/contour-layer/bin-options-uniforms.ts +26 -0
- package/src/contour-layer/contour-layer.ts +300 -265
- package/src/contour-layer/contour-utils.ts +68 -39
- package/src/contour-layer/marching-squares-codes.ts +4 -0
- package/src/contour-layer/marching-squares.ts +93 -82
- package/src/contour-layer/value-reader.ts +65 -0
- package/src/grid-layer/bin-options-uniforms.ts +26 -0
- package/src/grid-layer/grid-cell-layer-vertex.glsl.ts +68 -0
- package/src/grid-layer/grid-cell-layer.ts +141 -0
- package/src/grid-layer/grid-layer-uniforms.ts +37 -0
- package/src/grid-layer/grid-layer.ts +614 -73
- package/src/{aggregation-layer.ts → heatmap-layer/aggregation-layer.ts} +6 -21
- package/src/heatmap-layer/heatmap-layer-uniforms.ts +50 -0
- package/src/heatmap-layer/heatmap-layer-utils.ts +9 -1
- package/src/heatmap-layer/heatmap-layer.ts +59 -36
- package/src/heatmap-layer/max-fs.glsl.ts +4 -0
- package/src/heatmap-layer/max-vs.glsl.ts +7 -4
- package/src/heatmap-layer/triangle-layer-fragment.glsl.ts +5 -23
- package/src/heatmap-layer/triangle-layer-uniforms.ts +37 -0
- package/src/heatmap-layer/triangle-layer-vertex.glsl.ts +10 -30
- package/src/heatmap-layer/triangle-layer.ts +26 -31
- package/src/heatmap-layer/weights-fs.glsl.ts +4 -0
- package/src/heatmap-layer/weights-vs.glsl.ts +7 -7
- package/src/hexagon-layer/bin-options-uniforms.ts +27 -0
- package/src/hexagon-layer/hexagon-cell-layer-vertex.glsl.ts +73 -0
- package/src/hexagon-layer/hexagon-cell-layer.ts +141 -0
- package/src/hexagon-layer/hexagon-layer-uniforms.ts +34 -0
- package/src/hexagon-layer/hexagon-layer.ts +454 -186
- package/src/hexagon-layer/hexbin.ts +79 -0
- package/src/index.ts +21 -34
- package/src/screen-grid-layer/bin-options-uniforms.ts +23 -0
- package/src/screen-grid-layer/screen-grid-cell-layer.ts +71 -156
- package/src/screen-grid-layer/screen-grid-layer-fragment.glsl.ts +4 -24
- package/src/screen-grid-layer/screen-grid-layer-uniforms.ts +31 -0
- package/src/screen-grid-layer/screen-grid-layer-vertex.glsl.ts +21 -64
- package/src/screen-grid-layer/screen-grid-layer.ts +194 -222
- package/dist/aggregation-layer.d.ts.map +0 -1
- package/dist/cpu-grid-layer/cpu-grid-layer.d.ts +0 -158
- package/dist/cpu-grid-layer/cpu-grid-layer.d.ts.map +0 -1
- package/dist/cpu-grid-layer/cpu-grid-layer.js +0 -130
- package/dist/cpu-grid-layer/grid-aggregator.d.ts +0 -35
- package/dist/cpu-grid-layer/grid-aggregator.d.ts.map +0 -1
- package/dist/cpu-grid-layer/grid-aggregator.js +0 -141
- package/dist/gpu-grid-layer/gpu-grid-cell-layer-fragment.glsl.d.ts +0 -3
- package/dist/gpu-grid-layer/gpu-grid-cell-layer-fragment.glsl.d.ts.map +0 -1
- package/dist/gpu-grid-layer/gpu-grid-cell-layer-fragment.glsl.js +0 -30
- package/dist/gpu-grid-layer/gpu-grid-cell-layer-vertex.glsl.d.ts +0 -3
- package/dist/gpu-grid-layer/gpu-grid-cell-layer-vertex.glsl.d.ts.map +0 -1
- package/dist/gpu-grid-layer/gpu-grid-cell-layer-vertex.glsl.js +0 -112
- package/dist/gpu-grid-layer/gpu-grid-cell-layer.d.ts +0 -48
- package/dist/gpu-grid-layer/gpu-grid-cell-layer.d.ts.map +0 -1
- package/dist/gpu-grid-layer/gpu-grid-cell-layer.js +0 -146
- package/dist/gpu-grid-layer/gpu-grid-layer.d.ts +0 -99
- package/dist/gpu-grid-layer/gpu-grid-layer.d.ts.map +0 -1
- package/dist/gpu-grid-layer/gpu-grid-layer.js +0 -289
- package/dist/grid-aggregation-layer.d.ts +0 -67
- package/dist/grid-aggregation-layer.d.ts.map +0 -1
- package/dist/grid-aggregation-layer.js +0 -173
- package/dist/hexagon-layer/hexagon-aggregator.d.ts +0 -27
- package/dist/hexagon-layer/hexagon-aggregator.d.ts.map +0 -1
- package/dist/hexagon-layer/hexagon-aggregator.js +0 -112
- package/dist/types.d.ts +0 -12
- package/dist/types.d.ts.map +0 -1
- package/dist/types.js +0 -1
- package/dist/utils/aggregation-operation-utils.d.ts +0 -19
- package/dist/utils/aggregation-operation-utils.d.ts.map +0 -1
- package/dist/utils/aggregation-operation-utils.js +0 -94
- package/dist/utils/bin-sorter.d.ts +0 -52
- package/dist/utils/bin-sorter.d.ts.map +0 -1
- package/dist/utils/bin-sorter.js +0 -167
- package/dist/utils/color-utils.d.ts +0 -3
- package/dist/utils/color-utils.d.ts.map +0 -1
- package/dist/utils/color-utils.js +0 -53
- package/dist/utils/cpu-aggregator.d.ts +0 -169
- package/dist/utils/cpu-aggregator.d.ts.map +0 -1
- package/dist/utils/cpu-aggregator.js +0 -421
- package/dist/utils/gpu-grid-aggregation/aggregate-all-fs.glsl.d.ts +0 -3
- package/dist/utils/gpu-grid-aggregation/aggregate-all-fs.glsl.d.ts.map +0 -1
- package/dist/utils/gpu-grid-aggregation/aggregate-all-fs.glsl.js +0 -36
- package/dist/utils/gpu-grid-aggregation/aggregate-all-vs.glsl.d.ts +0 -3
- package/dist/utils/gpu-grid-aggregation/aggregate-all-vs.glsl.d.ts.map +0 -1
- package/dist/utils/gpu-grid-aggregation/aggregate-all-vs.glsl.js +0 -42
- package/dist/utils/gpu-grid-aggregation/aggregate-to-grid-fs.glsl.d.ts +0 -3
- package/dist/utils/gpu-grid-aggregation/aggregate-to-grid-fs.glsl.d.ts.map +0 -1
- package/dist/utils/gpu-grid-aggregation/aggregate-to-grid-fs.glsl.js +0 -30
- package/dist/utils/gpu-grid-aggregation/aggregate-to-grid-vs.glsl.d.ts +0 -3
- package/dist/utils/gpu-grid-aggregation/aggregate-to-grid-vs.glsl.d.ts.map +0 -1
- package/dist/utils/gpu-grid-aggregation/aggregate-to-grid-vs.glsl.js +0 -61
- package/dist/utils/gpu-grid-aggregation/gpu-grid-aggregator-constants.d.ts +0 -38
- package/dist/utils/gpu-grid-aggregation/gpu-grid-aggregator-constants.d.ts.map +0 -1
- package/dist/utils/gpu-grid-aggregation/gpu-grid-aggregator-constants.js +0 -41
- package/dist/utils/gpu-grid-aggregation/gpu-grid-aggregator-utils.d.ts +0 -1
- package/dist/utils/gpu-grid-aggregation/gpu-grid-aggregator-utils.d.ts.map +0 -1
- package/dist/utils/gpu-grid-aggregation/gpu-grid-aggregator-utils.js +0 -1
- package/dist/utils/gpu-grid-aggregation/gpu-grid-aggregator.d.ts +0 -76
- package/dist/utils/gpu-grid-aggregation/gpu-grid-aggregator.d.ts.map +0 -1
- package/dist/utils/gpu-grid-aggregation/gpu-grid-aggregator.js +0 -555
- package/dist/utils/gpu-grid-aggregation/transform-mean-vs.glsl.d.ts +0 -3
- package/dist/utils/gpu-grid-aggregation/transform-mean-vs.glsl.d.ts.map +0 -1
- package/dist/utils/gpu-grid-aggregation/transform-mean-vs.glsl.js +0 -32
- package/dist/utils/grid-aggregation-utils.d.ts +0 -30
- package/dist/utils/grid-aggregation-utils.d.ts.map +0 -1
- package/dist/utils/grid-aggregation-utils.js +0 -114
- package/dist/utils/prop-utils.d.ts.map +0 -1
- package/dist/utils/prop-utils.js +0 -28
- package/dist/utils/resource-utils.d.ts +0 -14
- package/dist/utils/resource-utils.d.ts.map +0 -1
- package/dist/utils/resource-utils.js +0 -38
- package/dist/utils/scale-utils.d.ts +0 -15
- package/dist/utils/scale-utils.d.ts.map +0 -1
- package/dist/utils/scale-utils.js +0 -184
- package/src/cpu-grid-layer/cpu-grid-layer.ts +0 -329
- package/src/cpu-grid-layer/grid-aggregator.ts +0 -184
- package/src/gpu-grid-layer/gpu-grid-cell-layer-fragment.glsl.ts +0 -35
- package/src/gpu-grid-layer/gpu-grid-cell-layer-vertex.glsl.ts +0 -143
- package/src/gpu-grid-layer/gpu-grid-cell-layer.ts +0 -201
- package/src/gpu-grid-layer/gpu-grid-layer.ts +0 -455
- package/src/grid-aggregation-layer.ts +0 -243
- package/src/hexagon-layer/hexagon-aggregator.ts +0 -127
- package/src/utils/aggregation-operation-utils.ts +0 -118
- package/src/utils/bin-sorter.ts +0 -218
- package/src/utils/color-utils.ts +0 -57
- package/src/utils/cpu-aggregator.ts +0 -503
- package/src/utils/gpu-grid-aggregation/aggregate-all-fs.glsl.ts +0 -40
- package/src/utils/gpu-grid-aggregation/aggregate-all-vs.glsl.ts +0 -54
- package/src/utils/gpu-grid-aggregation/aggregate-to-grid-fs.glsl.ts +0 -35
- package/src/utils/gpu-grid-aggregation/aggregate-to-grid-vs.glsl.ts +0 -79
- package/src/utils/gpu-grid-aggregation/gpu-grid-aggregator-constants.ts +0 -46
- package/src/utils/gpu-grid-aggregation/gpu-grid-aggregator-utils.ts +0 -0
- package/src/utils/gpu-grid-aggregation/gpu-grid-aggregator.md +0 -155
- package/src/utils/gpu-grid-aggregation/gpu-grid-aggregator.ts +0 -690
- package/src/utils/gpu-grid-aggregation/transform-mean-vs.glsl.ts +0 -38
- package/src/utils/grid-aggregation-utils.ts +0 -147
- package/src/utils/prop-utils.ts +0 -29
- package/src/utils/resource-utils.ts +0 -53
- package/src/utils/scale-utils.js +0 -219
- /package/dist/{utils → common/utils}/prop-utils.d.ts +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"color-utils.d.ts","sourceRoot":"","sources":["../../src/utils/color-utils.ts"],"names":[],"mappings":"AAoBA,eAAO,MAAM,iBAAiB,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAOvD,CAAC;AAGF,wBAAgB,qBAAqB,CAAC,UAAU,KAAA,EAAE,SAAS,UAAQ,EAAE,SAAS,0BAAe,OA0B5F"}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
// Copyright (c) 2015 - 2017 Uber Technologies, Inc.
|
|
2
|
-
//
|
|
3
|
-
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
4
|
-
// of this software and associated documentation files (the "Software"), to deal
|
|
5
|
-
// in the Software without restriction, including without limitation the rights
|
|
6
|
-
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
7
|
-
// copies of the Software, and to permit persons to whom the Software is
|
|
8
|
-
// furnished to do so, subject to the following conditions:
|
|
9
|
-
//
|
|
10
|
-
// The above copyright notice and this permission notice shall be included in
|
|
11
|
-
// all copies or substantial portions of the Software.
|
|
12
|
-
//
|
|
13
|
-
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
14
|
-
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
15
|
-
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
16
|
-
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
17
|
-
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
18
|
-
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
19
|
-
// THE SOFTWARE.
|
|
20
|
-
export const defaultColorRange = [
|
|
21
|
-
[255, 255, 178],
|
|
22
|
-
[254, 217, 118],
|
|
23
|
-
[254, 178, 76],
|
|
24
|
-
[253, 141, 60],
|
|
25
|
-
[240, 59, 32],
|
|
26
|
-
[189, 0, 38]
|
|
27
|
-
];
|
|
28
|
-
// Converts a colorRange array to a flat array with 4 components per color
|
|
29
|
-
export function colorRangeToFlatArray(colorRange, normalize = false, ArrayType = Float32Array) {
|
|
30
|
-
let flatArray;
|
|
31
|
-
if (Number.isFinite(colorRange[0])) {
|
|
32
|
-
// its already a flat array.
|
|
33
|
-
flatArray = new ArrayType(colorRange);
|
|
34
|
-
}
|
|
35
|
-
else {
|
|
36
|
-
// flatten it
|
|
37
|
-
flatArray = new ArrayType(colorRange.length * 4);
|
|
38
|
-
let index = 0;
|
|
39
|
-
for (let i = 0; i < colorRange.length; i++) {
|
|
40
|
-
const color = colorRange[i];
|
|
41
|
-
flatArray[index++] = color[0];
|
|
42
|
-
flatArray[index++] = color[1];
|
|
43
|
-
flatArray[index++] = color[2];
|
|
44
|
-
flatArray[index++] = Number.isFinite(color[3]) ? color[3] : 255;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
if (normalize) {
|
|
48
|
-
for (let i = 0; i < flatArray.length; i++) {
|
|
49
|
-
flatArray[i] /= 255;
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
return flatArray;
|
|
53
|
-
}
|
|
@@ -1,169 +0,0 @@
|
|
|
1
|
-
export default class CPUAggregator {
|
|
2
|
-
state: {
|
|
3
|
-
layerData: {
|
|
4
|
-
data?: any[];
|
|
5
|
-
};
|
|
6
|
-
dimensions: Record<string, any>;
|
|
7
|
-
};
|
|
8
|
-
changeFlags: Record<string, any>;
|
|
9
|
-
dimensionUpdaters: Record<string, any>;
|
|
10
|
-
_getCellSize: any;
|
|
11
|
-
_getAggregator: any;
|
|
12
|
-
constructor(opts: any);
|
|
13
|
-
static defaultDimensions(): ({
|
|
14
|
-
key: string;
|
|
15
|
-
accessor: string;
|
|
16
|
-
pickingInfo: string;
|
|
17
|
-
getBins: {
|
|
18
|
-
triggers: {
|
|
19
|
-
value: {
|
|
20
|
-
prop: string;
|
|
21
|
-
updateTrigger: string;
|
|
22
|
-
};
|
|
23
|
-
weight: {
|
|
24
|
-
prop: string;
|
|
25
|
-
updateTrigger: string;
|
|
26
|
-
};
|
|
27
|
-
aggregation: {
|
|
28
|
-
prop: string;
|
|
29
|
-
};
|
|
30
|
-
filterData: {
|
|
31
|
-
prop: string;
|
|
32
|
-
updateTrigger: string;
|
|
33
|
-
};
|
|
34
|
-
};
|
|
35
|
-
};
|
|
36
|
-
getDomain: {
|
|
37
|
-
triggers: {
|
|
38
|
-
lowerPercentile: {
|
|
39
|
-
prop: string;
|
|
40
|
-
};
|
|
41
|
-
upperPercentile: {
|
|
42
|
-
prop: string;
|
|
43
|
-
};
|
|
44
|
-
scaleType: {
|
|
45
|
-
prop: string;
|
|
46
|
-
};
|
|
47
|
-
};
|
|
48
|
-
};
|
|
49
|
-
getScaleFunc: {
|
|
50
|
-
triggers: {
|
|
51
|
-
domain: {
|
|
52
|
-
prop: string;
|
|
53
|
-
};
|
|
54
|
-
range: {
|
|
55
|
-
prop: string;
|
|
56
|
-
};
|
|
57
|
-
};
|
|
58
|
-
onSet: {
|
|
59
|
-
props: string;
|
|
60
|
-
};
|
|
61
|
-
};
|
|
62
|
-
nullValue: number[];
|
|
63
|
-
} | {
|
|
64
|
-
key: string;
|
|
65
|
-
accessor: string;
|
|
66
|
-
pickingInfo: string;
|
|
67
|
-
getBins: {
|
|
68
|
-
triggers: {
|
|
69
|
-
value: {
|
|
70
|
-
prop: string;
|
|
71
|
-
updateTrigger: string;
|
|
72
|
-
};
|
|
73
|
-
weight: {
|
|
74
|
-
prop: string;
|
|
75
|
-
updateTrigger: string;
|
|
76
|
-
};
|
|
77
|
-
aggregation: {
|
|
78
|
-
prop: string;
|
|
79
|
-
};
|
|
80
|
-
filterData: {
|
|
81
|
-
prop: string;
|
|
82
|
-
updateTrigger: string;
|
|
83
|
-
};
|
|
84
|
-
};
|
|
85
|
-
};
|
|
86
|
-
getDomain: {
|
|
87
|
-
triggers: {
|
|
88
|
-
lowerPercentile: {
|
|
89
|
-
prop: string;
|
|
90
|
-
};
|
|
91
|
-
upperPercentile: {
|
|
92
|
-
prop: string;
|
|
93
|
-
};
|
|
94
|
-
scaleType: {
|
|
95
|
-
prop: string;
|
|
96
|
-
};
|
|
97
|
-
};
|
|
98
|
-
};
|
|
99
|
-
getScaleFunc: {
|
|
100
|
-
triggers: {
|
|
101
|
-
domain: {
|
|
102
|
-
prop: string;
|
|
103
|
-
};
|
|
104
|
-
range: {
|
|
105
|
-
prop: string;
|
|
106
|
-
};
|
|
107
|
-
};
|
|
108
|
-
onSet: {
|
|
109
|
-
props: string;
|
|
110
|
-
};
|
|
111
|
-
};
|
|
112
|
-
nullValue: number;
|
|
113
|
-
})[];
|
|
114
|
-
updateState(opts: any, aggregationParams: any): {
|
|
115
|
-
layerData: {
|
|
116
|
-
data?: any[] | undefined;
|
|
117
|
-
};
|
|
118
|
-
dimensions: Record<string, any>;
|
|
119
|
-
};
|
|
120
|
-
setState(updateObject: any): void;
|
|
121
|
-
setDimensionState(key: any, updateObject: any): void;
|
|
122
|
-
normalizeResult(result?: {
|
|
123
|
-
hexagons?: any;
|
|
124
|
-
layerData?: any;
|
|
125
|
-
}): {
|
|
126
|
-
hexagons?: any;
|
|
127
|
-
layerData?: any;
|
|
128
|
-
} | {
|
|
129
|
-
hexagons?: any;
|
|
130
|
-
layerData?: any;
|
|
131
|
-
data: any;
|
|
132
|
-
};
|
|
133
|
-
getAggregatedData(props: any, aggregationParams: any): void;
|
|
134
|
-
updateGetValueFuncs(oldProps: any, props: any, changeFlags: any): void;
|
|
135
|
-
needsReProjectPoints(oldProps: any, props: any, changeFlags: any): any;
|
|
136
|
-
addDimension(dimensions: any): void;
|
|
137
|
-
_addDimension(dimensions?: never[]): void;
|
|
138
|
-
getDimensionUpdaters({ key, accessor, pickingInfo, getBins, getDomain, getScaleFunc, nullValue }: {
|
|
139
|
-
key: any;
|
|
140
|
-
accessor: any;
|
|
141
|
-
pickingInfo: any;
|
|
142
|
-
getBins: any;
|
|
143
|
-
getDomain: any;
|
|
144
|
-
getScaleFunc: any;
|
|
145
|
-
nullValue: any;
|
|
146
|
-
}): {
|
|
147
|
-
key: any;
|
|
148
|
-
accessor: any;
|
|
149
|
-
pickingInfo: any;
|
|
150
|
-
getBins: any;
|
|
151
|
-
getDomain: any;
|
|
152
|
-
getScaleFunc: any;
|
|
153
|
-
attributeAccessor: (cell: any) => any;
|
|
154
|
-
};
|
|
155
|
-
needUpdateDimensionStep(dimensionStep: any, oldProps: any, props: any, changeFlags: any): boolean;
|
|
156
|
-
getDimensionChanges(oldProps: any, props: any, changeFlags: any): Function[] | null;
|
|
157
|
-
getUpdateTriggers(props: any): {};
|
|
158
|
-
getSortedBins(props: any): void;
|
|
159
|
-
getDimensionSortedBins(props: any, dimensionUpdater: any): void;
|
|
160
|
-
getDimensionValueDomain(props: any, dimensionUpdater: any): void;
|
|
161
|
-
getDimensionScale(props: any, dimensionUpdater: any): void;
|
|
162
|
-
getSubLayerDimensionAttribute(key: any, nullValue: any): (cell: any) => any;
|
|
163
|
-
getSubLayerAccessors(props: any): {};
|
|
164
|
-
getPickingInfo({ info }: {
|
|
165
|
-
info: any;
|
|
166
|
-
}): any;
|
|
167
|
-
getAccessor(dimensionKey: any): any;
|
|
168
|
-
}
|
|
169
|
-
//# sourceMappingURL=cpu-aggregator.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cpu-aggregator.d.ts","sourceRoot":"","sources":["../../src/utils/cpu-aggregator.ts"],"names":[],"mappings":"AA4HA,MAAM,CAAC,OAAO,OAAO,aAAa;IAChC,KAAK,EAAE;QACL,SAAS,EAAE;YACT,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;SACd,CAAC;QACF,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;KACjC,CAkBC;IACF,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAM;IACtC,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAM;IAE5C,YAAY,MAAC;IACb,cAAc,MAAC;gBAEH,IAAI,KAAA;IAMhB,MAAM,CAAC,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAIxB,WAAW,CAAC,IAAI,KAAA,EAAE,iBAAiB,KAAA;;;;;;IAqBnC,QAAQ,CAAC,YAAY,KAAA;IAKrB,iBAAiB,CAAC,GAAG,KAAA,EAAE,YAAY,KAAA;IASnC,eAAe,CAAC,MAAM,GAAE;QAAC,QAAQ,CAAC,MAAC;QAAC,SAAS,CAAC,MAAA;KAAM;;;;;;;;IAWpD,iBAAiB,CAAC,KAAK,KAAA,EAAE,iBAAiB,KAAA;IAa1C,mBAAmB,CAAC,QAAQ,KAAA,EAAE,KAAK,KAAA,EAAE,WAAW,KAAA;IA0BhD,oBAAoB,CAAC,QAAQ,KAAA,EAAE,KAAK,KAAA,EAAE,WAAW,KAAA;IAUjD,YAAY,CAAC,UAAU,KAAA;IAIvB,aAAa,CAAC,UAAU,UAAK;IAa7B,oBAAoB,CAAC,EAAC,GAAG,EAAE,QAAQ,EAAE,WAAW,EAAE,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,SAAS,EAAC;;;;;;;;KAAA;;;;;;;;;IAY9F,uBAAuB,CAAC,aAAa,KAAA,EAAE,QAAQ,KAAA,EAAE,KAAK,KAAA,EAAE,WAAW,KAAA;IAkCnE,mBAAmB,CAAC,QAAQ,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,WAAW,EAAE,GAAG,GAAG,QAAQ,EAAE,GAAG,IAAI;IA8BnF,iBAAiB,CAAC,KAAK,KAAA;IAmCvB,aAAa,CAAC,KAAK,KAAA;IAMnB,sBAAsB,CAAC,KAAK,KAAA,EAAE,gBAAgB,KAAA;IAY9C,uBAAuB,CAAC,KAAK,KAAA,EAAE,gBAAgB,KAAA;IAc/C,iBAAiB,CAAC,KAAK,KAAA,EAAE,gBAAgB,KAAA;IAiBzC,6BAA6B,CAAC,GAAG,KAAA,EAAE,SAAS,KAAA;IAmB5C,oBAAoB,CAAC,KAAK,KAAA;IAU1B,cAAc,CAAC,EAAC,IAAI,EAAC;;KAAA;IA8BrB,WAAW,CAAC,YAAY,KAAA;CAMzB"}
|
|
@@ -1,421 +0,0 @@
|
|
|
1
|
-
// Copyright (c) 2015 - 2018 Uber Technologies, Inc.
|
|
2
|
-
//
|
|
3
|
-
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
4
|
-
// of this software and associated documentation files (the "Software"), to deal
|
|
5
|
-
// in the Software without restriction, including without limitation the rights
|
|
6
|
-
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
7
|
-
// copies of the Software, and to permit persons to whom the Software is
|
|
8
|
-
// furnished to do so, subject to the following conditions:
|
|
9
|
-
//
|
|
10
|
-
// The above copyright notice and this permission notice shall be included in
|
|
11
|
-
// all copies or substantial portions of the Software.
|
|
12
|
-
//
|
|
13
|
-
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
14
|
-
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
15
|
-
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
16
|
-
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
17
|
-
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
18
|
-
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
19
|
-
// THE SOFTWARE.
|
|
20
|
-
import BinSorter from "./bin-sorter.js";
|
|
21
|
-
import { getScaleFunctionByScaleType } from "./scale-utils.js";
|
|
22
|
-
import { getValueFunc, wrapGetValueFunc } from "./aggregation-operation-utils.js";
|
|
23
|
-
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
24
|
-
function noop() { }
|
|
25
|
-
const dimensionSteps = ['getBins', 'getDomain', 'getScaleFunc'];
|
|
26
|
-
const defaultDimensions = [
|
|
27
|
-
{
|
|
28
|
-
key: 'fillColor',
|
|
29
|
-
accessor: 'getFillColor',
|
|
30
|
-
pickingInfo: 'colorValue',
|
|
31
|
-
getBins: {
|
|
32
|
-
triggers: {
|
|
33
|
-
value: {
|
|
34
|
-
prop: 'getColorValue',
|
|
35
|
-
updateTrigger: 'getColorValue'
|
|
36
|
-
},
|
|
37
|
-
weight: {
|
|
38
|
-
prop: 'getColorWeight',
|
|
39
|
-
updateTrigger: 'getColorWeight'
|
|
40
|
-
},
|
|
41
|
-
aggregation: {
|
|
42
|
-
prop: 'colorAggregation'
|
|
43
|
-
},
|
|
44
|
-
filterData: {
|
|
45
|
-
prop: '_filterData',
|
|
46
|
-
updateTrigger: '_filterData'
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
},
|
|
50
|
-
getDomain: {
|
|
51
|
-
triggers: {
|
|
52
|
-
lowerPercentile: {
|
|
53
|
-
prop: 'lowerPercentile'
|
|
54
|
-
},
|
|
55
|
-
upperPercentile: {
|
|
56
|
-
prop: 'upperPercentile'
|
|
57
|
-
},
|
|
58
|
-
scaleType: {
|
|
59
|
-
prop: 'colorScaleType'
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
},
|
|
63
|
-
getScaleFunc: {
|
|
64
|
-
triggers: {
|
|
65
|
-
domain: { prop: 'colorDomain' },
|
|
66
|
-
range: { prop: 'colorRange' }
|
|
67
|
-
},
|
|
68
|
-
onSet: {
|
|
69
|
-
props: 'onSetColorDomain'
|
|
70
|
-
}
|
|
71
|
-
},
|
|
72
|
-
nullValue: [0, 0, 0, 0]
|
|
73
|
-
},
|
|
74
|
-
{
|
|
75
|
-
key: 'elevation',
|
|
76
|
-
accessor: 'getElevation',
|
|
77
|
-
pickingInfo: 'elevationValue',
|
|
78
|
-
getBins: {
|
|
79
|
-
triggers: {
|
|
80
|
-
value: {
|
|
81
|
-
prop: 'getElevationValue',
|
|
82
|
-
updateTrigger: 'getElevationValue'
|
|
83
|
-
},
|
|
84
|
-
weight: {
|
|
85
|
-
prop: 'getElevationWeight',
|
|
86
|
-
updateTrigger: 'getElevationWeight'
|
|
87
|
-
},
|
|
88
|
-
aggregation: {
|
|
89
|
-
prop: 'elevationAggregation'
|
|
90
|
-
},
|
|
91
|
-
filterData: {
|
|
92
|
-
prop: '_filterData',
|
|
93
|
-
updateTrigger: '_filterData'
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
},
|
|
97
|
-
getDomain: {
|
|
98
|
-
triggers: {
|
|
99
|
-
lowerPercentile: {
|
|
100
|
-
prop: 'elevationLowerPercentile'
|
|
101
|
-
},
|
|
102
|
-
upperPercentile: {
|
|
103
|
-
prop: 'elevationUpperPercentile'
|
|
104
|
-
},
|
|
105
|
-
scaleType: {
|
|
106
|
-
prop: 'elevationScaleType'
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
},
|
|
110
|
-
getScaleFunc: {
|
|
111
|
-
triggers: {
|
|
112
|
-
domain: { prop: 'elevationDomain' },
|
|
113
|
-
range: { prop: 'elevationRange' }
|
|
114
|
-
},
|
|
115
|
-
onSet: {
|
|
116
|
-
props: 'onSetElevationDomain'
|
|
117
|
-
}
|
|
118
|
-
},
|
|
119
|
-
nullValue: -1
|
|
120
|
-
}
|
|
121
|
-
];
|
|
122
|
-
const defaultGetCellSize = props => props.cellSize;
|
|
123
|
-
export default class CPUAggregator {
|
|
124
|
-
constructor(opts) {
|
|
125
|
-
this.state = {
|
|
126
|
-
layerData: {
|
|
127
|
-
data: undefined
|
|
128
|
-
},
|
|
129
|
-
dimensions: {
|
|
130
|
-
// color: {
|
|
131
|
-
// getValue: null,
|
|
132
|
-
// domain: null,
|
|
133
|
-
// sortedBins: null,
|
|
134
|
-
// scaleFunc: noop
|
|
135
|
-
// },
|
|
136
|
-
// elevation: {
|
|
137
|
-
// getValue: null,
|
|
138
|
-
// domain: null,
|
|
139
|
-
// sortedBins: null,
|
|
140
|
-
// scaleFunc: noop
|
|
141
|
-
// }
|
|
142
|
-
}
|
|
143
|
-
};
|
|
144
|
-
this.changeFlags = {};
|
|
145
|
-
this.dimensionUpdaters = {};
|
|
146
|
-
this._getCellSize = opts.getCellSize || defaultGetCellSize;
|
|
147
|
-
this._getAggregator = opts.getAggregator;
|
|
148
|
-
this._addDimension(opts.dimensions || defaultDimensions);
|
|
149
|
-
}
|
|
150
|
-
static defaultDimensions() {
|
|
151
|
-
return defaultDimensions;
|
|
152
|
-
}
|
|
153
|
-
updateState(opts, aggregationParams) {
|
|
154
|
-
const { oldProps, props, changeFlags } = opts;
|
|
155
|
-
this.updateGetValueFuncs(oldProps, props, changeFlags);
|
|
156
|
-
const reprojectNeeded = this.needsReProjectPoints(oldProps, props, changeFlags);
|
|
157
|
-
let aggregationDirty = false;
|
|
158
|
-
if (changeFlags.dataChanged || reprojectNeeded) {
|
|
159
|
-
// project data into bin and aggregate wegiths per bin
|
|
160
|
-
this.getAggregatedData(props, aggregationParams);
|
|
161
|
-
aggregationDirty = true;
|
|
162
|
-
}
|
|
163
|
-
else {
|
|
164
|
-
const dimensionChanges = this.getDimensionChanges(oldProps, props, changeFlags) || [];
|
|
165
|
-
// this here is layer
|
|
166
|
-
dimensionChanges.forEach(f => typeof f === 'function' && f());
|
|
167
|
-
aggregationDirty = true;
|
|
168
|
-
}
|
|
169
|
-
this.setState({ aggregationDirty });
|
|
170
|
-
return this.state;
|
|
171
|
-
}
|
|
172
|
-
// Update private state
|
|
173
|
-
setState(updateObject) {
|
|
174
|
-
this.state = { ...this.state, ...updateObject };
|
|
175
|
-
}
|
|
176
|
-
// Update private state.dimensions
|
|
177
|
-
setDimensionState(key, updateObject) {
|
|
178
|
-
this.setState({
|
|
179
|
-
dimensions: {
|
|
180
|
-
...this.state.dimensions,
|
|
181
|
-
[key]: { ...this.state.dimensions[key], ...updateObject }
|
|
182
|
-
}
|
|
183
|
-
});
|
|
184
|
-
}
|
|
185
|
-
normalizeResult(result = {}) {
|
|
186
|
-
// support previous hexagonAggregator API
|
|
187
|
-
if (result.hexagons) {
|
|
188
|
-
return { data: result.hexagons, ...result };
|
|
189
|
-
}
|
|
190
|
-
else if (result.layerData) {
|
|
191
|
-
return { data: result.layerData, ...result };
|
|
192
|
-
}
|
|
193
|
-
return result;
|
|
194
|
-
}
|
|
195
|
-
getAggregatedData(props, aggregationParams) {
|
|
196
|
-
const aggregator = this._getAggregator(props);
|
|
197
|
-
const result = aggregator(props, aggregationParams);
|
|
198
|
-
this.setState({
|
|
199
|
-
layerData: this.normalizeResult(result)
|
|
200
|
-
});
|
|
201
|
-
this.changeFlags = {
|
|
202
|
-
layerData: true
|
|
203
|
-
};
|
|
204
|
-
this.getSortedBins(props);
|
|
205
|
-
}
|
|
206
|
-
updateGetValueFuncs(oldProps, props, changeFlags) {
|
|
207
|
-
for (const key in this.dimensionUpdaters) {
|
|
208
|
-
const { value, weight, aggregation } = this.dimensionUpdaters[key].getBins.triggers;
|
|
209
|
-
let getValue = props[value.prop];
|
|
210
|
-
const getValueChanged = this.needUpdateDimensionStep(this.dimensionUpdaters[key].getBins, oldProps, props, changeFlags);
|
|
211
|
-
if (getValueChanged) {
|
|
212
|
-
if (getValue) {
|
|
213
|
-
getValue = wrapGetValueFunc(getValue, { data: props.data });
|
|
214
|
-
}
|
|
215
|
-
else {
|
|
216
|
-
// If `getValue` is not provided from props, build it with aggregation and weight.
|
|
217
|
-
getValue = getValueFunc(props[aggregation.prop], props[weight.prop], { data: props.data });
|
|
218
|
-
}
|
|
219
|
-
}
|
|
220
|
-
if (getValue) {
|
|
221
|
-
this.setDimensionState(key, { getValue });
|
|
222
|
-
}
|
|
223
|
-
}
|
|
224
|
-
}
|
|
225
|
-
needsReProjectPoints(oldProps, props, changeFlags) {
|
|
226
|
-
return (this._getCellSize(oldProps) !== this._getCellSize(props) ||
|
|
227
|
-
this._getAggregator(oldProps) !== this._getAggregator(props) ||
|
|
228
|
-
(changeFlags.updateTriggersChanged &&
|
|
229
|
-
(changeFlags.updateTriggersChanged.all || changeFlags.updateTriggersChanged.getPosition)));
|
|
230
|
-
}
|
|
231
|
-
// Adds dimensions
|
|
232
|
-
addDimension(dimensions) {
|
|
233
|
-
this._addDimension(dimensions);
|
|
234
|
-
}
|
|
235
|
-
_addDimension(dimensions = []) {
|
|
236
|
-
dimensions.forEach(dimension => {
|
|
237
|
-
const { key } = dimension;
|
|
238
|
-
this.dimensionUpdaters[key] = this.getDimensionUpdaters(dimension);
|
|
239
|
-
this.state.dimensions[key] = {
|
|
240
|
-
getValue: null,
|
|
241
|
-
domain: null,
|
|
242
|
-
sortedBins: null,
|
|
243
|
-
scaleFunc: noop
|
|
244
|
-
};
|
|
245
|
-
});
|
|
246
|
-
}
|
|
247
|
-
getDimensionUpdaters({ key, accessor, pickingInfo, getBins, getDomain, getScaleFunc, nullValue }) {
|
|
248
|
-
return {
|
|
249
|
-
key,
|
|
250
|
-
accessor,
|
|
251
|
-
pickingInfo,
|
|
252
|
-
getBins: { updater: this.getDimensionSortedBins.bind(this), ...getBins },
|
|
253
|
-
getDomain: { updater: this.getDimensionValueDomain.bind(this), ...getDomain },
|
|
254
|
-
getScaleFunc: { updater: this.getDimensionScale.bind(this), ...getScaleFunc },
|
|
255
|
-
attributeAccessor: this.getSubLayerDimensionAttribute(key, nullValue)
|
|
256
|
-
};
|
|
257
|
-
}
|
|
258
|
-
needUpdateDimensionStep(dimensionStep, oldProps, props, changeFlags) {
|
|
259
|
-
// whether need to update current dimension step
|
|
260
|
-
// dimension step is the value, domain, scaleFunction of each dimension
|
|
261
|
-
// each step is an object with properties links to layer prop and whether the prop is
|
|
262
|
-
// controlled by updateTriggers
|
|
263
|
-
// getBins: {
|
|
264
|
-
// value: {
|
|
265
|
-
// prop: 'getElevationValue',
|
|
266
|
-
// updateTrigger: 'getElevationValue'
|
|
267
|
-
// },
|
|
268
|
-
// weight: {
|
|
269
|
-
// prop: 'getElevationWeight',
|
|
270
|
-
// updateTrigger: 'getElevationWeight'
|
|
271
|
-
// },
|
|
272
|
-
// aggregation: {
|
|
273
|
-
// prop: 'elevationAggregation'
|
|
274
|
-
// }
|
|
275
|
-
// }
|
|
276
|
-
return Object.values(dimensionStep.triggers).some((item) => {
|
|
277
|
-
if (item.updateTrigger) {
|
|
278
|
-
// check based on updateTriggers change first
|
|
279
|
-
// if data has changed, always update value
|
|
280
|
-
return (changeFlags.dataChanged ||
|
|
281
|
-
(changeFlags.updateTriggersChanged &&
|
|
282
|
-
(changeFlags.updateTriggersChanged.all ||
|
|
283
|
-
changeFlags.updateTriggersChanged[item.updateTrigger])));
|
|
284
|
-
}
|
|
285
|
-
// fallback to direct comparison
|
|
286
|
-
return oldProps[item.prop] !== props[item.prop];
|
|
287
|
-
});
|
|
288
|
-
}
|
|
289
|
-
getDimensionChanges(oldProps, props, changeFlags) {
|
|
290
|
-
// const {dimensionUpdaters} = this.state;
|
|
291
|
-
const updaters = [];
|
|
292
|
-
// get dimension to be updated
|
|
293
|
-
for (const key in this.dimensionUpdaters) {
|
|
294
|
-
// return the first triggered updater for each dimension
|
|
295
|
-
const needUpdate = dimensionSteps.find(step => this.needUpdateDimensionStep(this.dimensionUpdaters[key][step], oldProps, props, changeFlags));
|
|
296
|
-
if (needUpdate) {
|
|
297
|
-
updaters.push(this.dimensionUpdaters[key][needUpdate].updater.bind(this, props, this.dimensionUpdaters[key]));
|
|
298
|
-
}
|
|
299
|
-
}
|
|
300
|
-
return updaters.length ? updaters : null;
|
|
301
|
-
}
|
|
302
|
-
getUpdateTriggers(props) {
|
|
303
|
-
const _updateTriggers = props.updateTriggers || {};
|
|
304
|
-
const updateTriggers = {};
|
|
305
|
-
for (const key in this.dimensionUpdaters) {
|
|
306
|
-
const { accessor } = this.dimensionUpdaters[key];
|
|
307
|
-
// fold dimension triggers into each accessor
|
|
308
|
-
updateTriggers[accessor] = {};
|
|
309
|
-
dimensionSteps.forEach(step => {
|
|
310
|
-
Object.values(this.dimensionUpdaters[key][step].triggers).forEach(({ prop, updateTrigger }) => {
|
|
311
|
-
if (updateTrigger) {
|
|
312
|
-
// if prop is based on updateTrigger e.g. getColorValue, getColorWeight
|
|
313
|
-
// and updateTriggers is passed in from layer prop
|
|
314
|
-
// fold the updateTriggers into accessor
|
|
315
|
-
const fromProp = _updateTriggers[updateTrigger];
|
|
316
|
-
if (typeof fromProp === 'object' && !Array.isArray(fromProp)) {
|
|
317
|
-
// if updateTrigger is an object spread it
|
|
318
|
-
Object.assign(updateTriggers[accessor], fromProp);
|
|
319
|
-
}
|
|
320
|
-
else if (fromProp !== undefined) {
|
|
321
|
-
updateTriggers[accessor][prop] = fromProp;
|
|
322
|
-
}
|
|
323
|
-
}
|
|
324
|
-
else {
|
|
325
|
-
// if prop is not based on updateTrigger
|
|
326
|
-
updateTriggers[accessor][prop] = props[prop];
|
|
327
|
-
}
|
|
328
|
-
});
|
|
329
|
-
});
|
|
330
|
-
}
|
|
331
|
-
return updateTriggers;
|
|
332
|
-
}
|
|
333
|
-
getSortedBins(props) {
|
|
334
|
-
for (const key in this.dimensionUpdaters) {
|
|
335
|
-
this.getDimensionSortedBins(props, this.dimensionUpdaters[key]);
|
|
336
|
-
}
|
|
337
|
-
}
|
|
338
|
-
getDimensionSortedBins(props, dimensionUpdater) {
|
|
339
|
-
const { key } = dimensionUpdater;
|
|
340
|
-
const { getValue } = this.state.dimensions[key];
|
|
341
|
-
const sortedBins = new BinSorter(this.state.layerData.data || [], {
|
|
342
|
-
getValue,
|
|
343
|
-
filterData: props._filterData
|
|
344
|
-
});
|
|
345
|
-
this.setDimensionState(key, { sortedBins });
|
|
346
|
-
this.getDimensionValueDomain(props, dimensionUpdater);
|
|
347
|
-
}
|
|
348
|
-
getDimensionValueDomain(props, dimensionUpdater) {
|
|
349
|
-
const { getDomain, key } = dimensionUpdater;
|
|
350
|
-
const { triggers: { lowerPercentile, upperPercentile, scaleType } } = getDomain;
|
|
351
|
-
const valueDomain = this.state.dimensions[key].sortedBins.getValueDomainByScale(props[scaleType.prop], [props[lowerPercentile.prop], props[upperPercentile.prop]]);
|
|
352
|
-
this.setDimensionState(key, { valueDomain });
|
|
353
|
-
this.getDimensionScale(props, dimensionUpdater);
|
|
354
|
-
}
|
|
355
|
-
getDimensionScale(props, dimensionUpdater) {
|
|
356
|
-
const { key, getScaleFunc, getDomain } = dimensionUpdater;
|
|
357
|
-
const { domain, range } = getScaleFunc.triggers;
|
|
358
|
-
const { scaleType } = getDomain.triggers;
|
|
359
|
-
const { onSet } = getScaleFunc;
|
|
360
|
-
const dimensionRange = props[range.prop];
|
|
361
|
-
const dimensionDomain = props[domain.prop] || this.state.dimensions[key].valueDomain;
|
|
362
|
-
const getScaleFunction = getScaleFunctionByScaleType(scaleType && props[scaleType.prop]);
|
|
363
|
-
const scaleFunc = getScaleFunction(dimensionDomain, dimensionRange);
|
|
364
|
-
if (typeof onSet === 'object' && typeof props[onSet.props] === 'function') {
|
|
365
|
-
props[onSet.props](scaleFunc.domain());
|
|
366
|
-
}
|
|
367
|
-
this.setDimensionState(key, { scaleFunc });
|
|
368
|
-
}
|
|
369
|
-
getSubLayerDimensionAttribute(key, nullValue) {
|
|
370
|
-
return cell => {
|
|
371
|
-
const { sortedBins, scaleFunc } = this.state.dimensions[key];
|
|
372
|
-
const bin = sortedBins.binMap[cell.index];
|
|
373
|
-
if (bin && bin.counts === 0) {
|
|
374
|
-
// no points left in bin after filtering
|
|
375
|
-
return nullValue;
|
|
376
|
-
}
|
|
377
|
-
const cv = bin && bin.value;
|
|
378
|
-
const domain = scaleFunc.domain();
|
|
379
|
-
const isValueInDomain = cv >= domain[0] && cv <= domain[domain.length - 1];
|
|
380
|
-
// if cell value is outside domain, set alpha to 0
|
|
381
|
-
return isValueInDomain ? scaleFunc(cv) : nullValue;
|
|
382
|
-
};
|
|
383
|
-
}
|
|
384
|
-
getSubLayerAccessors(props) {
|
|
385
|
-
const accessors = {};
|
|
386
|
-
for (const key in this.dimensionUpdaters) {
|
|
387
|
-
const { accessor } = this.dimensionUpdaters[key];
|
|
388
|
-
accessors[accessor] = this.getSubLayerDimensionAttribute(props, key);
|
|
389
|
-
}
|
|
390
|
-
return accessors;
|
|
391
|
-
}
|
|
392
|
-
getPickingInfo({ info }) {
|
|
393
|
-
const isPicked = info.picked && info.index > -1;
|
|
394
|
-
let object = null;
|
|
395
|
-
if (isPicked) {
|
|
396
|
-
// const {sortedColorBins, sortedElevationBins} = this.state;
|
|
397
|
-
// @ts-expect-error
|
|
398
|
-
const cell = this.state.layerData.data[info.index];
|
|
399
|
-
const binInfo = {};
|
|
400
|
-
for (const key in this.dimensionUpdaters) {
|
|
401
|
-
const { pickingInfo } = this.dimensionUpdaters[key];
|
|
402
|
-
const { sortedBins } = this.state.dimensions[key];
|
|
403
|
-
const value = sortedBins.binMap[cell.index] && sortedBins.binMap[cell.index].value;
|
|
404
|
-
binInfo[pickingInfo] = value;
|
|
405
|
-
}
|
|
406
|
-
object = Object.assign(binInfo, cell, {
|
|
407
|
-
points: cell.filteredPoints || cell.points
|
|
408
|
-
});
|
|
409
|
-
}
|
|
410
|
-
// override object with picked cell
|
|
411
|
-
info.picked = Boolean(object);
|
|
412
|
-
info.object = object;
|
|
413
|
-
return info;
|
|
414
|
-
}
|
|
415
|
-
getAccessor(dimensionKey) {
|
|
416
|
-
if (!this.dimensionUpdaters.hasOwnProperty(dimensionKey)) {
|
|
417
|
-
return noop;
|
|
418
|
-
}
|
|
419
|
-
return this.dimensionUpdaters[dimensionKey].attributeAccessor;
|
|
420
|
-
}
|
|
421
|
-
}
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
declare const _default: "#version 300 es\n#define SHADER_NAME gpu-aggregation-all-fs\n\nprecision highp float;\n\nin vec2 vTextureCoord;\nuniform sampler2D uSampler;\nuniform bool combineMaxMin;\nout vec4 fragColor;\nvoid main(void) {\n vec4 textureColor = texture(uSampler, vec2(vTextureCoord.s, vTextureCoord.t));\n if (textureColor.a == 0.) {\n discard;\n }\n fragColor.rgb = textureColor.rgb;\n // if combineMinMax is true, use Alpha channel for first weights min value.\n fragColor.a = combineMaxMin ? textureColor.r : textureColor.a;\n}\n";
|
|
2
|
-
export default _default;
|
|
3
|
-
//# sourceMappingURL=aggregate-all-fs.glsl.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"aggregate-all-fs.glsl.d.ts","sourceRoot":"","sources":["../../../src/utils/gpu-grid-aggregation/aggregate-all-fs.glsl.ts"],"names":[],"mappings":";AAoBA,wBAmBE"}
|