@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,62 +1,358 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import
|
|
1
|
+
// deck.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// Copyright (c) vis.gl contributors
|
|
4
|
+
import { log, createIterable, project32, Viewport } from '@deck.gl/core';
|
|
5
|
+
import { WebGLAggregator, CPUAggregator } from "../common/aggregator/index.js";
|
|
6
|
+
import AggregationLayer from "../common/aggregation-layer.js";
|
|
7
|
+
import { defaultColorRange } from "../common/utils/color-utils.js";
|
|
8
|
+
import { AttributeWithScale } from "../common/utils/scale-utils.js";
|
|
9
|
+
import { getBinIdRange } from "../common/utils/bounds-utils.js";
|
|
10
|
+
import { GridCellLayer } from "./grid-cell-layer.js";
|
|
11
|
+
import { binOptionsUniforms } from "./bin-options-uniforms.js";
|
|
12
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
13
|
+
function noop() { }
|
|
5
14
|
const defaultProps = {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
15
|
+
gpuAggregation: false,
|
|
16
|
+
// color
|
|
17
|
+
colorDomain: null,
|
|
18
|
+
colorRange: defaultColorRange,
|
|
19
|
+
getColorValue: { type: 'accessor', value: null }, // default value is calculated from `getColorWeight` and `colorAggregation`
|
|
20
|
+
getColorWeight: { type: 'accessor', value: 1 },
|
|
21
|
+
colorAggregation: 'SUM',
|
|
22
|
+
lowerPercentile: { type: 'number', min: 0, max: 100, value: 0 },
|
|
23
|
+
upperPercentile: { type: 'number', min: 0, max: 100, value: 100 },
|
|
24
|
+
colorScaleType: 'quantize',
|
|
25
|
+
onSetColorDomain: noop,
|
|
26
|
+
// elevation
|
|
27
|
+
elevationDomain: null,
|
|
28
|
+
elevationRange: [0, 1000],
|
|
29
|
+
getElevationValue: { type: 'accessor', value: null }, // default value is calculated from `getElevationWeight` and `elevationAggregation`
|
|
30
|
+
getElevationWeight: { type: 'accessor', value: 1 },
|
|
31
|
+
elevationAggregation: 'SUM',
|
|
32
|
+
elevationScale: { type: 'number', min: 0, value: 1 },
|
|
33
|
+
elevationLowerPercentile: { type: 'number', min: 0, max: 100, value: 0 },
|
|
34
|
+
elevationUpperPercentile: { type: 'number', min: 0, max: 100, value: 100 },
|
|
35
|
+
elevationScaleType: 'linear',
|
|
36
|
+
onSetElevationDomain: noop,
|
|
37
|
+
// grid
|
|
38
|
+
cellSize: { type: 'number', min: 0, value: 1000 },
|
|
39
|
+
coverage: { type: 'number', min: 0, max: 1, value: 1 },
|
|
40
|
+
getPosition: { type: 'accessor', value: (x) => x.position },
|
|
41
|
+
gridAggregator: { type: 'function', optional: true, value: null },
|
|
42
|
+
extruded: false,
|
|
43
|
+
// Optional material for 'lighting' shader module
|
|
44
|
+
material: true
|
|
9
45
|
};
|
|
10
46
|
/** Aggregate data into a grid-based heatmap. The color and height of a cell are determined based on the objects it contains. */
|
|
11
|
-
class GridLayer extends
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
47
|
+
class GridLayer extends AggregationLayer {
|
|
48
|
+
getAggregatorType() {
|
|
49
|
+
const { gpuAggregation, gridAggregator, getColorValue, getElevationValue } = this.props;
|
|
50
|
+
if (gpuAggregation && (gridAggregator || getColorValue || getElevationValue)) {
|
|
51
|
+
// If these features are desired by the app, the user should explicitly use CPU aggregation
|
|
52
|
+
log.warn('Features not supported by GPU aggregation, falling back to CPU')();
|
|
53
|
+
return 'cpu';
|
|
54
|
+
}
|
|
55
|
+
if (
|
|
56
|
+
// GPU aggregation is requested
|
|
57
|
+
gpuAggregation &&
|
|
58
|
+
// GPU aggregation is supported by the device
|
|
59
|
+
WebGLAggregator.isSupported(this.context.device)) {
|
|
60
|
+
return 'gpu';
|
|
61
|
+
}
|
|
62
|
+
return 'cpu';
|
|
16
63
|
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
64
|
+
createAggregator(type) {
|
|
65
|
+
if (type === 'cpu') {
|
|
66
|
+
const { gridAggregator, cellSize } = this.props;
|
|
67
|
+
return new CPUAggregator({
|
|
68
|
+
dimensions: 2,
|
|
69
|
+
getBin: {
|
|
70
|
+
sources: ['positions'],
|
|
71
|
+
getValue: ({ positions }, index, opts) => {
|
|
72
|
+
if (gridAggregator) {
|
|
73
|
+
return gridAggregator(positions, cellSize);
|
|
74
|
+
}
|
|
75
|
+
const viewport = this.state.aggregatorViewport;
|
|
76
|
+
// project to common space
|
|
77
|
+
const p = viewport.projectPosition(positions);
|
|
78
|
+
const { cellSizeCommon, cellOriginCommon } = opts;
|
|
79
|
+
return [
|
|
80
|
+
Math.floor((p[0] - cellOriginCommon[0]) / cellSizeCommon[0]),
|
|
81
|
+
Math.floor((p[1] - cellOriginCommon[1]) / cellSizeCommon[1])
|
|
82
|
+
];
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
getValue: [
|
|
86
|
+
{ sources: ['colorWeights'], getValue: ({ colorWeights }) => colorWeights },
|
|
87
|
+
{ sources: ['elevationWeights'], getValue: ({ elevationWeights }) => elevationWeights }
|
|
88
|
+
]
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
return new WebGLAggregator(this.context.device, {
|
|
92
|
+
dimensions: 2,
|
|
93
|
+
channelCount: 2,
|
|
94
|
+
bufferLayout: this.getAttributeManager().getBufferLayouts({ isInstanced: false }),
|
|
95
|
+
...super.getShaders({
|
|
96
|
+
modules: [project32, binOptionsUniforms],
|
|
97
|
+
vs: /* glsl */ `
|
|
98
|
+
in vec3 positions;
|
|
99
|
+
in vec3 positions64Low;
|
|
100
|
+
in float colorWeights;
|
|
101
|
+
in float elevationWeights;
|
|
102
|
+
|
|
103
|
+
void getBin(out ivec2 binId) {
|
|
104
|
+
vec3 positionCommon = project_position(positions, positions64Low);
|
|
105
|
+
vec2 gridCoords = floor(positionCommon.xy / binOptions.cellSizeCommon);
|
|
106
|
+
binId = ivec2(gridCoords);
|
|
107
|
+
}
|
|
108
|
+
void getValue(out vec2 value) {
|
|
109
|
+
value = vec2(colorWeights, elevationWeights);
|
|
110
|
+
}
|
|
111
|
+
`
|
|
112
|
+
})
|
|
22
113
|
});
|
|
23
114
|
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
const
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
115
|
+
initializeState() {
|
|
116
|
+
super.initializeState();
|
|
117
|
+
const attributeManager = this.getAttributeManager();
|
|
118
|
+
attributeManager.add({
|
|
119
|
+
positions: {
|
|
120
|
+
size: 3,
|
|
121
|
+
accessor: 'getPosition',
|
|
122
|
+
type: 'float64',
|
|
123
|
+
fp64: this.use64bitPositions()
|
|
124
|
+
},
|
|
125
|
+
colorWeights: { size: 1, accessor: 'getColorWeight' },
|
|
126
|
+
elevationWeights: { size: 1, accessor: 'getElevationWeight' }
|
|
35
127
|
});
|
|
36
128
|
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
const {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
129
|
+
updateState(params) {
|
|
130
|
+
const aggregatorChanged = super.updateState(params);
|
|
131
|
+
const { props, oldProps, changeFlags } = params;
|
|
132
|
+
const { aggregator } = this.state;
|
|
133
|
+
if ((changeFlags.dataChanged || !this.state.dataAsArray) &&
|
|
134
|
+
(props.getColorValue || props.getElevationValue)) {
|
|
135
|
+
// Convert data to array
|
|
136
|
+
this.state.dataAsArray = Array.from(createIterable(props.data).iterable);
|
|
137
|
+
}
|
|
138
|
+
if (aggregatorChanged ||
|
|
139
|
+
changeFlags.dataChanged ||
|
|
140
|
+
props.cellSize !== oldProps.cellSize ||
|
|
141
|
+
props.getColorValue !== oldProps.getColorValue ||
|
|
142
|
+
props.getElevationValue !== oldProps.getElevationValue ||
|
|
143
|
+
props.colorAggregation !== oldProps.colorAggregation ||
|
|
144
|
+
props.elevationAggregation !== oldProps.elevationAggregation) {
|
|
145
|
+
this._updateBinOptions();
|
|
146
|
+
const { cellSizeCommon, cellOriginCommon, binIdRange, dataAsArray } = this.state;
|
|
147
|
+
aggregator.setProps({
|
|
148
|
+
// @ts-expect-error only used by GPUAggregator
|
|
149
|
+
binIdRange,
|
|
150
|
+
pointCount: this.getNumInstances(),
|
|
151
|
+
operations: [props.colorAggregation, props.elevationAggregation],
|
|
152
|
+
binOptions: {
|
|
153
|
+
cellSizeCommon,
|
|
154
|
+
cellOriginCommon
|
|
155
|
+
},
|
|
156
|
+
onUpdate: this._onAggregationUpdate.bind(this)
|
|
157
|
+
});
|
|
158
|
+
if (dataAsArray) {
|
|
159
|
+
const { getColorValue, getElevationValue } = this.props;
|
|
160
|
+
aggregator.setProps({
|
|
161
|
+
// @ts-expect-error only used by CPUAggregator
|
|
162
|
+
customOperations: [
|
|
163
|
+
getColorValue &&
|
|
164
|
+
((indices) => getColorValue(indices.map(i => dataAsArray[i]), { indices, data: props.data })),
|
|
165
|
+
getElevationValue &&
|
|
166
|
+
((indices) => getElevationValue(indices.map(i => dataAsArray[i]), { indices, data: props.data }))
|
|
167
|
+
]
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
if (changeFlags.updateTriggersChanged && changeFlags.updateTriggersChanged.getColorValue) {
|
|
172
|
+
aggregator.setNeedsUpdate(0);
|
|
173
|
+
}
|
|
174
|
+
if (changeFlags.updateTriggersChanged && changeFlags.updateTriggersChanged.getElevationValue) {
|
|
175
|
+
aggregator.setNeedsUpdate(1);
|
|
176
|
+
}
|
|
177
|
+
return aggregatorChanged;
|
|
178
|
+
}
|
|
179
|
+
_updateBinOptions() {
|
|
180
|
+
const bounds = this.getBounds();
|
|
181
|
+
const cellSizeCommon = [1, 1];
|
|
182
|
+
let cellOriginCommon = [0, 0];
|
|
183
|
+
let binIdRange = [
|
|
184
|
+
[0, 1],
|
|
185
|
+
[0, 1]
|
|
186
|
+
];
|
|
187
|
+
let viewport = this.context.viewport;
|
|
188
|
+
if (bounds && Number.isFinite(bounds[0][0])) {
|
|
189
|
+
let centroid = [(bounds[0][0] + bounds[1][0]) / 2, (bounds[0][1] + bounds[1][1]) / 2];
|
|
190
|
+
const { cellSize } = this.props;
|
|
191
|
+
const { unitsPerMeter } = viewport.getDistanceScales(centroid);
|
|
192
|
+
cellSizeCommon[0] = unitsPerMeter[0] * cellSize;
|
|
193
|
+
cellSizeCommon[1] = unitsPerMeter[1] * cellSize;
|
|
194
|
+
// Offset common space to center at the origin of the grid cell where the data center is in
|
|
195
|
+
// This improves precision without affecting the cell positions
|
|
196
|
+
const centroidCommon = viewport.projectFlat(centroid);
|
|
197
|
+
cellOriginCommon = [
|
|
198
|
+
Math.floor(centroidCommon[0] / cellSizeCommon[0]) * cellSizeCommon[0],
|
|
199
|
+
Math.floor(centroidCommon[1] / cellSizeCommon[1]) * cellSizeCommon[1]
|
|
200
|
+
];
|
|
201
|
+
centroid = viewport.unprojectFlat(cellOriginCommon);
|
|
202
|
+
const ViewportType = viewport.constructor;
|
|
203
|
+
// We construct a viewport for the GPU aggregator's project module
|
|
204
|
+
// This viewport is determined by data
|
|
205
|
+
// removes arbitrary precision variance that depends on initial view state
|
|
206
|
+
viewport = viewport.isGeospatial
|
|
207
|
+
? new ViewportType({ longitude: centroid[0], latitude: centroid[1], zoom: 12 })
|
|
208
|
+
: new Viewport({ position: [centroid[0], centroid[1], 0], zoom: 12 });
|
|
209
|
+
// Round to the nearest 32-bit float to match CPU and GPU results
|
|
210
|
+
cellOriginCommon = [Math.fround(viewport.center[0]), Math.fround(viewport.center[1])];
|
|
211
|
+
binIdRange = getBinIdRange({
|
|
212
|
+
dataBounds: bounds,
|
|
213
|
+
getBinId: (p) => {
|
|
214
|
+
const positionCommon = viewport.projectFlat(p);
|
|
215
|
+
return [
|
|
216
|
+
Math.floor((positionCommon[0] - cellOriginCommon[0]) / cellSizeCommon[0]),
|
|
217
|
+
Math.floor((positionCommon[1] - cellOriginCommon[1]) / cellSizeCommon[1])
|
|
218
|
+
];
|
|
219
|
+
}
|
|
220
|
+
});
|
|
43
221
|
}
|
|
44
|
-
|
|
45
|
-
|
|
222
|
+
this.setState({ cellSizeCommon, cellOriginCommon, binIdRange, aggregatorViewport: viewport });
|
|
223
|
+
}
|
|
224
|
+
draw(opts) {
|
|
225
|
+
// Replaces render time viewport with our own
|
|
226
|
+
if (opts.shaderModuleProps.project) {
|
|
227
|
+
opts.shaderModuleProps.project.viewport = this.state.aggregatorViewport;
|
|
228
|
+
}
|
|
229
|
+
super.draw(opts);
|
|
230
|
+
}
|
|
231
|
+
_onAggregationUpdate({ channel }) {
|
|
232
|
+
const props = this.getCurrentLayer().props;
|
|
233
|
+
const { aggregator } = this.state;
|
|
234
|
+
if (channel === 0) {
|
|
235
|
+
const result = aggregator.getResult(0);
|
|
236
|
+
this.setState({
|
|
237
|
+
colors: new AttributeWithScale(result, aggregator.binCount)
|
|
238
|
+
});
|
|
239
|
+
props.onSetColorDomain(aggregator.getResultDomain(0));
|
|
46
240
|
}
|
|
47
|
-
if (
|
|
48
|
-
|
|
49
|
-
|
|
241
|
+
else if (channel === 1) {
|
|
242
|
+
const result = aggregator.getResult(1);
|
|
243
|
+
this.setState({
|
|
244
|
+
elevations: new AttributeWithScale(result, aggregator.binCount)
|
|
245
|
+
});
|
|
246
|
+
props.onSetElevationDomain(aggregator.getResultDomain(1));
|
|
50
247
|
}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
248
|
+
}
|
|
249
|
+
onAttributeChange(id) {
|
|
250
|
+
const { aggregator } = this.state;
|
|
251
|
+
switch (id) {
|
|
252
|
+
case 'positions':
|
|
253
|
+
aggregator.setNeedsUpdate();
|
|
254
|
+
this._updateBinOptions();
|
|
255
|
+
const { cellSizeCommon, cellOriginCommon, binIdRange } = this.state;
|
|
256
|
+
aggregator.setProps({
|
|
257
|
+
// @ts-expect-error only used by GPUAggregator
|
|
258
|
+
binIdRange,
|
|
259
|
+
binOptions: {
|
|
260
|
+
cellSizeCommon,
|
|
261
|
+
cellOriginCommon
|
|
262
|
+
}
|
|
263
|
+
});
|
|
264
|
+
break;
|
|
265
|
+
case 'colorWeights':
|
|
266
|
+
aggregator.setNeedsUpdate(0);
|
|
267
|
+
break;
|
|
268
|
+
case 'elevationWeights':
|
|
269
|
+
aggregator.setNeedsUpdate(1);
|
|
270
|
+
break;
|
|
271
|
+
default:
|
|
272
|
+
// This should not happen
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
renderLayers() {
|
|
276
|
+
const { aggregator, cellOriginCommon, cellSizeCommon } = this.state;
|
|
277
|
+
const { elevationScale, colorRange, elevationRange, extruded, coverage, material, transitions, colorScaleType, lowerPercentile, upperPercentile, colorDomain, elevationScaleType, elevationLowerPercentile, elevationUpperPercentile, elevationDomain } = this.props;
|
|
278
|
+
const CellLayerClass = this.getSubLayerClass('cells', GridCellLayer);
|
|
279
|
+
const binAttribute = aggregator.getBins();
|
|
280
|
+
const colors = this.state.colors?.update({
|
|
281
|
+
scaleType: colorScaleType,
|
|
282
|
+
lowerPercentile,
|
|
283
|
+
upperPercentile
|
|
284
|
+
});
|
|
285
|
+
const elevations = this.state.elevations?.update({
|
|
286
|
+
scaleType: elevationScaleType,
|
|
287
|
+
lowerPercentile: elevationLowerPercentile,
|
|
288
|
+
upperPercentile: elevationUpperPercentile
|
|
289
|
+
});
|
|
290
|
+
if (!colors || !elevations) {
|
|
291
|
+
return null;
|
|
54
292
|
}
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
293
|
+
return new CellLayerClass(this.getSubLayerProps({
|
|
294
|
+
id: 'cells'
|
|
295
|
+
}), {
|
|
296
|
+
data: {
|
|
297
|
+
length: aggregator.binCount,
|
|
298
|
+
attributes: {
|
|
299
|
+
getBin: binAttribute,
|
|
300
|
+
getColorValue: colors.attribute,
|
|
301
|
+
getElevationValue: elevations.attribute
|
|
302
|
+
}
|
|
303
|
+
},
|
|
304
|
+
// Data has changed shallowly, but we likely don't need to update the attributes
|
|
305
|
+
dataComparator: (data, oldData) => data.length === oldData.length,
|
|
306
|
+
updateTriggers: {
|
|
307
|
+
getBin: [binAttribute],
|
|
308
|
+
getColorValue: [colors.attribute],
|
|
309
|
+
getElevationValue: [elevations.attribute]
|
|
310
|
+
},
|
|
311
|
+
cellOriginCommon,
|
|
312
|
+
cellSizeCommon,
|
|
313
|
+
elevationScale,
|
|
314
|
+
colorRange,
|
|
315
|
+
colorScaleType,
|
|
316
|
+
elevationRange,
|
|
317
|
+
extruded,
|
|
318
|
+
coverage,
|
|
319
|
+
material,
|
|
320
|
+
colorDomain: colors.domain || colorDomain || aggregator.getResultDomain(0),
|
|
321
|
+
elevationDomain: elevations.domain || elevationDomain || aggregator.getResultDomain(1),
|
|
322
|
+
colorCutoff: colors.cutoff,
|
|
323
|
+
elevationCutoff: elevations.cutoff,
|
|
324
|
+
transitions: transitions && {
|
|
325
|
+
getFillColor: transitions.getColorValue || transitions.getColorWeight,
|
|
326
|
+
getElevation: transitions.getElevationValue || transitions.getElevationWeight
|
|
327
|
+
},
|
|
328
|
+
// Extensions are already handled by the GPUAggregator, do not pass it down
|
|
329
|
+
extensions: []
|
|
330
|
+
});
|
|
331
|
+
}
|
|
332
|
+
getPickingInfo(params) {
|
|
333
|
+
const info = params.info;
|
|
334
|
+
const { index } = info;
|
|
335
|
+
if (index >= 0) {
|
|
336
|
+
const bin = this.state.aggregator.getBin(index);
|
|
337
|
+
let object;
|
|
338
|
+
if (bin) {
|
|
339
|
+
object = {
|
|
340
|
+
col: bin.id[0],
|
|
341
|
+
row: bin.id[1],
|
|
342
|
+
colorValue: bin.value[0],
|
|
343
|
+
elevationValue: bin.value[1],
|
|
344
|
+
count: bin.count
|
|
345
|
+
};
|
|
346
|
+
if (bin.pointIndices) {
|
|
347
|
+
object.pointIndices = bin.pointIndices;
|
|
348
|
+
object.points = Array.isArray(this.props.data)
|
|
349
|
+
? bin.pointIndices.map(i => this.props.data[i])
|
|
350
|
+
: [];
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
info.object = object;
|
|
58
354
|
}
|
|
59
|
-
return
|
|
355
|
+
return info;
|
|
60
356
|
}
|
|
61
357
|
}
|
|
62
358
|
GridLayer.layerName = 'GridLayer';
|
|
@@ -2,6 +2,7 @@ import { CompositeLayer, AttributeManager, LayerDataSource, UpdateParameters, Co
|
|
|
2
2
|
export type AggregationLayerProps<DataT> = CompositeLayerProps & {
|
|
3
3
|
data: LayerDataSource<DataT>;
|
|
4
4
|
};
|
|
5
|
+
/** Legacy AggregationLayer, to be removed in v9.1 */
|
|
5
6
|
export default abstract class AggregationLayer<DataT, ExtraPropsT extends {} = {}> extends CompositeLayer<Required<AggregationLayer<DataT>> & ExtraPropsT> {
|
|
6
7
|
static layerName: string;
|
|
7
8
|
state: {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"aggregation-layer.d.ts","sourceRoot":"","sources":["../../src/heatmap-layer/aggregation-layer.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,cAAc,EACd,gBAAgB,E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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.
|
|
1
|
+
// deck.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// Copyright (c) vis.gl contributors
|
|
20
4
|
import { CompositeLayer, AttributeManager, _compareProps as compareProps } from '@deck.gl/core';
|
|
21
|
-
import { filterProps } from "
|
|
5
|
+
import { filterProps } from "../common/utils/prop-utils.js";
|
|
6
|
+
/** Legacy AggregationLayer, to be removed in v9.1 */
|
|
22
7
|
class AggregationLayer extends CompositeLayer {
|
|
23
8
|
initializeAggregationLayer(dimensions) {
|
|
24
9
|
super.initializeState(this.context);
|
|
@@ -52,7 +37,7 @@ class AggregationLayer extends CompositeLayer {
|
|
|
52
37
|
getModuleSettings() {
|
|
53
38
|
// For regular layer draw this happens during draw cycle (_drawLayersInViewport) not during update cycle
|
|
54
39
|
// For aggregation layers this is called during updateState to update aggregation data
|
|
55
|
-
// NOTE: it is similar to LayerPass.
|
|
40
|
+
// NOTE: it is similar to LayerPass._getShaderModuleProps() but doesn't inlcude `effects` it is not needed for aggregation
|
|
56
41
|
const { viewport, mousePosition, device } = this.context;
|
|
57
42
|
const moduleSettings = Object.assign(Object.create(this.props), {
|
|
58
43
|
viewport,
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Texture } from '@luma.gl/core';
|
|
2
|
+
export type WeightProps = {
|
|
3
|
+
commonBounds: [number, number, number, number];
|
|
4
|
+
radiusPixels: number;
|
|
5
|
+
textureWidth: number;
|
|
6
|
+
weightsScale: number;
|
|
7
|
+
weightsTexture: Texture;
|
|
8
|
+
};
|
|
9
|
+
export declare const weightUniforms: {
|
|
10
|
+
readonly name: "weight";
|
|
11
|
+
readonly vs: "uniform weightUniforms {\n vec4 commonBounds;\n float radiusPixels;\n float textureWidth;\n float weightsScale;\n} weight;\n";
|
|
12
|
+
readonly uniformTypes: {
|
|
13
|
+
readonly commonBounds: "vec4<f32>";
|
|
14
|
+
readonly radiusPixels: "f32";
|
|
15
|
+
readonly textureWidth: "f32";
|
|
16
|
+
readonly weightsScale: "f32";
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
export type MaxWeightProps = {
|
|
20
|
+
inTexture: Texture;
|
|
21
|
+
textureSize: number;
|
|
22
|
+
};
|
|
23
|
+
export declare const maxWeightUniforms: {
|
|
24
|
+
readonly name: "maxWeight";
|
|
25
|
+
readonly vs: "uniform maxWeightUniforms {\n float textureSize;\n} maxWeight;\n";
|
|
26
|
+
readonly uniformTypes: {
|
|
27
|
+
readonly textureSize: "f32";
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
//# sourceMappingURL=heatmap-layer-uniforms.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"heatmap-layer-uniforms.d.ts","sourceRoot":"","sources":["../../src/heatmap-layer/heatmap-layer-uniforms.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,OAAO,EAAC,MAAM,eAAe,CAAC;AAWtC,MAAM,MAAM,WAAW,GAAG;IACxB,YAAY,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IAC/C,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;IACrB,cAAc,EAAE,OAAO,CAAC;CACzB,CAAC;AAEF,eAAO,MAAM,cAAc;;;;;;;;;CASmB,CAAC;AAE/C,MAAM,MAAM,cAAc,GAAG;IAC3B,SAAS,EAAE,OAAO,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,eAAO,MAAM,iBAAiB;;;;;;CAUmB,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
// deck.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// Copyright (c) vis.gl contributors
|
|
4
|
+
const uniformBlock = `\
|
|
5
|
+
uniform weightUniforms {
|
|
6
|
+
vec4 commonBounds;
|
|
7
|
+
float radiusPixels;
|
|
8
|
+
float textureWidth;
|
|
9
|
+
float weightsScale;
|
|
10
|
+
} weight;
|
|
11
|
+
`;
|
|
12
|
+
export const weightUniforms = {
|
|
13
|
+
name: 'weight',
|
|
14
|
+
vs: uniformBlock,
|
|
15
|
+
uniformTypes: {
|
|
16
|
+
commonBounds: 'vec4<f32>',
|
|
17
|
+
radiusPixels: 'f32',
|
|
18
|
+
textureWidth: 'f32',
|
|
19
|
+
weightsScale: 'f32'
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
export const maxWeightUniforms = {
|
|
23
|
+
name: 'maxWeight',
|
|
24
|
+
vs: `\
|
|
25
|
+
uniform maxWeightUniforms {
|
|
26
|
+
float textureSize;
|
|
27
|
+
} maxWeight;
|
|
28
|
+
`,
|
|
29
|
+
uniformTypes: {
|
|
30
|
+
textureSize: 'f32'
|
|
31
|
+
}
|
|
32
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export declare function getBounds(points: number[][]): number[];
|
|
2
2
|
export declare function boundsContain(currentBounds: number[], targetBounds: number[]): boolean;
|
|
3
3
|
export declare function packVertices(points: number[][], dimensions?: number): Float32Array;
|
|
4
|
-
export declare function scaleToAspectRatio(boundingBox: number
|
|
4
|
+
export declare function scaleToAspectRatio(boundingBox: [number, number, number, number], width: number, height: number): [number, number, number, number];
|
|
5
5
|
export declare function getTextureCoordinates(point: number[], bounds: number[]): number[];
|
|
6
6
|
//# sourceMappingURL=heatmap-layer-utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"heatmap-layer-utils.d.ts","sourceRoot":"","sources":["../../src/heatmap-layer/heatmap-layer-utils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"heatmap-layer-utils.d.ts","sourceRoot":"","sources":["../../src/heatmap-layer/heatmap-layer-utils.ts"],"names":[],"mappings":"AAIA,wBAAgB,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE,GAAG,MAAM,EAAE,CAWtD;AAGD,wBAAgB,aAAa,CAAC,aAAa,EAAE,MAAM,EAAE,EAAE,YAAY,EAAE,MAAM,EAAE,GAAG,OAAO,CAUtF;AAKD,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE,EAAE,UAAU,GAAE,MAAU,GAAG,YAAY,CAQrF;AAGD,wBAAgB,kBAAkB,CAChC,WAAW,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAC7C,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,GACb,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CA6BlC;AAGD,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,YAGtE"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Buffer, Texture, TextureFormat } from '@luma.gl/core';
|
|
2
2
|
import { TextureTransform } from '@luma.gl/engine';
|
|
3
3
|
import { Accessor, AccessorFunction, AttributeManager, ChangeFlags, Color, Layer, LayerContext, LayersList, Position, UpdateParameters, DefaultProps } from '@deck.gl/core';
|
|
4
|
-
import AggregationLayer, { AggregationLayerProps } from "
|
|
4
|
+
import AggregationLayer, { AggregationLayerProps } from "./aggregation-layer.js";
|
|
5
5
|
export type HeatmapLayerProps<DataT = unknown> = _HeatmapLayerProps<DataT> & AggregationLayerProps<DataT>;
|
|
6
6
|
type _HeatmapLayerProps<DataT> = {
|
|
7
7
|
/**
|
|
@@ -93,6 +93,7 @@ export default class HeatmapLayer<DataT = any, ExtraPropsT extends {} = {}> exte
|
|
|
93
93
|
visibleWorldBounds: number[];
|
|
94
94
|
viewportCorners: number[][];
|
|
95
95
|
};
|
|
96
|
+
getShaders(shaders: any): any;
|
|
96
97
|
initializeState(): void;
|
|
97
98
|
shouldUpdateState({ changeFlags }: UpdateParameters<this>): boolean;
|
|
98
99
|
updateState(opts: UpdateParameters<this>): void;
|
|
@@ -101,8 +102,8 @@ export default class HeatmapLayer<DataT = any, ExtraPropsT extends {} = {}> exte
|
|
|
101
102
|
finalizeState(context: LayerContext): void;
|
|
102
103
|
_getAttributeManager(): AttributeManager;
|
|
103
104
|
_getChangeFlags(opts: UpdateParameters<this>): Partial<ChangeFlags> & {
|
|
104
|
-
boundsChanged?: boolean
|
|
105
|
-
viewportZoomChanged?: boolean
|
|
105
|
+
boundsChanged?: boolean;
|
|
106
|
+
viewportZoomChanged?: boolean;
|
|
106
107
|
};
|
|
107
108
|
_createTextures(): void;
|
|
108
109
|
_setupAttributes(): void;
|
|
@@ -110,6 +111,7 @@ export default class HeatmapLayer<DataT = any, ExtraPropsT extends {} = {}> exte
|
|
|
110
111
|
_createWeightsTransform(shaders: {
|
|
111
112
|
vs: string;
|
|
112
113
|
fs?: string;
|
|
114
|
+
modules: any[];
|
|
113
115
|
}): void;
|
|
114
116
|
_setupResources(): void;
|
|
115
117
|
updateShaders(shaderOptions: any): void;
|
|
@@ -121,7 +123,7 @@ export default class HeatmapLayer<DataT = any, ExtraPropsT extends {} = {}> exte
|
|
|
121
123
|
_debouncedUpdateWeightmap(fromTimer?: boolean): void;
|
|
122
124
|
_worldToCommonBounds(worldBounds: any, opts?: {
|
|
123
125
|
useLayerCoordinateSystem?: boolean;
|
|
124
|
-
}): number
|
|
126
|
+
}): [number, number, number, number];
|
|
125
127
|
_commonToWorldBounds(commonBounds: any): number[];
|
|
126
128
|
}
|
|
127
129
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"heatmap-layer.d.ts","sourceRoot":"","sources":["../../src/heatmap-layer/heatmap-layer.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"heatmap-layer.d.ts","sourceRoot":"","sources":["../../src/heatmap-layer/heatmap-layer.ts"],"names":[],"mappings":"AAYA,OAAO,EAAC,MAAM,EAAiB,OAAO,EAAgB,aAAa,EAAC,MAAM,eAAe,CAAC;AAC1F,OAAO,EAAC,gBAAgB,EAAwB,MAAM,iBAAiB,CAAC;AACxE,OAAO,EACL,QAAQ,EACR,gBAAgB,EAChB,gBAAgB,EAChB,WAAW,EACX,KAAK,EAEL,KAAK,EACL,YAAY,EACZ,UAAU,EAEV,QAAQ,EACR,gBAAgB,EAChB,YAAY,EAEb,MAAM,eAAe,CAAC;AAEvB,OAAO,gBAAgB,EAAE,EAAC,qBAAqB,EAAC,+BAA4B;AAuD5E,MAAM,MAAM,iBAAiB,CAAC,KAAK,GAAG,OAAO,IAAI,kBAAkB,CAAC,KAAK,CAAC,GACxE,qBAAqB,CAAC,KAAK,CAAC,CAAC;AAE/B,KAAK,kBAAkB,CAAC,KAAK,IAAI;IAC/B;;;;OAIG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;;;OAIG;IACH,U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