@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,130 +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
|
-
import { GridCellLayer } from '@deck.gl/layers';
|
|
21
|
-
import { defaultColorRange } from "../utils/color-utils.js";
|
|
22
|
-
import { pointToDensityGridDataCPU } from "./grid-aggregator.js";
|
|
23
|
-
import CPUAggregator from "../utils/cpu-aggregator.js";
|
|
24
|
-
import AggregationLayer from "../aggregation-layer.js";
|
|
25
|
-
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
26
|
-
function nop() { }
|
|
27
|
-
const defaultProps = {
|
|
28
|
-
// color
|
|
29
|
-
colorDomain: null,
|
|
30
|
-
colorRange: defaultColorRange,
|
|
31
|
-
getColorValue: { type: 'accessor', value: null }, // default value is calculated from `getColorWeight` and `colorAggregation`
|
|
32
|
-
getColorWeight: { type: 'accessor', value: 1 },
|
|
33
|
-
colorAggregation: 'SUM',
|
|
34
|
-
lowerPercentile: { type: 'number', min: 0, max: 100, value: 0 },
|
|
35
|
-
upperPercentile: { type: 'number', min: 0, max: 100, value: 100 },
|
|
36
|
-
colorScaleType: 'quantize',
|
|
37
|
-
onSetColorDomain: nop,
|
|
38
|
-
// elevation
|
|
39
|
-
elevationDomain: null,
|
|
40
|
-
elevationRange: [0, 1000],
|
|
41
|
-
getElevationValue: { type: 'accessor', value: null }, // default value is calculated from `getElevationWeight` and `elevationAggregation`
|
|
42
|
-
getElevationWeight: { type: 'accessor', value: 1 },
|
|
43
|
-
elevationAggregation: 'SUM',
|
|
44
|
-
elevationLowerPercentile: { type: 'number', min: 0, max: 100, value: 0 },
|
|
45
|
-
elevationUpperPercentile: { type: 'number', min: 0, max: 100, value: 100 },
|
|
46
|
-
elevationScale: { type: 'number', min: 0, value: 1 },
|
|
47
|
-
elevationScaleType: 'linear',
|
|
48
|
-
onSetElevationDomain: nop,
|
|
49
|
-
gridAggregator: pointToDensityGridDataCPU,
|
|
50
|
-
// grid
|
|
51
|
-
cellSize: { type: 'number', min: 0, max: 1000, value: 1000 },
|
|
52
|
-
coverage: { type: 'number', min: 0, max: 1, value: 1 },
|
|
53
|
-
getPosition: { type: 'accessor', value: (x) => x.position },
|
|
54
|
-
extruded: false,
|
|
55
|
-
// Optional material for 'lighting' shader module
|
|
56
|
-
material: true,
|
|
57
|
-
// data filter
|
|
58
|
-
_filterData: { type: 'function', value: null, optional: true }
|
|
59
|
-
};
|
|
60
|
-
/** Aggregate data into a grid-based heatmap. Aggregation is performed on CPU. */
|
|
61
|
-
class CPUGridLayer extends AggregationLayer {
|
|
62
|
-
initializeState() {
|
|
63
|
-
const cpuAggregator = new CPUAggregator({
|
|
64
|
-
getAggregator: props => props.gridAggregator,
|
|
65
|
-
getCellSize: props => props.cellSize
|
|
66
|
-
});
|
|
67
|
-
this.state = {
|
|
68
|
-
cpuAggregator,
|
|
69
|
-
aggregatorState: cpuAggregator.state
|
|
70
|
-
};
|
|
71
|
-
const attributeManager = this.getAttributeManager();
|
|
72
|
-
attributeManager.add({
|
|
73
|
-
positions: { size: 3, type: 'float64', accessor: 'getPosition' }
|
|
74
|
-
});
|
|
75
|
-
// color and elevation attributes can't be added as attributes
|
|
76
|
-
// they are calcualted using 'getValue' accessor that takes an array of pints.
|
|
77
|
-
}
|
|
78
|
-
updateState(opts) {
|
|
79
|
-
super.updateState(opts);
|
|
80
|
-
this.setState({
|
|
81
|
-
// make a copy of the internal state of cpuAggregator for testing
|
|
82
|
-
aggregatorState: this.state.cpuAggregator.updateState(opts, {
|
|
83
|
-
viewport: this.context.viewport,
|
|
84
|
-
attributes: this.getAttributes(),
|
|
85
|
-
numInstances: this.getNumInstances()
|
|
86
|
-
})
|
|
87
|
-
});
|
|
88
|
-
}
|
|
89
|
-
getPickingInfo({ info }) {
|
|
90
|
-
return this.state.cpuAggregator.getPickingInfo({ info });
|
|
91
|
-
}
|
|
92
|
-
// create a method for testing
|
|
93
|
-
_onGetSublayerColor(cell) {
|
|
94
|
-
return this.state.cpuAggregator.getAccessor('fillColor')(cell);
|
|
95
|
-
}
|
|
96
|
-
// create a method for testing
|
|
97
|
-
_onGetSublayerElevation(cell) {
|
|
98
|
-
return this.state.cpuAggregator.getAccessor('elevation')(cell);
|
|
99
|
-
}
|
|
100
|
-
_getSublayerUpdateTriggers() {
|
|
101
|
-
return this.state.cpuAggregator.getUpdateTriggers(this.props);
|
|
102
|
-
}
|
|
103
|
-
renderLayers() {
|
|
104
|
-
const { elevationScale, extruded, cellSize, coverage, material, transitions } = this.props;
|
|
105
|
-
const { cpuAggregator } = this.state;
|
|
106
|
-
const SubLayerClass = this.getSubLayerClass('grid-cell', GridCellLayer);
|
|
107
|
-
const updateTriggers = this._getSublayerUpdateTriggers();
|
|
108
|
-
return new SubLayerClass({
|
|
109
|
-
cellSize,
|
|
110
|
-
coverage,
|
|
111
|
-
material,
|
|
112
|
-
elevationScale,
|
|
113
|
-
extruded,
|
|
114
|
-
getFillColor: this._onGetSublayerColor.bind(this),
|
|
115
|
-
getElevation: this._onGetSublayerElevation.bind(this),
|
|
116
|
-
transitions: transitions && {
|
|
117
|
-
getFillColor: transitions.getColorValue || transitions.getColorWeight,
|
|
118
|
-
getElevation: transitions.getElevationValue || transitions.getElevationWeight
|
|
119
|
-
}
|
|
120
|
-
}, this.getSubLayerProps({
|
|
121
|
-
id: 'grid-cell',
|
|
122
|
-
updateTriggers
|
|
123
|
-
}), {
|
|
124
|
-
data: cpuAggregator.state.layerData.data
|
|
125
|
-
});
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
CPUGridLayer.layerName = 'CPUGridLayer';
|
|
129
|
-
CPUGridLayer.defaultProps = defaultProps;
|
|
130
|
-
export default CPUGridLayer;
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
export type GridHash = {
|
|
2
|
-
[key: string]: {
|
|
3
|
-
count: number;
|
|
4
|
-
points: unknown[];
|
|
5
|
-
lonIdx: number;
|
|
6
|
-
latIdx: number;
|
|
7
|
-
};
|
|
8
|
-
};
|
|
9
|
-
/**
|
|
10
|
-
* Calculate density grid from an array of points
|
|
11
|
-
* @param {Object} props - object containing :
|
|
12
|
-
* @param {Iterable} [props.data] - data objects to be aggregated
|
|
13
|
-
* @param {Integer} [props.cellSize] - size of the grid cell
|
|
14
|
-
*
|
|
15
|
-
* @param {Object} aggregationParams - object containing :
|
|
16
|
-
* @param {Object} gridOffset - {xOffset, yOffset} cell size in meters
|
|
17
|
-
* @param {Integer} width - width of the grid
|
|
18
|
-
* @param {Integer} height - height of the grid
|
|
19
|
-
* @param {Boolean} projectPoints - `true` if doing screen space projection, `false` otherwise
|
|
20
|
-
* @param {Array} attributes - attributes array containing position values
|
|
21
|
-
* @param {Viewport} viewport - viewport to be used for projection
|
|
22
|
-
* @param {Array} posOffset - [xOffset, yOffset] offset to be applied to positions to get cell index
|
|
23
|
-
* @param {Object} boundingBox - {xMin, yMin, xMax, yMax} bounding box of input data
|
|
24
|
-
*
|
|
25
|
-
* @returns {object} - grid data, cell dimension
|
|
26
|
-
*/
|
|
27
|
-
export declare function pointToDensityGridDataCPU(props: any, aggregationParams: any): {
|
|
28
|
-
gridHash: GridHash;
|
|
29
|
-
gridOffset: {
|
|
30
|
-
xOffset: number;
|
|
31
|
-
yOffset: number;
|
|
32
|
-
};
|
|
33
|
-
data: any[];
|
|
34
|
-
};
|
|
35
|
-
//# sourceMappingURL=grid-aggregator.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"grid-aggregator.d.ts","sourceRoot":"","sources":["../../src/cpu-grid-layer/grid-aggregator.ts"],"names":[],"mappings":"AAuBA,MAAM,MAAM,QAAQ,GAAG;IACrB,CAAC,GAAG,EAAE,MAAM,GAAG;QACb,KAAK,EAAE,MAAM,CAAC;QACd,MAAM,EAAE,OAAO,EAAE,CAAC;QAClB,MAAM,EAAE,MAAM,CAAC;QACf,MAAM,EAAE,MAAM,CAAC;KAChB,CAAC;CACH,CAAC;AAEF;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,yBAAyB,CAAC,KAAK,KAAA,EAAE,iBAAiB,KAAA;;;;;;;EASjE"}
|
|
@@ -1,141 +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
|
-
import { createIterable } from '@deck.gl/core';
|
|
21
|
-
import { getGridOffset } from "../utils/grid-aggregation-utils.js";
|
|
22
|
-
/**
|
|
23
|
-
* Calculate density grid from an array of points
|
|
24
|
-
* @param {Object} props - object containing :
|
|
25
|
-
* @param {Iterable} [props.data] - data objects to be aggregated
|
|
26
|
-
* @param {Integer} [props.cellSize] - size of the grid cell
|
|
27
|
-
*
|
|
28
|
-
* @param {Object} aggregationParams - object containing :
|
|
29
|
-
* @param {Object} gridOffset - {xOffset, yOffset} cell size in meters
|
|
30
|
-
* @param {Integer} width - width of the grid
|
|
31
|
-
* @param {Integer} height - height of the grid
|
|
32
|
-
* @param {Boolean} projectPoints - `true` if doing screen space projection, `false` otherwise
|
|
33
|
-
* @param {Array} attributes - attributes array containing position values
|
|
34
|
-
* @param {Viewport} viewport - viewport to be used for projection
|
|
35
|
-
* @param {Array} posOffset - [xOffset, yOffset] offset to be applied to positions to get cell index
|
|
36
|
-
* @param {Object} boundingBox - {xMin, yMin, xMax, yMax} bounding box of input data
|
|
37
|
-
*
|
|
38
|
-
* @returns {object} - grid data, cell dimension
|
|
39
|
-
*/
|
|
40
|
-
export function pointToDensityGridDataCPU(props, aggregationParams) {
|
|
41
|
-
const hashInfo = pointsToGridHashing(props, aggregationParams);
|
|
42
|
-
const result = getGridLayerDataFromGridHash(hashInfo);
|
|
43
|
-
return {
|
|
44
|
-
gridHash: hashInfo.gridHash,
|
|
45
|
-
gridOffset: hashInfo.gridOffset,
|
|
46
|
-
data: result
|
|
47
|
-
};
|
|
48
|
-
}
|
|
49
|
-
/**
|
|
50
|
-
* Project points into each cell, return a hash table of cells
|
|
51
|
-
* @param {Iterable} points
|
|
52
|
-
* @param {number} cellSize - unit size in meters
|
|
53
|
-
* @param {function} getPosition - position accessor
|
|
54
|
-
* @returns {object} - grid hash and cell dimension
|
|
55
|
-
*/
|
|
56
|
-
/* eslint-disable-next-line max-statements, complexity */
|
|
57
|
-
function pointsToGridHashing(props, aggregationParams) {
|
|
58
|
-
const { data = [], cellSize } = props;
|
|
59
|
-
const { attributes, viewport, projectPoints, numInstances } = aggregationParams;
|
|
60
|
-
const positions = attributes.positions.value;
|
|
61
|
-
const { size } = attributes.positions.getAccessor();
|
|
62
|
-
const boundingBox = aggregationParams.boundingBox || getPositionBoundingBox(attributes.positions, numInstances);
|
|
63
|
-
const offsets = aggregationParams.posOffset || [180, 90];
|
|
64
|
-
const gridOffset = aggregationParams.gridOffset || getGridOffset(boundingBox, cellSize);
|
|
65
|
-
if (gridOffset.xOffset <= 0 || gridOffset.yOffset <= 0) {
|
|
66
|
-
return { gridHash: {}, gridOffset, offsets: [0, 0] };
|
|
67
|
-
}
|
|
68
|
-
const { width, height } = viewport;
|
|
69
|
-
const numCol = Math.ceil(width / gridOffset.xOffset);
|
|
70
|
-
const numRow = Math.ceil(height / gridOffset.yOffset);
|
|
71
|
-
// calculate count per cell
|
|
72
|
-
const gridHash = {};
|
|
73
|
-
const { iterable, objectInfo } = createIterable(data);
|
|
74
|
-
const position = new Array(3);
|
|
75
|
-
for (const pt of iterable) {
|
|
76
|
-
objectInfo.index++;
|
|
77
|
-
position[0] = positions[objectInfo.index * size];
|
|
78
|
-
position[1] = positions[objectInfo.index * size + 1];
|
|
79
|
-
position[2] = size >= 3 ? positions[objectInfo.index * size + 2] : 0;
|
|
80
|
-
const [x, y] = projectPoints ? viewport.project(position) : position;
|
|
81
|
-
if (Number.isFinite(x) && Number.isFinite(y)) {
|
|
82
|
-
const yIndex = Math.floor((y + offsets[1]) / gridOffset.yOffset);
|
|
83
|
-
const xIndex = Math.floor((x + offsets[0]) / gridOffset.xOffset);
|
|
84
|
-
if (!projectPoints ||
|
|
85
|
-
// when doing screen space agggregation (projectPoints = true), filter points outside of the viewport range.
|
|
86
|
-
(xIndex >= 0 && xIndex < numCol && yIndex >= 0 && yIndex < numRow)) {
|
|
87
|
-
const key = `${yIndex}-${xIndex}`;
|
|
88
|
-
gridHash[key] = gridHash[key] || { count: 0, points: [], lonIdx: xIndex, latIdx: yIndex };
|
|
89
|
-
gridHash[key].count += 1;
|
|
90
|
-
gridHash[key].points.push({
|
|
91
|
-
source: pt,
|
|
92
|
-
index: objectInfo.index
|
|
93
|
-
});
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
return { gridHash, gridOffset, offsets: [offsets[0] * -1, offsets[1] * -1] };
|
|
98
|
-
}
|
|
99
|
-
/* eslint-enable max-statements, complexity */
|
|
100
|
-
function getGridLayerDataFromGridHash({ gridHash, gridOffset, offsets }) {
|
|
101
|
-
const data = new Array(Object.keys(gridHash).length);
|
|
102
|
-
let i = 0;
|
|
103
|
-
for (const key in gridHash) {
|
|
104
|
-
const idxs = key.split('-');
|
|
105
|
-
const latIdx = parseInt(idxs[0], 10);
|
|
106
|
-
const lonIdx = parseInt(idxs[1], 10);
|
|
107
|
-
const index = i++;
|
|
108
|
-
data[index] = {
|
|
109
|
-
index,
|
|
110
|
-
position: [
|
|
111
|
-
offsets[0] + gridOffset.xOffset * lonIdx,
|
|
112
|
-
offsets[1] + gridOffset.yOffset * latIdx
|
|
113
|
-
],
|
|
114
|
-
...gridHash[key]
|
|
115
|
-
};
|
|
116
|
-
}
|
|
117
|
-
return data;
|
|
118
|
-
}
|
|
119
|
-
// Calculate bounding box of position attribute
|
|
120
|
-
function getPositionBoundingBox(positionAttribute, numInstance) {
|
|
121
|
-
// TODO - value might not exist (e.g. attribute transition)
|
|
122
|
-
const positions = positionAttribute.value;
|
|
123
|
-
const { size } = positionAttribute.getAccessor();
|
|
124
|
-
let yMin = Infinity;
|
|
125
|
-
let yMax = -Infinity;
|
|
126
|
-
let xMin = Infinity;
|
|
127
|
-
let xMax = -Infinity;
|
|
128
|
-
let y;
|
|
129
|
-
let x;
|
|
130
|
-
for (let i = 0; i < numInstance; i++) {
|
|
131
|
-
x = positions[i * size];
|
|
132
|
-
y = positions[i * size + 1];
|
|
133
|
-
if (Number.isFinite(x) && Number.isFinite(y)) {
|
|
134
|
-
yMin = y < yMin ? y : yMin;
|
|
135
|
-
yMax = y > yMax ? y : yMax;
|
|
136
|
-
xMin = x < xMin ? x : xMin;
|
|
137
|
-
xMax = x > xMax ? x : xMax;
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
return { xMin, xMax, yMin, yMax };
|
|
141
|
-
}
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
declare const _default: "#version 300 es\n#define SHADER_NAME gpu-grid-cell-layer-fragment-shader\n\nprecision highp float;\n\nin vec4 vColor;\n\nout vec4 fragColor;\n\nvoid main(void) {\n fragColor = vColor;\n fragColor = picking_filterColor(fragColor);\n}\n";
|
|
2
|
-
export default _default;
|
|
3
|
-
//# sourceMappingURL=gpu-grid-cell-layer-fragment.glsl.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"gpu-grid-cell-layer-fragment.glsl.d.ts","sourceRoot":"","sources":["../../src/gpu-grid-layer/gpu-grid-cell-layer-fragment.glsl.ts"],"names":[],"mappings":";AAoBA,wBAcE"}
|
|
@@ -1,30 +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 default `\
|
|
21
|
-
#version 300 es
|
|
22
|
-
#define SHADER_NAME gpu-grid-cell-layer-fragment-shader
|
|
23
|
-
precision highp float;
|
|
24
|
-
in vec4 vColor;
|
|
25
|
-
out vec4 fragColor;
|
|
26
|
-
void main(void) {
|
|
27
|
-
fragColor = vColor;
|
|
28
|
-
fragColor = picking_filterColor(fragColor);
|
|
29
|
-
}
|
|
30
|
-
`;
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
declare const _default: "#version 300 es\n#define SHADER_NAME gpu-grid-cell-layer-vertex-shader\n#define RANGE_COUNT 6\n\nin vec3 positions;\nin vec3 normals;\n\nin vec4 colors;\nin vec4 elevations;\nin vec3 instancePickingColors;\n\n// Custom uniforms\nuniform vec2 offset;\nuniform bool extruded;\nuniform float cellSize;\nuniform float coverage;\nuniform float opacity;\nuniform float elevationScale;\n\nuniform ivec2 gridSize;\nuniform vec2 gridOrigin;\nuniform vec2 gridOriginLow;\nuniform vec2 gridOffset;\nuniform vec2 gridOffsetLow;\nuniform vec4 colorRange[RANGE_COUNT];\nuniform vec2 elevationRange;\n\n// Domain uniforms\nuniform vec2 colorDomain;\nuniform bool colorDomainValid;\nuniform vec2 elevationDomain;\nuniform bool elevationDomainValid;\n\nlayout(std140) uniform;\nuniform ColorData\n{\n vec4 maxMinCount;\n} colorData;\nuniform ElevationData\n{\n vec4 maxMinCount;\n} elevationData;\n\n#define EPSILON 0.00001\n\n// Result\nout vec4 vColor;\n\nvec4 quantizeScale(vec2 domain, vec4 range[RANGE_COUNT], float value) {\n vec4 outColor = vec4(0., 0., 0., 0.);\n if (value >= (domain.x - EPSILON) && value <= (domain.y + EPSILON)) {\n float domainRange = domain.y - domain.x;\n if (domainRange <= 0.) {\n outColor = colorRange[0];\n } else {\n float rangeCount = float(RANGE_COUNT);\n float rangeStep = domainRange / rangeCount;\n float idx = floor((value - domain.x) / rangeStep);\n idx = clamp(idx, 0., rangeCount - 1.);\n int intIdx = int(idx);\n outColor = colorRange[intIdx];\n }\n }\n return outColor;\n}\n\nfloat linearScale(vec2 domain, vec2 range, float value) {\n if (value >= (domain.x - EPSILON) && value <= (domain.y + EPSILON)) {\n return ((value - domain.x) / (domain.y - domain.x)) * (range.y - range.x) + range.x;\n }\n return -1.;\n}\n\nvoid main(void) {\n vec2 clrDomain = colorDomainValid ? colorDomain : vec2(colorData.maxMinCount.a, colorData.maxMinCount.r);\n vec4 color = quantizeScale(clrDomain, colorRange, colors.r);\n\n float elevation = 0.0;\n\n if (extruded) {\n vec2 elvDomain = elevationDomainValid ? elevationDomain : vec2(elevationData.maxMinCount.a, elevationData.maxMinCount.r);\n elevation = linearScale(elvDomain, elevationRange, elevations.r);\n elevation = elevation * (positions.z + 1.0) / 2.0 * elevationScale;\n }\n\n // if aggregated color or elevation is 0 do not render\n float shouldRender = float(color.r > 0.0 && elevations.r >= 0.0);\n float dotRadius = cellSize / 2. * coverage * shouldRender;\n\n int yIndex = (gl_InstanceID / gridSize[0]);\n int xIndex = gl_InstanceID - (yIndex * gridSize[0]);\n\n vec2 instancePositionXFP64 = mul_fp64(vec2(gridOffset[0], gridOffsetLow[0]), vec2(float(xIndex), 0.));\n instancePositionXFP64 = sum_fp64(instancePositionXFP64, vec2(gridOrigin[0], gridOriginLow[0]));\n vec2 instancePositionYFP64 = mul_fp64(vec2(gridOffset[1], gridOffsetLow[1]), vec2(float(yIndex), 0.));\n instancePositionYFP64 = sum_fp64(instancePositionYFP64, vec2(gridOrigin[1], gridOriginLow[1]));\n\n vec3 centroidPosition = vec3(instancePositionXFP64[0], instancePositionYFP64[0], elevation);\n vec3 centroidPosition64Low = vec3(instancePositionXFP64[1], instancePositionYFP64[1], 0.0);\n geometry.worldPosition = centroidPosition;\n vec3 pos = vec3(project_size(positions.xy + offset) * dotRadius, 0.);\n\n // Set color to be rendered to picking fbo (also used to check for selection highlight).\n picking_setPickingColor(instancePickingColors);\n\n gl_Position = project_position_to_clipspace(centroidPosition, centroidPosition64Low, pos, geometry.position);\n\n // Light calculations\n // Worldspace is the linear space after Mercator projection\n\n vec3 normals_commonspace = project_normal(normals);\n\n if (extruded) {\n vec3 lightColor = lighting_getLightColor(color.rgb, project_uCameraPosition, geometry.position.xyz, normals_commonspace);\n vColor = vec4(lightColor, color.a * opacity) / 255.;\n } else {\n vColor = vec4(color.rgb, color.a * opacity) / 255.;\n }\n}\n";
|
|
2
|
-
export default _default;
|
|
3
|
-
//# sourceMappingURL=gpu-grid-cell-layer-vertex.glsl.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"gpu-grid-cell-layer-vertex.glsl.d.ts","sourceRoot":"","sources":["../../src/gpu-grid-layer/gpu-grid-cell-layer-vertex.glsl.ts"],"names":[],"mappings":";AAsBA,wBAwHE"}
|
|
@@ -1,112 +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
|
-
// Inspired by screen-grid-layer vertex shader in deck.gl
|
|
21
|
-
export default `\
|
|
22
|
-
#version 300 es
|
|
23
|
-
#define SHADER_NAME gpu-grid-cell-layer-vertex-shader
|
|
24
|
-
#define RANGE_COUNT 6
|
|
25
|
-
in vec3 positions;
|
|
26
|
-
in vec3 normals;
|
|
27
|
-
in vec4 colors;
|
|
28
|
-
in vec4 elevations;
|
|
29
|
-
in vec3 instancePickingColors;
|
|
30
|
-
uniform vec2 offset;
|
|
31
|
-
uniform bool extruded;
|
|
32
|
-
uniform float cellSize;
|
|
33
|
-
uniform float coverage;
|
|
34
|
-
uniform float opacity;
|
|
35
|
-
uniform float elevationScale;
|
|
36
|
-
uniform ivec2 gridSize;
|
|
37
|
-
uniform vec2 gridOrigin;
|
|
38
|
-
uniform vec2 gridOriginLow;
|
|
39
|
-
uniform vec2 gridOffset;
|
|
40
|
-
uniform vec2 gridOffsetLow;
|
|
41
|
-
uniform vec4 colorRange[RANGE_COUNT];
|
|
42
|
-
uniform vec2 elevationRange;
|
|
43
|
-
uniform vec2 colorDomain;
|
|
44
|
-
uniform bool colorDomainValid;
|
|
45
|
-
uniform vec2 elevationDomain;
|
|
46
|
-
uniform bool elevationDomainValid;
|
|
47
|
-
layout(std140) uniform;
|
|
48
|
-
uniform ColorData
|
|
49
|
-
{
|
|
50
|
-
vec4 maxMinCount;
|
|
51
|
-
} colorData;
|
|
52
|
-
uniform ElevationData
|
|
53
|
-
{
|
|
54
|
-
vec4 maxMinCount;
|
|
55
|
-
} elevationData;
|
|
56
|
-
#define EPSILON 0.00001
|
|
57
|
-
out vec4 vColor;
|
|
58
|
-
vec4 quantizeScale(vec2 domain, vec4 range[RANGE_COUNT], float value) {
|
|
59
|
-
vec4 outColor = vec4(0., 0., 0., 0.);
|
|
60
|
-
if (value >= (domain.x - EPSILON) && value <= (domain.y + EPSILON)) {
|
|
61
|
-
float domainRange = domain.y - domain.x;
|
|
62
|
-
if (domainRange <= 0.) {
|
|
63
|
-
outColor = colorRange[0];
|
|
64
|
-
} else {
|
|
65
|
-
float rangeCount = float(RANGE_COUNT);
|
|
66
|
-
float rangeStep = domainRange / rangeCount;
|
|
67
|
-
float idx = floor((value - domain.x) / rangeStep);
|
|
68
|
-
idx = clamp(idx, 0., rangeCount - 1.);
|
|
69
|
-
int intIdx = int(idx);
|
|
70
|
-
outColor = colorRange[intIdx];
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
return outColor;
|
|
74
|
-
}
|
|
75
|
-
float linearScale(vec2 domain, vec2 range, float value) {
|
|
76
|
-
if (value >= (domain.x - EPSILON) && value <= (domain.y + EPSILON)) {
|
|
77
|
-
return ((value - domain.x) / (domain.y - domain.x)) * (range.y - range.x) + range.x;
|
|
78
|
-
}
|
|
79
|
-
return -1.;
|
|
80
|
-
}
|
|
81
|
-
void main(void) {
|
|
82
|
-
vec2 clrDomain = colorDomainValid ? colorDomain : vec2(colorData.maxMinCount.a, colorData.maxMinCount.r);
|
|
83
|
-
vec4 color = quantizeScale(clrDomain, colorRange, colors.r);
|
|
84
|
-
float elevation = 0.0;
|
|
85
|
-
if (extruded) {
|
|
86
|
-
vec2 elvDomain = elevationDomainValid ? elevationDomain : vec2(elevationData.maxMinCount.a, elevationData.maxMinCount.r);
|
|
87
|
-
elevation = linearScale(elvDomain, elevationRange, elevations.r);
|
|
88
|
-
elevation = elevation * (positions.z + 1.0) / 2.0 * elevationScale;
|
|
89
|
-
}
|
|
90
|
-
float shouldRender = float(color.r > 0.0 && elevations.r >= 0.0);
|
|
91
|
-
float dotRadius = cellSize / 2. * coverage * shouldRender;
|
|
92
|
-
int yIndex = (gl_InstanceID / gridSize[0]);
|
|
93
|
-
int xIndex = gl_InstanceID - (yIndex * gridSize[0]);
|
|
94
|
-
vec2 instancePositionXFP64 = mul_fp64(vec2(gridOffset[0], gridOffsetLow[0]), vec2(float(xIndex), 0.));
|
|
95
|
-
instancePositionXFP64 = sum_fp64(instancePositionXFP64, vec2(gridOrigin[0], gridOriginLow[0]));
|
|
96
|
-
vec2 instancePositionYFP64 = mul_fp64(vec2(gridOffset[1], gridOffsetLow[1]), vec2(float(yIndex), 0.));
|
|
97
|
-
instancePositionYFP64 = sum_fp64(instancePositionYFP64, vec2(gridOrigin[1], gridOriginLow[1]));
|
|
98
|
-
vec3 centroidPosition = vec3(instancePositionXFP64[0], instancePositionYFP64[0], elevation);
|
|
99
|
-
vec3 centroidPosition64Low = vec3(instancePositionXFP64[1], instancePositionYFP64[1], 0.0);
|
|
100
|
-
geometry.worldPosition = centroidPosition;
|
|
101
|
-
vec3 pos = vec3(project_size(positions.xy + offset) * dotRadius, 0.);
|
|
102
|
-
picking_setPickingColor(instancePickingColors);
|
|
103
|
-
gl_Position = project_position_to_clipspace(centroidPosition, centroidPosition64Low, pos, geometry.position);
|
|
104
|
-
vec3 normals_commonspace = project_normal(normals);
|
|
105
|
-
if (extruded) {
|
|
106
|
-
vec3 lightColor = lighting_getLightColor(color.rgb, project_uCameraPosition, geometry.position.xyz, normals_commonspace);
|
|
107
|
-
vColor = vec4(lightColor, color.a * opacity) / 255.;
|
|
108
|
-
} else {
|
|
109
|
-
vColor = vec4(color.rgb, color.a * opacity) / 255.;
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
`;
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { Layer, LayerProps, DefaultProps } from '@deck.gl/core';
|
|
2
|
-
import { Model } from '@luma.gl/engine';
|
|
3
|
-
import { Buffer } from '@luma.gl/core';
|
|
4
|
-
import type { _GPUGridLayerProps } from "./gpu-grid-layer.js";
|
|
5
|
-
type _GPUGridCellLayerProps = _GPUGridLayerProps<any> & {
|
|
6
|
-
cellSize: number;
|
|
7
|
-
offset: number[];
|
|
8
|
-
coverage: number;
|
|
9
|
-
extruded: boolean;
|
|
10
|
-
elevationScale: number;
|
|
11
|
-
elevationRange: [number, number];
|
|
12
|
-
gridSize: number[];
|
|
13
|
-
gridOrigin: number[];
|
|
14
|
-
gridOffset: number[];
|
|
15
|
-
colorMaxMinBuffer: Buffer;
|
|
16
|
-
elevationMaxMinBuffer: Buffer;
|
|
17
|
-
};
|
|
18
|
-
export default class GPUGridCellLayer extends Layer<_GPUGridCellLayerProps> {
|
|
19
|
-
static layerName: string;
|
|
20
|
-
static defaultProps: DefaultProps<_GPUGridLayerProps<any> & {
|
|
21
|
-
cellSize: number;
|
|
22
|
-
offset: number[];
|
|
23
|
-
coverage: number;
|
|
24
|
-
extruded: boolean;
|
|
25
|
-
elevationScale: number;
|
|
26
|
-
elevationRange: [number, number];
|
|
27
|
-
gridSize: number[];
|
|
28
|
-
gridOrigin: number[];
|
|
29
|
-
gridOffset: number[];
|
|
30
|
-
colorMaxMinBuffer: Buffer;
|
|
31
|
-
elevationMaxMinBuffer: Buffer;
|
|
32
|
-
} & LayerProps>;
|
|
33
|
-
state: {
|
|
34
|
-
model?: Model;
|
|
35
|
-
};
|
|
36
|
-
getShaders(): any;
|
|
37
|
-
initializeState(): void;
|
|
38
|
-
_getModel(): Model;
|
|
39
|
-
draw({ uniforms }: {
|
|
40
|
-
uniforms: any;
|
|
41
|
-
}): void;
|
|
42
|
-
bindUniformBuffers(colorMaxMinBuffer: any, elevationMaxMinBuffer: any): void;
|
|
43
|
-
unbindUniformBuffers(colorMaxMinBuffer: any, elevationMaxMinBuffer: any): void;
|
|
44
|
-
getDomainUniforms(): Record<string, any>;
|
|
45
|
-
private _setupUniformBuffer;
|
|
46
|
-
}
|
|
47
|
-
export {};
|
|
48
|
-
//# sourceMappingURL=gpu-grid-cell-layer.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"gpu-grid-cell-layer.d.ts","sourceRoot":"","sources":["../../src/gpu-grid-layer/gpu-grid-cell-layer.ts"],"names":[],"mappings":"AAoBA,OAAO,EACL,KAAK,EAKL,UAAU,EACV,YAAY,EACb,MAAM,eAAe,CAAC;AAGvB,OAAO,EAAC,KAAK,EAAC,MAAM,iBAAiB,CAAC;AACtC,OAAO,EAAC,MAAM,EAAC,MAAM,eAAe,CAAC;AAGrC,OAAO,KAAK,EAAC,kBAAkB,EAAC,4BAAyB;AA8BzD,KAAK,sBAAsB,GAAG,kBAAkB,CAAC,GAAG,CAAC,GAAG;IACtD,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,OAAO,CAAC;IAClB,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,qBAAqB,EAAE,MAAM,CAAC;CAC/B,CAAC;AAEF,MAAM,CAAC,OAAO,OAAO,gBAAiB,SAAQ,KAAK,CAAC,sBAAsB,CAAC;IACzE,MAAM,CAAC,SAAS,SAAsB;IACtC,MAAM,CAAC,YAAY;;;;;;;;;;;;oBAAgB;IAEnC,KAAK,EAAG;QACN,KAAK,CAAC,EAAE,KAAK,CAAC;KACf,CAAC;IAEF,UAAU;IAQV,eAAe,IAAI,IAAI;IAiBvB,SAAS,IAAI,KAAK;IASlB,IAAI,CAAC,EAAC,QAAQ,EAAC;;KAAA;IAyCf,kBAAkB,CAAC,iBAAiB,KAAA,EAAE,qBAAqB,KAAA;IAK3D,oBAAoB,CAAC,iBAAiB,KAAA,EAAE,qBAAqB,KAAA;IAK7D,iBAAiB;IAkBjB,OAAO,CAAC,mBAAmB;CAU5B"}
|