@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
package/dist/index.d.ts
CHANGED
|
@@ -1,20 +1,14 @@
|
|
|
1
1
|
export { default as ScreenGridLayer } from "./screen-grid-layer/screen-grid-layer.js";
|
|
2
|
-
export { default as CPUGridLayer } from "./cpu-grid-layer/cpu-grid-layer.js";
|
|
3
2
|
export { default as HexagonLayer } from "./hexagon-layer/hexagon-layer.js";
|
|
4
3
|
export { default as ContourLayer } from "./contour-layer/contour-layer.js";
|
|
5
4
|
export { default as GridLayer } from "./grid-layer/grid-layer.js";
|
|
6
|
-
export { default as GPUGridLayer } from "./gpu-grid-layer/gpu-grid-layer.js";
|
|
7
|
-
export { AGGREGATION_OPERATION } from "./utils/aggregation-operation-utils.js";
|
|
8
5
|
export { default as HeatmapLayer } from "./heatmap-layer/heatmap-layer.js";
|
|
9
|
-
export { default as
|
|
10
|
-
export {
|
|
11
|
-
export {
|
|
12
|
-
export { default as _BinSorter } from "./utils/bin-sorter.js";
|
|
13
|
-
export type { ContourLayerProps } from "./contour-layer/contour-layer.js";
|
|
6
|
+
export { default as _AggregationLayer } from "./common/aggregation-layer.js";
|
|
7
|
+
export { WebGLAggregator, CPUAggregator } from "./common/aggregator/index.js";
|
|
8
|
+
export type { ContourLayerProps, ContourLayerPickingInfo } from "./contour-layer/contour-layer.js";
|
|
14
9
|
export type { HeatmapLayerProps } from "./heatmap-layer/heatmap-layer.js";
|
|
15
|
-
export type { HexagonLayerProps } from "./hexagon-layer/hexagon-layer.js";
|
|
16
|
-
export type {
|
|
17
|
-
export type {
|
|
18
|
-
export type {
|
|
19
|
-
export type { ScreenGridLayerProps } from "./screen-grid-layer/screen-grid-layer.js";
|
|
10
|
+
export type { HexagonLayerProps, HexagonLayerPickingInfo } from "./hexagon-layer/hexagon-layer.js";
|
|
11
|
+
export type { GridLayerProps, GridLayerPickingInfo } from "./grid-layer/grid-layer.js";
|
|
12
|
+
export type { ScreenGridLayerProps, ScreenGridLayerPickingInfo } from "./screen-grid-layer/screen-grid-layer.js";
|
|
13
|
+
export type { Aggregator, AggregationOperation, AggregationProps, WebGLAggregatorProps, CPUAggregatorProps } from "./common/aggregator/index.js";
|
|
20
14
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,OAAO,IAAI,eAAe,EAAC,iDAA8C;AACjF,OAAO,EAAC,OAAO,IAAI,YAAY,EAAC,yCAAsC;AACtE,OAAO,EAAC,OAAO,IAAI,YAAY,EAAC,yCAAsC;AACtE,OAAO,EAAC,OAAO,IAAI,SAAS,EAAC,mCAAgC;AAC7D,OAAO,EAAC,OAAO,IAAI,YAAY,EAAC,yCAAsC;AAEtE,OAAO,EAAC,OAAO,IAAI,iBAAiB,EAAC,sCAAmC;AACxE,OAAO,EAAC,eAAe,EAAE,aAAa,EAAC,qCAAkC;AAGzE,YAAY,EAAC,iBAAiB,EAAE,uBAAuB,EAAC,yCAAsC;AAC9F,YAAY,EAAC,iBAAiB,EAAC,yCAAsC;AACrE,YAAY,EAAC,iBAAiB,EAAE,uBAAuB,EAAC,yCAAsC;AAC9F,YAAY,EAAC,cAAc,EAAE,oBAAoB,EAAC,mCAAgC;AAClF,YAAY,EACV,oBAAoB,EACpB,0BAA0B,EAC3B,iDAA8C;AAE/C,YAAY,EACV,UAAU,EACV,oBAAoB,EACpB,gBAAgB,EAChB,oBAAoB,EACpB,kBAAkB,EACnB,qCAAkC"}
|
package/dist/index.js
CHANGED
|
@@ -1,32 +1,10 @@
|
|
|
1
|
-
//
|
|
2
|
-
//
|
|
3
|
-
//
|
|
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.
|
|
1
|
+
// deck.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// Copyright (c) vis.gl contributors
|
|
20
4
|
export { default as ScreenGridLayer } from "./screen-grid-layer/screen-grid-layer.js";
|
|
21
|
-
export { default as CPUGridLayer } from "./cpu-grid-layer/cpu-grid-layer.js";
|
|
22
5
|
export { default as HexagonLayer } from "./hexagon-layer/hexagon-layer.js";
|
|
23
6
|
export { default as ContourLayer } from "./contour-layer/contour-layer.js";
|
|
24
7
|
export { default as GridLayer } from "./grid-layer/grid-layer.js";
|
|
25
|
-
export { default as GPUGridLayer } from "./gpu-grid-layer/gpu-grid-layer.js";
|
|
26
|
-
export { AGGREGATION_OPERATION } from "./utils/aggregation-operation-utils.js";
|
|
27
|
-
// experimental export
|
|
28
8
|
export { default as HeatmapLayer } from "./heatmap-layer/heatmap-layer.js";
|
|
29
|
-
export { default as
|
|
30
|
-
export {
|
|
31
|
-
export { default as _AggregationLayer } from "./aggregation-layer.js";
|
|
32
|
-
export { default as _BinSorter } from "./utils/bin-sorter.js";
|
|
9
|
+
export { default as _AggregationLayer } from "./common/aggregation-layer.js";
|
|
10
|
+
export { WebGLAggregator, CPUAggregator } from "./common/aggregator/index.js";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export type BinOptions = {
|
|
2
|
+
cellSizePixels: number;
|
|
3
|
+
};
|
|
4
|
+
export declare const binOptionsUniforms: {
|
|
5
|
+
readonly name: "binOptions";
|
|
6
|
+
readonly vs: "uniform binOptionsUniforms {\n float cellSizePixels;\n} binOptions;\n";
|
|
7
|
+
readonly uniformTypes: {
|
|
8
|
+
readonly cellSizePixels: "f32";
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=bin-options-uniforms.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bin-options-uniforms.d.ts","sourceRoot":"","sources":["../../src/screen-grid-layer/bin-options-uniforms.ts"],"names":[],"mappings":"AAYA,MAAM,MAAM,UAAU,GAAG;IACvB,cAAc,EAAE,MAAM,CAAC;CACxB,CAAC;AAEF,eAAO,MAAM,kBAAkB;;;;;;CAMc,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// deck.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// Copyright (c) vis.gl contributors
|
|
4
|
+
const uniformBlock = /* glsl */ `\
|
|
5
|
+
uniform binOptionsUniforms {
|
|
6
|
+
float cellSizePixels;
|
|
7
|
+
} binOptions;
|
|
8
|
+
`;
|
|
9
|
+
export const binOptionsUniforms = {
|
|
10
|
+
name: 'binOptions',
|
|
11
|
+
vs: uniformBlock,
|
|
12
|
+
uniformTypes: {
|
|
13
|
+
cellSizePixels: 'f32'
|
|
14
|
+
}
|
|
15
|
+
};
|
|
@@ -1,19 +1,21 @@
|
|
|
1
1
|
import { Texture } from '@luma.gl/core';
|
|
2
2
|
import { Model } from '@luma.gl/engine';
|
|
3
|
-
import { Layer,
|
|
4
|
-
import type { _ScreenGridLayerProps } from "./screen-grid-layer.js";
|
|
3
|
+
import { Layer, UpdateParameters, Color } from '@deck.gl/core';
|
|
5
4
|
import { ShaderModule } from '@luma.gl/shadertools';
|
|
6
|
-
|
|
7
|
-
export type ScreenGridCellLayerProps<DataT = unknown> = _ScreenGridCellLayerProps<DataT> & LayerProps;
|
|
5
|
+
import type { ScaleType } from "../common/types.js";
|
|
8
6
|
/** Proprties added by ScreenGridCellLayer. */
|
|
9
|
-
export type _ScreenGridCellLayerProps
|
|
10
|
-
|
|
7
|
+
export type _ScreenGridCellLayerProps = {
|
|
8
|
+
cellSizePixels: number;
|
|
9
|
+
cellMarginPixels: number;
|
|
10
|
+
colorScaleType: ScaleType;
|
|
11
|
+
colorDomain: () => [number, number];
|
|
12
|
+
colorRange?: Color[];
|
|
11
13
|
};
|
|
12
|
-
export default class ScreenGridCellLayer<
|
|
14
|
+
export default class ScreenGridCellLayer<ExtraPropsT extends {} = {}> extends Layer<ExtraPropsT & Required<_ScreenGridCellLayerProps>> {
|
|
13
15
|
static layerName: string;
|
|
14
|
-
static defaultProps: DefaultProps<ScreenGridCellLayerProps<unknown>>;
|
|
15
16
|
state: {
|
|
16
17
|
model?: Model;
|
|
18
|
+
colorTexture: Texture;
|
|
17
19
|
};
|
|
18
20
|
getShaders(): {
|
|
19
21
|
vs: string;
|
|
@@ -21,18 +23,11 @@ export default class ScreenGridCellLayer<DataT = any, ExtraPropsT extends {} = {
|
|
|
21
23
|
modules: ShaderModule[];
|
|
22
24
|
};
|
|
23
25
|
initializeState(): void;
|
|
24
|
-
shouldUpdateState({ changeFlags }: {
|
|
25
|
-
changeFlags: any;
|
|
26
|
-
}): any;
|
|
27
26
|
updateState(params: UpdateParameters<this>): void;
|
|
27
|
+
finalizeState(context: any): void;
|
|
28
28
|
draw({ uniforms }: {
|
|
29
29
|
uniforms: any;
|
|
30
30
|
}): void;
|
|
31
|
-
calculateInstancePositions(attribute: any, { numInstances }: {
|
|
32
|
-
numInstances: any;
|
|
33
|
-
}): void;
|
|
34
31
|
_getModel(): Model;
|
|
35
|
-
_shouldUseMinMax(): boolean;
|
|
36
|
-
_updateUniforms(oldProps: any, props: any, changeFlags: any): void;
|
|
37
32
|
}
|
|
38
33
|
//# sourceMappingURL=screen-grid-cell-layer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"screen-grid-cell-layer.d.ts","sourceRoot":"","sources":["../../src/screen-grid-layer/screen-grid-cell-layer.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"screen-grid-cell-layer.d.ts","sourceRoot":"","sources":["../../src/screen-grid-layer/screen-grid-cell-layer.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,OAAO,EAAC,MAAM,eAAe,CAAC;AACtC,OAAO,EAAC,KAAK,EAAW,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAC,KAAK,EAAW,gBAAgB,EAAgB,KAAK,EAAC,MAAM,eAAe,CAAC;AAKpF,OAAO,EAAC,YAAY,EAAC,MAAM,sBAAsB,CAAC;AAClD,OAAO,KAAK,EAAC,SAAS,EAAC,2BAAwB;AAE/C,8CAA8C;AAC9C,MAAM,MAAM,yBAAyB,GAAG;IACtC,cAAc,EAAE,MAAM,CAAC;IACvB,gBAAgB,EAAE,MAAM,CAAC;IACzB,cAAc,EAAE,SAAS,CAAC;IAC1B,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACpC,UAAU,CAAC,EAAE,KAAK,EAAE,CAAC;CACtB,CAAC;AAEF,MAAM,CAAC,OAAO,OAAO,mBAAmB,CAAC,WAAW,SAAS,EAAE,GAAG,EAAE,CAAE,SAAQ,KAAK,CACjF,WAAW,GAAG,QAAQ,CAAC,yBAAyB,CAAC,CAClD;IACC,MAAM,CAAC,SAAS,SAAyB;IAEzC,KAAK,EAAG;QACN,KAAK,CAAC,EAAE,KAAK,CAAC;QACd,YAAY,EAAE,OAAO,CAAC;KACvB,CAAC;IAEF,UAAU,IAAI;QAAC,EAAE,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,YAAY,EAAE,CAAA;KAAC;IAI/D,eAAe;IAiBf,WAAW,CAAC,MAAM,EAAE,gBAAgB,CAAC,IAAI,CAAC;IAoC1C,aAAa,CAAC,OAAO,KAAA;IAMrB,IAAI,CAAC,EAAC,QAAQ,EAAC;;KAAA;IAWf,SAAS,IAAI,KAAK;CAiBnB"}
|
|
@@ -1,107 +1,68 @@
|
|
|
1
|
-
//
|
|
2
|
-
//
|
|
3
|
-
//
|
|
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.
|
|
1
|
+
// deck.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// Copyright (c) vis.gl contributors
|
|
20
4
|
import { Model, Geometry } from '@luma.gl/engine';
|
|
21
|
-
import { Layer,
|
|
22
|
-
import {
|
|
5
|
+
import { Layer, picking } from '@deck.gl/core';
|
|
6
|
+
import { createColorRangeTexture, updateColorRangeTexture } from "../common/utils/color-utils.js";
|
|
23
7
|
import vs from "./screen-grid-layer-vertex.glsl.js";
|
|
24
8
|
import fs from "./screen-grid-layer-fragment.glsl.js";
|
|
25
|
-
|
|
26
|
-
const DEFAULT_MAXCOLOR = [0, 255, 0, 255];
|
|
27
|
-
const COLOR_PROPS = ['minColor', 'maxColor', 'colorRange', 'colorDomain'];
|
|
28
|
-
const defaultProps = {
|
|
29
|
-
cellSizePixels: { type: 'number', value: 100, min: 1 },
|
|
30
|
-
cellMarginPixels: { type: 'number', value: 2, min: 0, max: 5 },
|
|
31
|
-
colorDomain: null,
|
|
32
|
-
colorRange: defaultColorRange
|
|
33
|
-
};
|
|
9
|
+
import { screenGridUniforms } from "./screen-grid-layer-uniforms.js";
|
|
34
10
|
class ScreenGridCellLayer extends Layer {
|
|
35
11
|
getShaders() {
|
|
36
|
-
return { vs, fs, modules: [picking] };
|
|
12
|
+
return super.getShaders({ vs, fs, modules: [picking, screenGridUniforms] });
|
|
37
13
|
}
|
|
38
14
|
initializeState() {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
15
|
+
this.getAttributeManager().addInstanced({
|
|
16
|
+
instancePositions: {
|
|
17
|
+
size: 2,
|
|
18
|
+
type: 'float32',
|
|
19
|
+
accessor: 'getBin'
|
|
20
|
+
},
|
|
21
|
+
instanceWeights: {
|
|
22
|
+
size: 1,
|
|
23
|
+
type: 'float32',
|
|
24
|
+
accessor: 'getWeight'
|
|
25
|
+
}
|
|
44
26
|
});
|
|
45
|
-
this.
|
|
46
|
-
model: this._getModel()
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
shouldUpdateState({ changeFlags }) {
|
|
50
|
-
// 'instanceCounts' buffer contetns change on viewport change.
|
|
51
|
-
return changeFlags.somethingChanged;
|
|
27
|
+
this.state.model = this._getModel();
|
|
52
28
|
}
|
|
53
29
|
updateState(params) {
|
|
54
30
|
super.updateState(params);
|
|
55
|
-
const {
|
|
56
|
-
const
|
|
57
|
-
if (
|
|
58
|
-
|
|
31
|
+
const { props, oldProps, changeFlags } = params;
|
|
32
|
+
const model = this.state.model;
|
|
33
|
+
if (oldProps.colorRange !== props.colorRange) {
|
|
34
|
+
this.state.colorTexture?.destroy();
|
|
35
|
+
this.state.colorTexture = createColorRangeTexture(this.context.device, props.colorRange, props.colorScaleType);
|
|
36
|
+
const screenGridProps = { colorRange: this.state.colorTexture };
|
|
37
|
+
model.shaderInputs.setProps({ screenGrid: screenGridProps });
|
|
59
38
|
}
|
|
60
|
-
else if (oldProps.
|
|
61
|
-
|
|
39
|
+
else if (oldProps.colorScaleType !== props.colorScaleType) {
|
|
40
|
+
updateColorRangeTexture(this.state.colorTexture, props.colorScaleType);
|
|
41
|
+
}
|
|
42
|
+
if (oldProps.cellMarginPixels !== props.cellMarginPixels ||
|
|
43
|
+
oldProps.cellSizePixels !== props.cellSizePixels ||
|
|
44
|
+
changeFlags.viewportChanged) {
|
|
45
|
+
const { width, height } = this.context.viewport;
|
|
46
|
+
const { cellSizePixels: gridSize, cellMarginPixels } = this.props;
|
|
47
|
+
const cellSize = Math.max(gridSize - cellMarginPixels, 0);
|
|
48
|
+
const screenGridProps = {
|
|
49
|
+
gridSizeClipspace: [(gridSize / width) * 2, (gridSize / height) * 2],
|
|
50
|
+
cellSizeClipspace: [(cellSize / width) * 2, (cellSize / height) * 2]
|
|
51
|
+
};
|
|
52
|
+
model.shaderInputs.setProps({ screenGrid: screenGridProps });
|
|
62
53
|
}
|
|
63
|
-
|
|
54
|
+
}
|
|
55
|
+
finalizeState(context) {
|
|
56
|
+
super.finalizeState(context);
|
|
57
|
+
this.state.colorTexture?.destroy();
|
|
64
58
|
}
|
|
65
59
|
draw({ uniforms }) {
|
|
66
|
-
const
|
|
67
|
-
const minColor = this.props.minColor || DEFAULT_MINCOLOR;
|
|
68
|
-
const maxColor = this.props.maxColor || DEFAULT_MAXCOLOR;
|
|
69
|
-
// If colorDomain not specified we use default domain [1, maxCount]
|
|
70
|
-
// maxCount value will be sampled form maxTexture in vertex shader.
|
|
71
|
-
const colorDomain = this.props.colorDomain || [1, 0];
|
|
60
|
+
const colorDomain = this.props.colorDomain();
|
|
72
61
|
const model = this.state.model;
|
|
73
|
-
|
|
74
|
-
model.
|
|
75
|
-
maxTexture
|
|
76
|
-
});
|
|
77
|
-
model.setUniforms({
|
|
78
|
-
// @ts-expect-error stricter luma gl types
|
|
79
|
-
minColor,
|
|
80
|
-
// @ts-expect-error stricter luma gl types
|
|
81
|
-
maxColor,
|
|
82
|
-
colorDomain
|
|
83
|
-
});
|
|
84
|
-
model.setParameters({
|
|
85
|
-
depthWriteEnabled: false,
|
|
86
|
-
// How to specify depth mask in WebGPU?
|
|
87
|
-
// depthMask: false,
|
|
88
|
-
...parameters
|
|
89
|
-
});
|
|
62
|
+
const screenGridProps = { colorDomain };
|
|
63
|
+
model.shaderInputs.setProps({ screenGrid: screenGridProps });
|
|
90
64
|
model.draw(this.context.renderPass);
|
|
91
65
|
}
|
|
92
|
-
calculateInstancePositions(attribute, { numInstances }) {
|
|
93
|
-
const { width, height } = this.context.viewport;
|
|
94
|
-
const { cellSizePixels } = this.props;
|
|
95
|
-
const numCol = Math.ceil(width / cellSizePixels);
|
|
96
|
-
const { value, size } = attribute;
|
|
97
|
-
for (let i = 0; i < numInstances; i++) {
|
|
98
|
-
const x = i % numCol;
|
|
99
|
-
const y = Math.floor(i / numCol);
|
|
100
|
-
value[i * size + 0] = ((x * cellSizePixels) / width) * 2 - 1;
|
|
101
|
-
value[i * size + 1] = 1 - ((y * cellSizePixels) / height) * 2;
|
|
102
|
-
value[i * size + 2] = 0;
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
66
|
// Private Methods
|
|
106
67
|
_getModel() {
|
|
107
68
|
return new Model(this.context.device, {
|
|
@@ -109,60 +70,17 @@ class ScreenGridCellLayer extends Layer {
|
|
|
109
70
|
id: this.props.id,
|
|
110
71
|
bufferLayout: this.getAttributeManager().getBufferLayouts(),
|
|
111
72
|
geometry: new Geometry({
|
|
112
|
-
topology: 'triangle-
|
|
73
|
+
topology: 'triangle-strip',
|
|
113
74
|
attributes: {
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
1, 1, 0,
|
|
119
|
-
0, 0, 0,
|
|
120
|
-
1, 1, 0,
|
|
121
|
-
0, 1, 0,
|
|
122
|
-
])
|
|
75
|
+
positions: {
|
|
76
|
+
value: new Float32Array([0, 0, 1, 0, 0, 1, 1, 1]),
|
|
77
|
+
size: 2
|
|
78
|
+
}
|
|
123
79
|
}
|
|
124
80
|
}),
|
|
125
81
|
isInstanced: true
|
|
126
82
|
});
|
|
127
83
|
}
|
|
128
|
-
_shouldUseMinMax() {
|
|
129
|
-
const { minColor, maxColor, colorDomain, colorRange } = this.props;
|
|
130
|
-
if (minColor || maxColor) {
|
|
131
|
-
log.deprecated('ScreenGridLayer props: minColor and maxColor', 'colorRange, colorDomain')();
|
|
132
|
-
return true;
|
|
133
|
-
}
|
|
134
|
-
// minColor and maxColor not supplied, check if colorRange or colorDomain supplied.
|
|
135
|
-
// NOTE: colorDomain and colorRange are experimental features, use them only when supplied.
|
|
136
|
-
if (colorDomain || colorRange) {
|
|
137
|
-
return false;
|
|
138
|
-
}
|
|
139
|
-
// None specified, use default minColor and maxColor
|
|
140
|
-
return true;
|
|
141
|
-
}
|
|
142
|
-
_updateUniforms(oldProps, props, changeFlags) {
|
|
143
|
-
const model = this.state.model;
|
|
144
|
-
if (COLOR_PROPS.some(key => oldProps[key] !== props[key])) {
|
|
145
|
-
model.setUniforms({ shouldUseMinMax: this._shouldUseMinMax() });
|
|
146
|
-
}
|
|
147
|
-
if (oldProps.colorRange !== props.colorRange) {
|
|
148
|
-
model.setUniforms({ colorRange: colorRangeToFlatArray(props.colorRange) });
|
|
149
|
-
}
|
|
150
|
-
if (oldProps.cellMarginPixels !== props.cellMarginPixels ||
|
|
151
|
-
oldProps.cellSizePixels !== props.cellSizePixels ||
|
|
152
|
-
changeFlags.viewportChanged) {
|
|
153
|
-
const { width, height } = this.context.viewport;
|
|
154
|
-
const { cellSizePixels, cellMarginPixels } = this.props;
|
|
155
|
-
const margin = cellSizePixels > cellMarginPixels ? cellMarginPixels : 0;
|
|
156
|
-
const cellScale = new Float32Array([
|
|
157
|
-
((cellSizePixels - margin) / width) * 2,
|
|
158
|
-
(-(cellSizePixels - margin) / height) * 2,
|
|
159
|
-
1
|
|
160
|
-
]);
|
|
161
|
-
// @ts-expect-error stricter luma gl types
|
|
162
|
-
model.setUniforms({ cellScale });
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
84
|
}
|
|
166
85
|
ScreenGridCellLayer.layerName = 'ScreenGridCellLayer';
|
|
167
|
-
ScreenGridCellLayer.defaultProps = defaultProps;
|
|
168
86
|
export default ScreenGridCellLayer;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
declare const _default: "#version 300 es\n#define SHADER_NAME screen-grid-layer-fragment-shader\n\nprecision highp float;\n\nin vec4 vColor;\
|
|
1
|
+
declare const _default: "#version 300 es\n#define SHADER_NAME screen-grid-layer-fragment-shader\n\nprecision highp float;\n\nin vec4 vColor;\n\nout vec4 fragColor;\n\nvoid main(void) {\n fragColor = vColor;\n\n DECKGL_FILTER_COLOR(fragColor, geometry);\n}\n";
|
|
2
2
|
export default _default;
|
|
3
3
|
//# sourceMappingURL=screen-grid-layer-fragment.glsl.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"screen-grid-layer-fragment.glsl.d.ts","sourceRoot":"","sources":["../../src/screen-grid-layer/screen-grid-layer-fragment.glsl.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"screen-grid-layer-fragment.glsl.d.ts","sourceRoot":"","sources":["../../src/screen-grid-layer/screen-grid-layer-fragment.glsl.ts"],"names":[],"mappings":";AAKA,wBAeE"}
|
|
@@ -1,34 +1,14 @@
|
|
|
1
|
-
//
|
|
2
|
-
//
|
|
3
|
-
//
|
|
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.
|
|
1
|
+
// deck.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// Copyright (c) vis.gl contributors
|
|
20
4
|
/* fragment shader for the grid-layer */
|
|
21
|
-
export default `\
|
|
5
|
+
export default /* glsl */ `\
|
|
22
6
|
#version 300 es
|
|
23
7
|
#define SHADER_NAME screen-grid-layer-fragment-shader
|
|
24
8
|
precision highp float;
|
|
25
9
|
in vec4 vColor;
|
|
26
|
-
in float vSampleCount;
|
|
27
10
|
out vec4 fragColor;
|
|
28
11
|
void main(void) {
|
|
29
|
-
if (vSampleCount <= 0.0) {
|
|
30
|
-
discard;
|
|
31
|
-
}
|
|
32
12
|
fragColor = vColor;
|
|
33
13
|
DECKGL_FILTER_COLOR(fragColor, geometry);
|
|
34
14
|
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Texture } from '@luma.gl/core';
|
|
2
|
+
export type ScreenGridProps = {
|
|
3
|
+
cellSizeClipspace: [number, number];
|
|
4
|
+
gridSizeClipspace: [number, number];
|
|
5
|
+
colorDomain: [number, number];
|
|
6
|
+
colorRange: Texture;
|
|
7
|
+
};
|
|
8
|
+
export declare const screenGridUniforms: {
|
|
9
|
+
readonly name: "screenGrid";
|
|
10
|
+
readonly vs: "uniform screenGridUniforms {\n vec2 cellSizeClipspace;\n vec2 gridSizeClipspace;\n vec2 colorDomain;\n} screenGrid;\n";
|
|
11
|
+
readonly uniformTypes: {
|
|
12
|
+
readonly cellSizeClipspace: "vec2<f32>";
|
|
13
|
+
readonly gridSizeClipspace: "vec2<f32>";
|
|
14
|
+
readonly colorDomain: "vec2<f32>";
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=screen-grid-layer-uniforms.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"screen-grid-layer-uniforms.d.ts","sourceRoot":"","sources":["../../src/screen-grid-layer/screen-grid-layer-uniforms.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,OAAO,EAAC,MAAM,eAAe,CAAC;AAWtC,MAAM,MAAM,eAAe,GAAG;IAC5B,iBAAiB,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACpC,iBAAiB,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACpC,WAAW,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC9B,UAAU,EAAE,OAAO,CAAC;CACrB,CAAC;AAEF,eAAO,MAAM,kBAAkB;;;;;;;;CAQmB,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
// deck.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// Copyright (c) vis.gl contributors
|
|
4
|
+
const uniformBlock = /* glsl */ `\
|
|
5
|
+
uniform screenGridUniforms {
|
|
6
|
+
vec2 cellSizeClipspace;
|
|
7
|
+
vec2 gridSizeClipspace;
|
|
8
|
+
vec2 colorDomain;
|
|
9
|
+
} screenGrid;
|
|
10
|
+
`;
|
|
11
|
+
export const screenGridUniforms = {
|
|
12
|
+
name: 'screenGrid',
|
|
13
|
+
vs: uniformBlock,
|
|
14
|
+
uniformTypes: {
|
|
15
|
+
cellSizeClipspace: 'vec2<f32>',
|
|
16
|
+
gridSizeClipspace: 'vec2<f32>',
|
|
17
|
+
colorDomain: 'vec2<f32>'
|
|
18
|
+
}
|
|
19
|
+
};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
declare const _default: "#version 300 es\n#define SHADER_NAME screen-grid-layer-vertex-shader\n#define RANGE_COUNT 6\n\nin
|
|
1
|
+
declare const _default: "#version 300 es\n#define SHADER_NAME screen-grid-layer-vertex-shader\n#define RANGE_COUNT 6\n\nin vec2 positions;\nin vec2 instancePositions;\nin float instanceWeights;\nin vec3 instancePickingColors;\n\nuniform sampler2D colorRange;\n\nout vec4 vColor;\n\nvec4 interp(float value, vec2 domain, sampler2D range) {\n float r = (value - domain.x) / (domain.y - domain.x);\n return texture(range, vec2(r, 0.5));\n}\n\nvoid main(void) {\n if (isnan(instanceWeights)) {\n gl_Position = vec4(0.);\n return;\n }\n\n vec2 pos = instancePositions * screenGrid.gridSizeClipspace + positions * screenGrid.cellSizeClipspace;\n pos.x = pos.x - 1.0;\n pos.y = 1.0 - pos.y;\n\n gl_Position = vec4(pos, 0., 1.);\n\n vColor = interp(instanceWeights, screenGrid.colorDomain, colorRange);\n vColor.a *= layer.opacity;\n\n // Set color to be rendered to picking fbo (also used to check for selection highlight).\n picking_setPickingColor(instancePickingColors);\n}\n";
|
|
2
2
|
export default _default;
|
|
3
3
|
//# sourceMappingURL=screen-grid-layer-vertex.glsl.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"screen-grid-layer-vertex.glsl.d.ts","sourceRoot":"","sources":["../../src/screen-grid-layer/screen-grid-layer-vertex.glsl.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"screen-grid-layer-vertex.glsl.d.ts","sourceRoot":"","sources":["../../src/screen-grid-layer/screen-grid-layer-vertex.glsl.ts"],"names":[],"mappings":";AAIA,wBAqCE"}
|
|
@@ -1,72 +1,31 @@
|
|
|
1
|
-
//
|
|
2
|
-
//
|
|
3
|
-
//
|
|
4
|
-
|
|
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 `\
|
|
1
|
+
// deck.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// Copyright (c) vis.gl contributors
|
|
4
|
+
export default /* glsl */ `\
|
|
21
5
|
#version 300 es
|
|
22
6
|
#define SHADER_NAME screen-grid-layer-vertex-shader
|
|
23
7
|
#define RANGE_COUNT 6
|
|
24
|
-
in
|
|
25
|
-
in
|
|
26
|
-
in
|
|
8
|
+
in vec2 positions;
|
|
9
|
+
in vec2 instancePositions;
|
|
10
|
+
in float instanceWeights;
|
|
27
11
|
in vec3 instancePickingColors;
|
|
28
|
-
uniform
|
|
29
|
-
uniform vec3 cellScale;
|
|
30
|
-
uniform vec4 minColor;
|
|
31
|
-
uniform vec4 maxColor;
|
|
32
|
-
uniform vec4 colorRange[RANGE_COUNT];
|
|
33
|
-
uniform vec2 colorDomain;
|
|
34
|
-
uniform bool shouldUseMinMax;
|
|
35
|
-
uniform sampler2D maxTexture;
|
|
12
|
+
uniform sampler2D colorRange;
|
|
36
13
|
out vec4 vColor;
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
if (value >= domain.x && value <= domain.y) {
|
|
41
|
-
float domainRange = domain.y - domain.x;
|
|
42
|
-
if (domainRange <= 0.) {
|
|
43
|
-
outColor = colorRange[0];
|
|
44
|
-
} else {
|
|
45
|
-
float rangeCount = float(RANGE_COUNT);
|
|
46
|
-
float rangeStep = domainRange / rangeCount;
|
|
47
|
-
float idx = floor((value - domain.x) / rangeStep);
|
|
48
|
-
idx = clamp(idx, 0., rangeCount - 1.);
|
|
49
|
-
int intIdx = int(idx);
|
|
50
|
-
outColor = colorRange[intIdx];
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
outColor = outColor / 255.;
|
|
54
|
-
return outColor;
|
|
14
|
+
vec4 interp(float value, vec2 domain, sampler2D range) {
|
|
15
|
+
float r = (value - domain.x) / (domain.y - domain.x);
|
|
16
|
+
return texture(range, vec2(r, 0.5));
|
|
55
17
|
}
|
|
56
18
|
void main(void) {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
vec4 color = mix(rangeColor, minMaxColor, rangeMinMax);
|
|
68
|
-
vColor = vec4(color.rgb, color.a * opacity);
|
|
19
|
+
if (isnan(instanceWeights)) {
|
|
20
|
+
gl_Position = vec4(0.);
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
vec2 pos = instancePositions * screenGrid.gridSizeClipspace + positions * screenGrid.cellSizeClipspace;
|
|
24
|
+
pos.x = pos.x - 1.0;
|
|
25
|
+
pos.y = 1.0 - pos.y;
|
|
26
|
+
gl_Position = vec4(pos, 0., 1.);
|
|
27
|
+
vColor = interp(instanceWeights, screenGrid.colorDomain, colorRange);
|
|
28
|
+
vColor.a *= layer.opacity;
|
|
69
29
|
picking_setPickingColor(instancePickingColors);
|
|
70
|
-
gl_Position = vec4(instancePositions + positions * cellScale, 1.);
|
|
71
30
|
}
|
|
72
31
|
`;
|