@deck.gl/aggregation-layers 9.0.34 → 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,8 +1,8 @@
|
|
|
1
|
-
import { Accessor, Color, GetPickingInfoParams,
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import { Accessor, Color, GetPickingInfoParams, CompositeLayerProps, Layer, LayersList, PickingInfo, Position, UpdateParameters, DefaultProps } from '@deck.gl/core';
|
|
2
|
+
import { WebGLAggregator, CPUAggregator, AggregationOperation } from "../common/aggregator/index.js";
|
|
3
|
+
import AggregationLayer from "../common/aggregation-layer.js";
|
|
4
4
|
/** All properties supported by ScreenGridLayer. */
|
|
5
|
-
export type ScreenGridLayerProps<DataT = unknown> = _ScreenGridLayerProps<DataT> &
|
|
5
|
+
export type ScreenGridLayerProps<DataT = unknown> = _ScreenGridLayerProps<DataT> & CompositeLayerProps;
|
|
6
6
|
/** Properties added by ScreenGridLayer. */
|
|
7
7
|
export type _ScreenGridLayerProps<DataT> = {
|
|
8
8
|
/**
|
|
@@ -15,18 +15,6 @@ export type _ScreenGridLayerProps<DataT> = {
|
|
|
15
15
|
* @default 2
|
|
16
16
|
*/
|
|
17
17
|
cellMarginPixels?: number;
|
|
18
|
-
/**
|
|
19
|
-
* Expressed as an rgba array, minimal color that could be rendered by a tile.
|
|
20
|
-
* @default [0, 0, 0, 255]
|
|
21
|
-
* @deprecated Deprecated in version 5.2.0, use `colorRange` and `colorDomain` instead.
|
|
22
|
-
*/
|
|
23
|
-
minColor?: Color | null;
|
|
24
|
-
/**
|
|
25
|
-
* Expressed as an rgba array, maximal color that could be rendered by a tile.
|
|
26
|
-
* @default [0, 255, 0, 255]
|
|
27
|
-
* @deprecated Deprecated in version 5.2.0, use `colorRange` and `colorDomain` instead.
|
|
28
|
-
*/
|
|
29
|
-
maxColor?: Color | null;
|
|
30
18
|
/**
|
|
31
19
|
* Color scale input domain. The color scale maps continues numeric domain into discrete color range.
|
|
32
20
|
* @default [1, max(weight)]
|
|
@@ -38,6 +26,12 @@ export type _ScreenGridLayerProps<DataT> = {
|
|
|
38
26
|
* @default `6-class YlOrRd` - [colorbrewer](http://colorbrewer2.org/#type=sequential&scheme=YlOrRd&n=6)
|
|
39
27
|
*/
|
|
40
28
|
colorRange?: Color[];
|
|
29
|
+
/**
|
|
30
|
+
* Scaling function used to determine the color of the grid cell.
|
|
31
|
+
* Supported Values are 'quantize', 'linear', 'quantile' and 'ordinal'.
|
|
32
|
+
* @default 'quantize'
|
|
33
|
+
*/
|
|
34
|
+
colorScaleType?: 'linear' | 'quantize';
|
|
41
35
|
/**
|
|
42
36
|
* Method called to retrieve the position of each object.
|
|
43
37
|
*
|
|
@@ -58,38 +52,37 @@ export type _ScreenGridLayerProps<DataT> = {
|
|
|
58
52
|
gpuAggregation?: boolean;
|
|
59
53
|
/**
|
|
60
54
|
* Defines the type of aggregation operation
|
|
61
|
-
*
|
|
62
|
-
* V valid values are 'SUM', 'MEAN', 'MIN' and 'MAX'.
|
|
55
|
+
* Valid values are 'SUM', 'MEAN', 'MIN', 'MAX', 'COUNT'.
|
|
63
56
|
*
|
|
64
57
|
* @default 'SUM'
|
|
65
58
|
*/
|
|
66
|
-
aggregation?:
|
|
59
|
+
aggregation?: AggregationOperation;
|
|
67
60
|
};
|
|
61
|
+
export type ScreenGridLayerPickingInfo<DataT> = PickingInfo<{
|
|
62
|
+
/** Column index of the picked cell, starting from 0 at the left of the viewport */
|
|
63
|
+
col: number;
|
|
64
|
+
/** Row index of the picked cell, starting from 0 at the top of the viewport */
|
|
65
|
+
row: number;
|
|
66
|
+
/** Aggregated value */
|
|
67
|
+
value: number;
|
|
68
|
+
/** Number of data points in the picked cell */
|
|
69
|
+
count: number;
|
|
70
|
+
/** Indices of the data objects in the picked cell. Only available if using CPU aggregation. */
|
|
71
|
+
pointIndices?: number[];
|
|
72
|
+
/** The data objects in the picked cell. Only available if using CPU aggregation and layer data is an array. */
|
|
73
|
+
points?: DataT[];
|
|
74
|
+
}>;
|
|
68
75
|
/** Aggregates data into histogram bins and renders them as a grid. */
|
|
69
|
-
export default class ScreenGridLayer<DataT = any, ExtraProps extends {} = {}> extends
|
|
76
|
+
export default class ScreenGridLayer<DataT = any, ExtraProps extends {} = {}> extends AggregationLayer<DataT, ExtraProps & Required<_ScreenGridLayerProps<DataT>>> {
|
|
70
77
|
static layerName: string;
|
|
71
78
|
static defaultProps: DefaultProps<ScreenGridLayerProps<unknown>>;
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
gpuGridAggregator?: any;
|
|
75
|
-
gpuAggregation?: any;
|
|
76
|
-
weights?: any;
|
|
77
|
-
maxTexture?: Texture;
|
|
78
|
-
aggregationBuffer?: Buffer;
|
|
79
|
-
maxBuffer?: Buffer;
|
|
80
|
-
};
|
|
79
|
+
getAggregatorType(): string;
|
|
80
|
+
createAggregator(type: string): WebGLAggregator | CPUAggregator;
|
|
81
81
|
initializeState(): void;
|
|
82
82
|
shouldUpdateState({ changeFlags }: UpdateParameters<this>): boolean;
|
|
83
|
-
updateState(
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
getPickingInfo(
|
|
87
|
-
updateResults({ aggregationData, maxData }: {
|
|
88
|
-
aggregationData: any;
|
|
89
|
-
maxData: any;
|
|
90
|
-
}): void;
|
|
91
|
-
updateAggregationState(opts: any): void;
|
|
92
|
-
_updateAccessors(opts: any): void;
|
|
93
|
-
_resetResults(): void;
|
|
83
|
+
updateState(params: UpdateParameters<this>): boolean;
|
|
84
|
+
onAttributeChange(id: string): void;
|
|
85
|
+
renderLayers(): LayersList | Layer | null;
|
|
86
|
+
getPickingInfo(params: GetPickingInfoParams): ScreenGridLayerPickingInfo<DataT>;
|
|
94
87
|
}
|
|
95
88
|
//# sourceMappingURL=screen-grid-layer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"screen-grid-layer.d.ts","sourceRoot":"","sources":["../../src/screen-grid-layer/screen-grid-layer.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"screen-grid-layer.d.ts","sourceRoot":"","sources":["../../src/screen-grid-layer/screen-grid-layer.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,QAAQ,EACR,KAAK,EACL,oBAAoB,EACpB,mBAAmB,EACnB,KAAK,EAEL,UAAU,EACV,WAAW,EACX,QAAQ,EACR,gBAAgB,EAChB,YAAY,EACb,MAAM,eAAe,CAAC;AACvB,OAAO,EAAC,eAAe,EAAE,aAAa,EAAE,oBAAoB,EAAC,sCAAmC;AAChG,OAAO,gBAAgB,uCAAoC;AAiB3D,mDAAmD;AACnD,MAAM,MAAM,oBAAoB,CAAC,KAAK,GAAG,OAAO,IAAI,qBAAqB,CAAC,KAAK,CAAC,GAC9E,mBAAmB,CAAC;AAEtB,2CAA2C;AAC3C,MAAM,MAAM,qBAAqB,CAAC,KAAK,IAAI;IACzC;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB;;;OAGG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAE1B;;;OAGG;IACH,WAAW,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,CAAC;IAEtC;;;;OAIG;IACH,UAAU,CAAC,EAAE,KAAK,EAAE,CAAC;IAErB;;;;OAIG;IACH,cAAc,CAAC,EAAE,QAAQ,GAAG,UAAU,CAAC;IAEvC;;;;OAIG;IACH,WAAW,CAAC,EAAE,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;IAExC;;;;OAIG;IACH,SAAS,CAAC,EAAE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IAEpC;;;;OAIG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IAEzB;;;;;OAKG;IACH,WAAW,CAAC,EAAE,oBAAoB,CAAC;CACpC,CAAC;AAEF,MAAM,MAAM,0BAA0B,CAAC,KAAK,IAAI,WAAW,CAAC;IAC1D,mFAAmF;IACnF,GAAG,EAAE,MAAM,CAAC;IACZ,+EAA+E;IAC/E,GAAG,EAAE,MAAM,CAAC;IACZ,uBAAuB;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,+CAA+C;IAC/C,KAAK,EAAE,MAAM,CAAC;IACd,+FAA+F;IAC/F,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,+GAA+G;IAC/G,MAAM,CAAC,EAAE,KAAK,EAAE,CAAC;CAClB,CAAC,CAAC;AAEH,sEAAsE;AACtE,MAAM,CAAC,OAAO,OAAO,eAAe,CAClC,KAAK,GAAG,GAAG,EACX,UAAU,SAAS,EAAE,GAAG,EAAE,CAC1B,SAAQ,gBAAgB,CAAC,KAAK,EAAE,UAAU,GAAG,QAAQ,CAAC,qBAAqB,CAAC,KAAK,CAAC,CAAC,CAAC;IACpF,MAAM,CAAC,SAAS,SAAqB;IACrC,MAAM,CAAC,YAAY,8CAAgB;IAEnC,iBAAiB,IAAI,MAAM;IAM3B,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,eAAe,GAAG,aAAa;IA6C/D,eAAe;IAgBf,iBAAiB,CAAC,EAAC,WAAW,EAAC,EAAE,gBAAgB,CAAC,IAAI,CAAC;IAIvD,WAAW,CAAC,MAAM,EAAE,gBAAgB,CAAC,IAAI,CAAC;IAyC1C,iBAAiB,CAAC,EAAE,EAAE,MAAM;IAgB5B,YAAY,IAAI,UAAU,GAAG,KAAK,GAAG,IAAI;IAqCzC,cAAc,CAAC,MAAM,EAAE,oBAAoB,GAAG,0BAA0B,CAAC,KAAK,CAAC;CAyBhF"}
|
|
@@ -1,208 +1,191 @@
|
|
|
1
|
-
//
|
|
2
|
-
//
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
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 { log } from '@deck.gl/core';
|
|
21
|
-
import GPUGridAggregator from "../utils/gpu-grid-aggregation/gpu-grid-aggregator.js";
|
|
22
|
-
import { AGGREGATION_OPERATION, getValueFunc } from "../utils/aggregation-operation-utils.js";
|
|
1
|
+
// deck.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// Copyright (c) vis.gl contributors
|
|
4
|
+
import { project32 } from '@deck.gl/core';
|
|
5
|
+
import { WebGLAggregator, CPUAggregator } from "../common/aggregator/index.js";
|
|
6
|
+
import AggregationLayer from "../common/aggregation-layer.js";
|
|
23
7
|
import ScreenGridCellLayer from "./screen-grid-cell-layer.js";
|
|
24
|
-
import
|
|
25
|
-
import {
|
|
8
|
+
import { binOptionsUniforms } from "./bin-options-uniforms.js";
|
|
9
|
+
import { defaultColorRange } from "../common/utils/color-utils.js";
|
|
26
10
|
const defaultProps = {
|
|
27
|
-
|
|
11
|
+
cellSizePixels: { type: 'number', value: 100, min: 1 },
|
|
12
|
+
cellMarginPixels: { type: 'number', value: 2, min: 0 },
|
|
13
|
+
colorRange: defaultColorRange,
|
|
14
|
+
colorScaleType: 'linear',
|
|
28
15
|
getPosition: { type: 'accessor', value: (d) => d.position },
|
|
29
16
|
getWeight: { type: 'accessor', value: 1 },
|
|
30
|
-
gpuAggregation: false,
|
|
17
|
+
gpuAggregation: false,
|
|
31
18
|
aggregation: 'SUM'
|
|
32
19
|
};
|
|
33
|
-
const POSITION_ATTRIBUTE_NAME = 'positions';
|
|
34
|
-
const DIMENSIONS = {
|
|
35
|
-
data: {
|
|
36
|
-
props: ['cellSizePixels']
|
|
37
|
-
},
|
|
38
|
-
weights: {
|
|
39
|
-
props: ['aggregation'],
|
|
40
|
-
accessors: ['getWeight']
|
|
41
|
-
}
|
|
42
|
-
};
|
|
43
20
|
/** Aggregates data into histogram bins and renders them as a grid. */
|
|
44
|
-
class ScreenGridLayer extends
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
21
|
+
class ScreenGridLayer extends AggregationLayer {
|
|
22
|
+
getAggregatorType() {
|
|
23
|
+
return this.props.gpuAggregation && WebGLAggregator.isSupported(this.context.device)
|
|
24
|
+
? 'gpu'
|
|
25
|
+
: 'cpu';
|
|
26
|
+
}
|
|
27
|
+
createAggregator(type) {
|
|
28
|
+
if (type === 'cpu' || !WebGLAggregator.isSupported(this.context.device)) {
|
|
29
|
+
return new CPUAggregator({
|
|
30
|
+
dimensions: 2,
|
|
31
|
+
getBin: {
|
|
32
|
+
sources: ['positions'],
|
|
33
|
+
getValue: ({ positions }, index, opts) => {
|
|
34
|
+
const viewport = this.context.viewport;
|
|
35
|
+
const p = viewport.project(positions);
|
|
36
|
+
const cellSizePixels = opts.cellSizePixels;
|
|
37
|
+
if (p[0] < 0 || p[0] >= viewport.width || p[1] < 0 || p[1] >= viewport.height) {
|
|
38
|
+
// Not on screen
|
|
39
|
+
return null;
|
|
40
|
+
}
|
|
41
|
+
return [Math.floor(p[0] / cellSizePixels), Math.floor(p[1] / cellSizePixels)];
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
getValue: [{ sources: ['counts'], getValue: ({ counts }) => counts }]
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
return new WebGLAggregator(this.context.device, {
|
|
48
|
+
dimensions: 2,
|
|
49
|
+
channelCount: 1,
|
|
50
|
+
bufferLayout: this.getAttributeManager().getBufferLayouts({ isInstanced: false }),
|
|
51
|
+
...super.getShaders({
|
|
52
|
+
modules: [project32, binOptionsUniforms],
|
|
53
|
+
vs: `
|
|
54
|
+
in vec3 positions;
|
|
55
|
+
in vec3 positions64Low;
|
|
56
|
+
in float counts;
|
|
57
|
+
|
|
58
|
+
void getBin(out ivec2 binId) {
|
|
59
|
+
vec4 pos = project_position_to_clipspace(positions, positions64Low, vec3(0.0));
|
|
60
|
+
vec2 screenCoords = vec2(pos.x / pos.w + 1.0, 1.0 - pos.y / pos.w) / 2.0 * project.viewportSize / project.devicePixelRatio;
|
|
61
|
+
vec2 gridCoords = floor(screenCoords / binOptions.cellSizePixels);
|
|
62
|
+
binId = ivec2(gridCoords);
|
|
63
|
+
}
|
|
64
|
+
void getValue(out float weight) {
|
|
65
|
+
weight = counts;
|
|
66
|
+
}
|
|
67
|
+
`
|
|
68
|
+
})
|
|
68
69
|
});
|
|
70
|
+
}
|
|
71
|
+
initializeState() {
|
|
72
|
+
super.initializeState();
|
|
69
73
|
const attributeManager = this.getAttributeManager();
|
|
70
74
|
attributeManager.add({
|
|
71
|
-
|
|
75
|
+
positions: {
|
|
72
76
|
size: 3,
|
|
73
77
|
accessor: 'getPosition',
|
|
74
78
|
type: 'float64',
|
|
75
79
|
fp64: this.use64bitPositions()
|
|
76
80
|
},
|
|
77
81
|
// this attribute is used in gpu aggregation path only
|
|
78
|
-
|
|
82
|
+
counts: { size: 1, accessor: 'getWeight' }
|
|
79
83
|
});
|
|
80
84
|
}
|
|
81
85
|
shouldUpdateState({ changeFlags }) {
|
|
82
|
-
return
|
|
86
|
+
return changeFlags.somethingChanged;
|
|
83
87
|
}
|
|
84
|
-
updateState(
|
|
85
|
-
super.updateState(
|
|
88
|
+
updateState(params) {
|
|
89
|
+
const aggregatorChanged = super.updateState(params);
|
|
90
|
+
const { props, oldProps, changeFlags } = params;
|
|
91
|
+
const { cellSizePixels, aggregation } = props;
|
|
92
|
+
if (aggregatorChanged ||
|
|
93
|
+
changeFlags.dataChanged ||
|
|
94
|
+
changeFlags.updateTriggersChanged ||
|
|
95
|
+
changeFlags.viewportChanged ||
|
|
96
|
+
aggregation !== oldProps.aggregation ||
|
|
97
|
+
cellSizePixels !== oldProps.cellSizePixels) {
|
|
98
|
+
const { width, height } = this.context.viewport;
|
|
99
|
+
const { aggregator } = this.state;
|
|
100
|
+
if (aggregator instanceof WebGLAggregator) {
|
|
101
|
+
aggregator.setProps({
|
|
102
|
+
binIdRange: [
|
|
103
|
+
[0, Math.ceil(width / cellSizePixels)],
|
|
104
|
+
[0, Math.ceil(height / cellSizePixels)]
|
|
105
|
+
]
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
aggregator.setProps({
|
|
109
|
+
pointCount: this.getNumInstances(),
|
|
110
|
+
operations: [aggregation],
|
|
111
|
+
binOptions: {
|
|
112
|
+
cellSizePixels
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
if (changeFlags.viewportChanged) {
|
|
117
|
+
// Rerun aggregation on viewport change
|
|
118
|
+
this.state.aggregator.setNeedsUpdate();
|
|
119
|
+
}
|
|
120
|
+
return aggregatorChanged;
|
|
86
121
|
}
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
122
|
+
onAttributeChange(id) {
|
|
123
|
+
const { aggregator } = this.state;
|
|
124
|
+
switch (id) {
|
|
125
|
+
case 'positions':
|
|
126
|
+
aggregator.setNeedsUpdate();
|
|
127
|
+
break;
|
|
128
|
+
case 'counts':
|
|
129
|
+
aggregator.setNeedsUpdate(0);
|
|
130
|
+
break;
|
|
131
|
+
default:
|
|
132
|
+
// This should not happen
|
|
90
133
|
}
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
const {
|
|
134
|
+
}
|
|
135
|
+
renderLayers() {
|
|
136
|
+
const { aggregator } = this.state;
|
|
94
137
|
const CellLayerClass = this.getSubLayerClass('cells', ScreenGridCellLayer);
|
|
138
|
+
const binAttribute = aggregator.getBins();
|
|
139
|
+
const weightAttribute = aggregator.getResult(0);
|
|
95
140
|
return new CellLayerClass(this.props, this.getSubLayerProps({
|
|
96
|
-
id: 'cell-layer'
|
|
97
|
-
updateTriggers
|
|
141
|
+
id: 'cell-layer'
|
|
98
142
|
}), {
|
|
99
|
-
data: {
|
|
100
|
-
|
|
101
|
-
|
|
143
|
+
data: {
|
|
144
|
+
length: aggregator.binCount,
|
|
145
|
+
attributes: {
|
|
146
|
+
getBin: binAttribute,
|
|
147
|
+
getWeight: weightAttribute
|
|
148
|
+
}
|
|
149
|
+
},
|
|
150
|
+
// Data has changed shallowly, but we likely don't need to update the attributes
|
|
151
|
+
dataComparator: (data, oldData) => data.length === oldData.length,
|
|
152
|
+
updateTriggers: {
|
|
153
|
+
getBin: [binAttribute],
|
|
154
|
+
getWeight: [weightAttribute]
|
|
155
|
+
},
|
|
156
|
+
parameters: {
|
|
157
|
+
depthWriteEnabled: false,
|
|
158
|
+
...this.props.parameters
|
|
159
|
+
},
|
|
160
|
+
// Evaluate domain at draw() time
|
|
161
|
+
colorDomain: () => this.props.colorDomain || aggregator.getResultDomain(0),
|
|
162
|
+
// Extensions are already handled by the GPUAggregator, do not pass it down
|
|
163
|
+
extensions: []
|
|
102
164
|
});
|
|
103
165
|
}
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
const { aggregationBuffer, maxBuffer, maxTexture } = this.state;
|
|
107
|
-
aggregationBuffer?.delete();
|
|
108
|
-
maxBuffer?.delete();
|
|
109
|
-
maxTexture?.delete();
|
|
110
|
-
}
|
|
111
|
-
getPickingInfo({ info }) {
|
|
166
|
+
getPickingInfo(params) {
|
|
167
|
+
const info = params.info;
|
|
112
168
|
const { index } = info;
|
|
113
169
|
if (index >= 0) {
|
|
114
|
-
const
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
updateResults({ aggregationData, maxData }) {
|
|
130
|
-
const { count } = this.state.weights;
|
|
131
|
-
count.aggregationData = aggregationData;
|
|
132
|
-
count.aggregationBuffer.write(aggregationData);
|
|
133
|
-
count.maxData = maxData;
|
|
134
|
-
count.maxTexture.setImageData({ data: maxData });
|
|
135
|
-
}
|
|
136
|
-
/* eslint-disable complexity, max-statements */
|
|
137
|
-
updateAggregationState(opts) {
|
|
138
|
-
const cellSize = opts.props.cellSizePixels;
|
|
139
|
-
const cellSizeChanged = opts.oldProps.cellSizePixels !== cellSize;
|
|
140
|
-
const { viewportChanged } = opts.changeFlags;
|
|
141
|
-
let gpuAggregation = opts.props.gpuAggregation;
|
|
142
|
-
if (this.state.gpuAggregation !== opts.props.gpuAggregation) {
|
|
143
|
-
if (gpuAggregation && !GPUGridAggregator.isSupported(this.context.device)) {
|
|
144
|
-
log.warn('GPU Grid Aggregation not supported, falling back to CPU')();
|
|
145
|
-
gpuAggregation = false;
|
|
170
|
+
const bin = this.state.aggregator.getBin(index);
|
|
171
|
+
let object;
|
|
172
|
+
if (bin) {
|
|
173
|
+
object = {
|
|
174
|
+
col: bin.id[0],
|
|
175
|
+
row: bin.id[1],
|
|
176
|
+
value: bin.value[0],
|
|
177
|
+
count: bin.count
|
|
178
|
+
};
|
|
179
|
+
if (bin.pointIndices) {
|
|
180
|
+
object.pointIndices = bin.pointIndices;
|
|
181
|
+
object.points = Array.isArray(this.props.data)
|
|
182
|
+
? bin.pointIndices.map(i => this.props.data[i])
|
|
183
|
+
: [];
|
|
184
|
+
}
|
|
146
185
|
}
|
|
186
|
+
info.object = object;
|
|
147
187
|
}
|
|
148
|
-
|
|
149
|
-
this.setState({
|
|
150
|
-
gpuAggregation
|
|
151
|
-
});
|
|
152
|
-
const positionsChanged = this.isAttributeChanged(POSITION_ATTRIBUTE_NAME);
|
|
153
|
-
const { dimensions } = this.state;
|
|
154
|
-
const { data, weights } = dimensions;
|
|
155
|
-
const aggregationDataDirty = positionsChanged ||
|
|
156
|
-
gpuAggregationChanged ||
|
|
157
|
-
viewportChanged ||
|
|
158
|
-
this.isAggregationDirty(opts, {
|
|
159
|
-
compareAll: gpuAggregation, // check for all (including extentions props) when using gpu aggregation
|
|
160
|
-
dimension: data
|
|
161
|
-
});
|
|
162
|
-
const aggregationWeightsDirty = this.isAggregationDirty(opts, { dimension: weights });
|
|
163
|
-
this.setState({
|
|
164
|
-
aggregationDataDirty,
|
|
165
|
-
aggregationWeightsDirty
|
|
166
|
-
});
|
|
167
|
-
const { viewport } = this.context;
|
|
168
|
-
if (viewportChanged || cellSizeChanged) {
|
|
169
|
-
const { width, height } = viewport;
|
|
170
|
-
const numCol = Math.ceil(width / cellSize);
|
|
171
|
-
const numRow = Math.ceil(height / cellSize);
|
|
172
|
-
this.allocateResources(numRow, numCol);
|
|
173
|
-
this.setState({
|
|
174
|
-
// transformation from clipspace to screen(pixel) space
|
|
175
|
-
scaling: [width / 2, -height / 2, 1],
|
|
176
|
-
gridOffset: { xOffset: cellSize, yOffset: cellSize },
|
|
177
|
-
width,
|
|
178
|
-
height,
|
|
179
|
-
numCol,
|
|
180
|
-
numRow
|
|
181
|
-
});
|
|
182
|
-
}
|
|
183
|
-
if (aggregationWeightsDirty) {
|
|
184
|
-
this._updateAccessors(opts);
|
|
185
|
-
}
|
|
186
|
-
if (aggregationDataDirty || aggregationWeightsDirty) {
|
|
187
|
-
this._resetResults();
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
/* eslint-enable complexity, max-statements */
|
|
191
|
-
// Private
|
|
192
|
-
_updateAccessors(opts) {
|
|
193
|
-
const { getWeight, aggregation, data } = opts.props;
|
|
194
|
-
const { count } = this.state.weights;
|
|
195
|
-
if (count) {
|
|
196
|
-
count.getWeight = getWeight;
|
|
197
|
-
count.operation = AGGREGATION_OPERATION[aggregation];
|
|
198
|
-
}
|
|
199
|
-
this.setState({ getValue: getValueFunc(aggregation, getWeight, { data }) });
|
|
200
|
-
}
|
|
201
|
-
_resetResults() {
|
|
202
|
-
const { count } = this.state.weights;
|
|
203
|
-
if (count) {
|
|
204
|
-
count.aggregationData = null;
|
|
205
|
-
}
|
|
188
|
+
return info;
|
|
206
189
|
}
|
|
207
190
|
}
|
|
208
191
|
ScreenGridLayer.layerName = 'ScreenGridLayer';
|