@deck.gl/aggregation-layers 9.0.34 → 9.1.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/common/aggregation-layer.d.ts +30 -0
- package/dist/common/aggregation-layer.d.ts.map +1 -0
- package/dist/common/aggregation-layer.js +69 -0
- package/dist/common/aggregator/aggregator.d.ts +76 -0
- package/dist/common/aggregator/aggregator.d.ts.map +1 -0
- package/dist/common/aggregator/aggregator.js +4 -0
- package/dist/common/aggregator/cpu-aggregator/aggregate.d.ts +27 -0
- package/dist/common/aggregator/cpu-aggregator/aggregate.d.ts.map +1 -0
- package/dist/common/aggregator/cpu-aggregator/aggregate.js +66 -0
- package/dist/common/aggregator/cpu-aggregator/cpu-aggregator.d.ts +70 -0
- package/dist/common/aggregator/cpu-aggregator/cpu-aggregator.d.ts.map +1 -0
- package/dist/common/aggregator/cpu-aggregator/cpu-aggregator.js +139 -0
- package/dist/common/aggregator/cpu-aggregator/sort-bins.d.ts +15 -0
- package/dist/common/aggregator/cpu-aggregator/sort-bins.d.ts.map +1 -0
- package/dist/common/aggregator/cpu-aggregator/sort-bins.js +43 -0
- package/dist/common/aggregator/cpu-aggregator/vertex-accessor.d.ts +21 -0
- package/dist/common/aggregator/cpu-aggregator/vertex-accessor.d.ts.map +1 -0
- package/dist/common/aggregator/cpu-aggregator/vertex-accessor.js +55 -0
- package/dist/common/aggregator/gpu-aggregator/aggregation-transform-uniforms.d.ts +18 -0
- package/dist/common/aggregator/gpu-aggregator/aggregation-transform-uniforms.d.ts.map +1 -0
- package/dist/common/aggregator/gpu-aggregator/aggregation-transform-uniforms.js +20 -0
- package/dist/common/aggregator/gpu-aggregator/bin-sorter-uniforms.d.ts +14 -0
- package/dist/common/aggregator/gpu-aggregator/bin-sorter-uniforms.d.ts.map +1 -0
- package/dist/common/aggregator/gpu-aggregator/bin-sorter-uniforms.js +17 -0
- package/dist/common/aggregator/gpu-aggregator/utils.d.ts +6 -0
- package/dist/common/aggregator/gpu-aggregator/utils.d.ts.map +1 -0
- package/dist/common/aggregator/gpu-aggregator/utils.js +24 -0
- package/dist/common/aggregator/gpu-aggregator/webgl-aggregation-transform.d.ts +24 -0
- package/dist/common/aggregator/gpu-aggregator/webgl-aggregation-transform.d.ts.map +1 -0
- package/dist/common/aggregator/gpu-aggregator/webgl-aggregation-transform.js +215 -0
- package/dist/common/aggregator/gpu-aggregator/webgl-aggregator.d.ts +81 -0
- package/dist/common/aggregator/gpu-aggregator/webgl-aggregator.d.ts.map +1 -0
- package/dist/common/aggregator/gpu-aggregator/webgl-aggregator.js +201 -0
- package/dist/common/aggregator/gpu-aggregator/webgl-bin-sorter.d.ts +38 -0
- package/dist/common/aggregator/gpu-aggregator/webgl-bin-sorter.d.ts.map +1 -0
- package/dist/common/aggregator/gpu-aggregator/webgl-bin-sorter.js +223 -0
- package/dist/common/aggregator/index.d.ts +6 -0
- package/dist/common/aggregator/index.d.ts.map +1 -0
- package/dist/common/aggregator/index.js +5 -0
- package/dist/common/types.d.ts +11 -0
- package/dist/common/types.d.ts.map +1 -0
- package/dist/common/types.js +4 -0
- package/dist/common/utils/bounds-utils.d.ts +10 -0
- package/dist/common/utils/bounds-utils.d.ts.map +1 -0
- package/dist/common/utils/bounds-utils.js +20 -0
- package/dist/common/utils/color-utils.d.ts +10 -0
- package/dist/common/utils/color-utils.d.ts.map +1 -0
- package/dist/common/utils/color-utils.js +65 -0
- package/dist/common/utils/prop-utils.d.ts.map +1 -0
- package/dist/common/utils/prop-utils.js +12 -0
- package/dist/common/utils/scale-utils.d.ts +46 -0
- package/dist/common/utils/scale-utils.d.ts.map +1 -0
- package/dist/common/utils/scale-utils.js +180 -0
- package/dist/contour-layer/bin-options-uniforms.d.ts +13 -0
- package/dist/contour-layer/bin-options-uniforms.d.ts.map +1 -0
- package/dist/contour-layer/bin-options-uniforms.js +17 -0
- package/dist/contour-layer/contour-layer.d.ts +42 -50
- package/dist/contour-layer/contour-layer.d.ts.map +1 -1
- package/dist/contour-layer/contour-layer.js +232 -192
- package/dist/contour-layer/contour-utils.d.ts +36 -15
- package/dist/contour-layer/contour-utils.d.ts.map +1 -1
- package/dist/contour-layer/contour-utils.js +24 -29
- package/dist/contour-layer/marching-squares-codes.d.ts.map +1 -1
- package/dist/contour-layer/marching-squares-codes.js +3 -0
- package/dist/contour-layer/marching-squares.d.ts +22 -6
- package/dist/contour-layer/marching-squares.d.ts.map +1 -1
- package/dist/contour-layer/marching-squares.js +71 -68
- package/dist/contour-layer/value-reader.d.ts +10 -0
- package/dist/contour-layer/value-reader.d.ts.map +1 -0
- package/dist/contour-layer/value-reader.js +46 -0
- package/dist/dist.dev.js +4842 -4081
- package/dist/grid-layer/bin-options-uniforms.d.ts +13 -0
- package/dist/grid-layer/bin-options-uniforms.d.ts.map +1 -0
- package/dist/grid-layer/bin-options-uniforms.js +17 -0
- package/dist/grid-layer/grid-cell-layer-vertex.glsl.d.ts +3 -0
- package/dist/grid-layer/grid-cell-layer-vertex.glsl.d.ts.map +1 -0
- package/dist/grid-layer/grid-cell-layer-vertex.glsl.js +51 -0
- package/dist/grid-layer/grid-cell-layer.d.ts +32 -0
- package/dist/grid-layer/grid-cell-layer.d.ts.map +1 -0
- package/dist/grid-layer/grid-cell-layer.js +93 -0
- package/dist/grid-layer/grid-layer-uniforms.d.ts +21 -0
- package/dist/grid-layer/grid-layer-uniforms.d.ts.map +1 -0
- package/dist/grid-layer/grid-layer-uniforms.js +23 -0
- package/dist/grid-layer/grid-layer.d.ts +175 -13
- package/dist/grid-layer/grid-layer.d.ts.map +1 -1
- package/dist/grid-layer/grid-layer.js +342 -46
- package/dist/{aggregation-layer.d.ts → heatmap-layer/aggregation-layer.d.ts} +1 -0
- package/dist/heatmap-layer/aggregation-layer.d.ts.map +1 -0
- package/dist/{aggregation-layer.js → heatmap-layer/aggregation-layer.js} +6 -21
- package/dist/heatmap-layer/heatmap-layer-uniforms.d.ts +30 -0
- package/dist/heatmap-layer/heatmap-layer-uniforms.d.ts.map +1 -0
- package/dist/heatmap-layer/heatmap-layer-uniforms.js +32 -0
- package/dist/heatmap-layer/heatmap-layer-utils.d.ts +1 -1
- package/dist/heatmap-layer/heatmap-layer-utils.d.ts.map +1 -1
- package/dist/heatmap-layer/heatmap-layer-utils.js +3 -0
- package/dist/heatmap-layer/heatmap-layer.d.ts +6 -4
- package/dist/heatmap-layer/heatmap-layer.d.ts.map +1 -1
- package/dist/heatmap-layer/heatmap-layer.js +43 -33
- package/dist/heatmap-layer/max-fs.glsl.d.ts.map +1 -1
- package/dist/heatmap-layer/max-fs.glsl.js +3 -0
- package/dist/heatmap-layer/max-vs.glsl.d.ts +1 -1
- package/dist/heatmap-layer/max-vs.glsl.d.ts.map +1 -1
- package/dist/heatmap-layer/max-vs.glsl.js +6 -4
- package/dist/heatmap-layer/triangle-layer-fragment.glsl.d.ts +1 -1
- package/dist/heatmap-layer/triangle-layer-fragment.glsl.d.ts.map +1 -1
- package/dist/heatmap-layer/triangle-layer-fragment.glsl.js +5 -23
- package/dist/heatmap-layer/triangle-layer-uniforms.d.ts +22 -0
- package/dist/heatmap-layer/triangle-layer-uniforms.d.ts.map +1 -0
- package/dist/heatmap-layer/triangle-layer-uniforms.js +22 -0
- package/dist/heatmap-layer/triangle-layer-vertex.glsl.d.ts +1 -1
- package/dist/heatmap-layer/triangle-layer-vertex.glsl.d.ts.map +1 -1
- package/dist/heatmap-layer/triangle-layer-vertex.glsl.js +10 -30
- package/dist/heatmap-layer/triangle-layer.d.ts +4 -10
- package/dist/heatmap-layer/triangle-layer.d.ts.map +1 -1
- package/dist/heatmap-layer/triangle-layer.js +17 -30
- package/dist/heatmap-layer/weights-fs.glsl.d.ts.map +1 -1
- package/dist/heatmap-layer/weights-fs.glsl.js +3 -0
- package/dist/heatmap-layer/weights-vs.glsl.d.ts +1 -1
- package/dist/heatmap-layer/weights-vs.glsl.d.ts.map +1 -1
- package/dist/heatmap-layer/weights-vs.glsl.js +6 -7
- package/dist/hexagon-layer/bin-options-uniforms.d.ts +14 -0
- package/dist/hexagon-layer/bin-options-uniforms.d.ts.map +1 -0
- package/dist/hexagon-layer/bin-options-uniforms.js +17 -0
- package/dist/hexagon-layer/hexagon-cell-layer-vertex.glsl.d.ts +3 -0
- package/dist/hexagon-layer/hexagon-cell-layer-vertex.glsl.d.ts.map +1 -0
- package/dist/hexagon-layer/hexagon-cell-layer-vertex.glsl.js +55 -0
- package/dist/hexagon-layer/hexagon-cell-layer.d.ts +29 -0
- package/dist/hexagon-layer/hexagon-cell-layer.d.ts.map +1 -0
- package/dist/hexagon-layer/hexagon-cell-layer.js +94 -0
- package/dist/hexagon-layer/hexagon-layer-uniforms.d.ts +19 -0
- package/dist/hexagon-layer/hexagon-layer-uniforms.d.ts.map +1 -0
- package/dist/hexagon-layer/hexagon-layer-uniforms.js +21 -0
- package/dist/hexagon-layer/hexagon-layer.d.ts +84 -54
- package/dist/hexagon-layer/hexagon-layer.d.ts.map +1 -1
- package/dist/hexagon-layer/hexagon-layer.js +307 -123
- package/dist/hexagon-layer/hexbin.d.ts +17 -0
- package/dist/hexagon-layer/hexbin.d.ts.map +1 -0
- package/dist/hexagon-layer/hexbin.js +69 -0
- package/dist/index.cjs +3025 -2946
- package/dist/index.cjs.map +4 -4
- package/dist/index.d.ts +7 -13
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -27
- package/dist/screen-grid-layer/bin-options-uniforms.d.ts +11 -0
- package/dist/screen-grid-layer/bin-options-uniforms.d.ts.map +1 -0
- package/dist/screen-grid-layer/bin-options-uniforms.js +15 -0
- package/dist/screen-grid-layer/screen-grid-cell-layer.d.ts +11 -16
- package/dist/screen-grid-layer/screen-grid-cell-layer.d.ts.map +1 -1
- package/dist/screen-grid-layer/screen-grid-cell-layer.js +52 -134
- package/dist/screen-grid-layer/screen-grid-layer-fragment.glsl.d.ts +1 -1
- package/dist/screen-grid-layer/screen-grid-layer-fragment.glsl.d.ts.map +1 -1
- package/dist/screen-grid-layer/screen-grid-layer-fragment.glsl.js +4 -24
- package/dist/screen-grid-layer/screen-grid-layer-uniforms.d.ts +17 -0
- package/dist/screen-grid-layer/screen-grid-layer-uniforms.d.ts.map +1 -0
- package/dist/screen-grid-layer/screen-grid-layer-uniforms.js +19 -0
- package/dist/screen-grid-layer/screen-grid-layer-vertex.glsl.d.ts +1 -1
- package/dist/screen-grid-layer/screen-grid-layer-vertex.glsl.d.ts.map +1 -1
- package/dist/screen-grid-layer/screen-grid-layer-vertex.glsl.js +21 -62
- package/dist/screen-grid-layer/screen-grid-layer.d.ts +33 -40
- package/dist/screen-grid-layer/screen-grid-layer.d.ts.map +1 -1
- package/dist/screen-grid-layer/screen-grid-layer.js +157 -174
- package/dist.min.js +401 -382
- package/package.json +10 -9
- package/src/common/aggregation-layer.ts +107 -0
- package/src/common/aggregator/aggregator.ts +88 -0
- package/src/common/aggregator/cpu-aggregator/aggregate.ts +101 -0
- package/src/common/aggregator/cpu-aggregator/cpu-aggregator.ts +203 -0
- package/src/common/aggregator/cpu-aggregator/sort-bins.ts +63 -0
- package/src/common/aggregator/cpu-aggregator/vertex-accessor.ts +86 -0
- package/src/common/aggregator/gpu-aggregator/aggregation-transform-uniforms.ts +33 -0
- package/src/common/aggregator/gpu-aggregator/bin-sorter-uniforms.ts +27 -0
- package/src/common/aggregator/gpu-aggregator/utils.ts +27 -0
- package/src/common/aggregator/gpu-aggregator/webgl-aggregation-transform.ts +247 -0
- package/src/common/aggregator/gpu-aggregator/webgl-aggregator.ts +274 -0
- package/src/common/aggregator/gpu-aggregator/webgl-bin-sorter.ts +258 -0
- package/src/common/aggregator/index.ts +10 -0
- package/src/{types.ts → common/types.ts} +10 -4
- package/src/common/utils/bounds-utils.ts +34 -0
- package/src/common/utils/color-utils.ts +86 -0
- package/src/common/utils/prop-utils.ts +13 -0
- package/src/common/utils/scale-utils.ts +236 -0
- package/src/contour-layer/bin-options-uniforms.ts +26 -0
- package/src/contour-layer/contour-layer.ts +300 -265
- package/src/contour-layer/contour-utils.ts +68 -39
- package/src/contour-layer/marching-squares-codes.ts +4 -0
- package/src/contour-layer/marching-squares.ts +93 -82
- package/src/contour-layer/value-reader.ts +65 -0
- package/src/grid-layer/bin-options-uniforms.ts +26 -0
- package/src/grid-layer/grid-cell-layer-vertex.glsl.ts +68 -0
- package/src/grid-layer/grid-cell-layer.ts +141 -0
- package/src/grid-layer/grid-layer-uniforms.ts +37 -0
- package/src/grid-layer/grid-layer.ts +614 -73
- package/src/{aggregation-layer.ts → heatmap-layer/aggregation-layer.ts} +6 -21
- package/src/heatmap-layer/heatmap-layer-uniforms.ts +50 -0
- package/src/heatmap-layer/heatmap-layer-utils.ts +9 -1
- package/src/heatmap-layer/heatmap-layer.ts +59 -36
- package/src/heatmap-layer/max-fs.glsl.ts +4 -0
- package/src/heatmap-layer/max-vs.glsl.ts +7 -4
- package/src/heatmap-layer/triangle-layer-fragment.glsl.ts +5 -23
- package/src/heatmap-layer/triangle-layer-uniforms.ts +37 -0
- package/src/heatmap-layer/triangle-layer-vertex.glsl.ts +10 -30
- package/src/heatmap-layer/triangle-layer.ts +26 -31
- package/src/heatmap-layer/weights-fs.glsl.ts +4 -0
- package/src/heatmap-layer/weights-vs.glsl.ts +7 -7
- package/src/hexagon-layer/bin-options-uniforms.ts +27 -0
- package/src/hexagon-layer/hexagon-cell-layer-vertex.glsl.ts +73 -0
- package/src/hexagon-layer/hexagon-cell-layer.ts +141 -0
- package/src/hexagon-layer/hexagon-layer-uniforms.ts +34 -0
- package/src/hexagon-layer/hexagon-layer.ts +454 -186
- package/src/hexagon-layer/hexbin.ts +79 -0
- package/src/index.ts +21 -34
- package/src/screen-grid-layer/bin-options-uniforms.ts +23 -0
- package/src/screen-grid-layer/screen-grid-cell-layer.ts +71 -156
- package/src/screen-grid-layer/screen-grid-layer-fragment.glsl.ts +4 -24
- package/src/screen-grid-layer/screen-grid-layer-uniforms.ts +31 -0
- package/src/screen-grid-layer/screen-grid-layer-vertex.glsl.ts +21 -64
- package/src/screen-grid-layer/screen-grid-layer.ts +194 -222
- package/dist/aggregation-layer.d.ts.map +0 -1
- package/dist/cpu-grid-layer/cpu-grid-layer.d.ts +0 -158
- package/dist/cpu-grid-layer/cpu-grid-layer.d.ts.map +0 -1
- package/dist/cpu-grid-layer/cpu-grid-layer.js +0 -130
- package/dist/cpu-grid-layer/grid-aggregator.d.ts +0 -35
- package/dist/cpu-grid-layer/grid-aggregator.d.ts.map +0 -1
- package/dist/cpu-grid-layer/grid-aggregator.js +0 -141
- package/dist/gpu-grid-layer/gpu-grid-cell-layer-fragment.glsl.d.ts +0 -3
- package/dist/gpu-grid-layer/gpu-grid-cell-layer-fragment.glsl.d.ts.map +0 -1
- package/dist/gpu-grid-layer/gpu-grid-cell-layer-fragment.glsl.js +0 -30
- package/dist/gpu-grid-layer/gpu-grid-cell-layer-vertex.glsl.d.ts +0 -3
- package/dist/gpu-grid-layer/gpu-grid-cell-layer-vertex.glsl.d.ts.map +0 -1
- package/dist/gpu-grid-layer/gpu-grid-cell-layer-vertex.glsl.js +0 -112
- package/dist/gpu-grid-layer/gpu-grid-cell-layer.d.ts +0 -48
- package/dist/gpu-grid-layer/gpu-grid-cell-layer.d.ts.map +0 -1
- package/dist/gpu-grid-layer/gpu-grid-cell-layer.js +0 -146
- package/dist/gpu-grid-layer/gpu-grid-layer.d.ts +0 -99
- package/dist/gpu-grid-layer/gpu-grid-layer.d.ts.map +0 -1
- package/dist/gpu-grid-layer/gpu-grid-layer.js +0 -289
- package/dist/grid-aggregation-layer.d.ts +0 -67
- package/dist/grid-aggregation-layer.d.ts.map +0 -1
- package/dist/grid-aggregation-layer.js +0 -173
- package/dist/hexagon-layer/hexagon-aggregator.d.ts +0 -27
- package/dist/hexagon-layer/hexagon-aggregator.d.ts.map +0 -1
- package/dist/hexagon-layer/hexagon-aggregator.js +0 -112
- package/dist/types.d.ts +0 -12
- package/dist/types.d.ts.map +0 -1
- package/dist/types.js +0 -1
- package/dist/utils/aggregation-operation-utils.d.ts +0 -19
- package/dist/utils/aggregation-operation-utils.d.ts.map +0 -1
- package/dist/utils/aggregation-operation-utils.js +0 -94
- package/dist/utils/bin-sorter.d.ts +0 -52
- package/dist/utils/bin-sorter.d.ts.map +0 -1
- package/dist/utils/bin-sorter.js +0 -167
- package/dist/utils/color-utils.d.ts +0 -3
- package/dist/utils/color-utils.d.ts.map +0 -1
- package/dist/utils/color-utils.js +0 -53
- package/dist/utils/cpu-aggregator.d.ts +0 -169
- package/dist/utils/cpu-aggregator.d.ts.map +0 -1
- package/dist/utils/cpu-aggregator.js +0 -421
- package/dist/utils/gpu-grid-aggregation/aggregate-all-fs.glsl.d.ts +0 -3
- package/dist/utils/gpu-grid-aggregation/aggregate-all-fs.glsl.d.ts.map +0 -1
- package/dist/utils/gpu-grid-aggregation/aggregate-all-fs.glsl.js +0 -36
- package/dist/utils/gpu-grid-aggregation/aggregate-all-vs.glsl.d.ts +0 -3
- package/dist/utils/gpu-grid-aggregation/aggregate-all-vs.glsl.d.ts.map +0 -1
- package/dist/utils/gpu-grid-aggregation/aggregate-all-vs.glsl.js +0 -42
- package/dist/utils/gpu-grid-aggregation/aggregate-to-grid-fs.glsl.d.ts +0 -3
- package/dist/utils/gpu-grid-aggregation/aggregate-to-grid-fs.glsl.d.ts.map +0 -1
- package/dist/utils/gpu-grid-aggregation/aggregate-to-grid-fs.glsl.js +0 -30
- package/dist/utils/gpu-grid-aggregation/aggregate-to-grid-vs.glsl.d.ts +0 -3
- package/dist/utils/gpu-grid-aggregation/aggregate-to-grid-vs.glsl.d.ts.map +0 -1
- package/dist/utils/gpu-grid-aggregation/aggregate-to-grid-vs.glsl.js +0 -61
- package/dist/utils/gpu-grid-aggregation/gpu-grid-aggregator-constants.d.ts +0 -38
- package/dist/utils/gpu-grid-aggregation/gpu-grid-aggregator-constants.d.ts.map +0 -1
- package/dist/utils/gpu-grid-aggregation/gpu-grid-aggregator-constants.js +0 -41
- package/dist/utils/gpu-grid-aggregation/gpu-grid-aggregator-utils.d.ts +0 -1
- package/dist/utils/gpu-grid-aggregation/gpu-grid-aggregator-utils.d.ts.map +0 -1
- package/dist/utils/gpu-grid-aggregation/gpu-grid-aggregator-utils.js +0 -1
- package/dist/utils/gpu-grid-aggregation/gpu-grid-aggregator.d.ts +0 -76
- package/dist/utils/gpu-grid-aggregation/gpu-grid-aggregator.d.ts.map +0 -1
- package/dist/utils/gpu-grid-aggregation/gpu-grid-aggregator.js +0 -555
- package/dist/utils/gpu-grid-aggregation/transform-mean-vs.glsl.d.ts +0 -3
- package/dist/utils/gpu-grid-aggregation/transform-mean-vs.glsl.d.ts.map +0 -1
- package/dist/utils/gpu-grid-aggregation/transform-mean-vs.glsl.js +0 -32
- package/dist/utils/grid-aggregation-utils.d.ts +0 -30
- package/dist/utils/grid-aggregation-utils.d.ts.map +0 -1
- package/dist/utils/grid-aggregation-utils.js +0 -114
- package/dist/utils/prop-utils.d.ts.map +0 -1
- package/dist/utils/prop-utils.js +0 -28
- package/dist/utils/resource-utils.d.ts +0 -14
- package/dist/utils/resource-utils.d.ts.map +0 -1
- package/dist/utils/resource-utils.js +0 -38
- package/dist/utils/scale-utils.d.ts +0 -15
- package/dist/utils/scale-utils.d.ts.map +0 -1
- package/dist/utils/scale-utils.js +0 -184
- package/src/cpu-grid-layer/cpu-grid-layer.ts +0 -329
- package/src/cpu-grid-layer/grid-aggregator.ts +0 -184
- package/src/gpu-grid-layer/gpu-grid-cell-layer-fragment.glsl.ts +0 -35
- package/src/gpu-grid-layer/gpu-grid-cell-layer-vertex.glsl.ts +0 -143
- package/src/gpu-grid-layer/gpu-grid-cell-layer.ts +0 -201
- package/src/gpu-grid-layer/gpu-grid-layer.ts +0 -455
- package/src/grid-aggregation-layer.ts +0 -243
- package/src/hexagon-layer/hexagon-aggregator.ts +0 -127
- package/src/utils/aggregation-operation-utils.ts +0 -118
- package/src/utils/bin-sorter.ts +0 -218
- package/src/utils/color-utils.ts +0 -57
- package/src/utils/cpu-aggregator.ts +0 -503
- package/src/utils/gpu-grid-aggregation/aggregate-all-fs.glsl.ts +0 -40
- package/src/utils/gpu-grid-aggregation/aggregate-all-vs.glsl.ts +0 -54
- package/src/utils/gpu-grid-aggregation/aggregate-to-grid-fs.glsl.ts +0 -35
- package/src/utils/gpu-grid-aggregation/aggregate-to-grid-vs.glsl.ts +0 -79
- package/src/utils/gpu-grid-aggregation/gpu-grid-aggregator-constants.ts +0 -46
- package/src/utils/gpu-grid-aggregation/gpu-grid-aggregator-utils.ts +0 -0
- package/src/utils/gpu-grid-aggregation/gpu-grid-aggregator.md +0 -155
- package/src/utils/gpu-grid-aggregation/gpu-grid-aggregator.ts +0 -690
- package/src/utils/gpu-grid-aggregation/transform-mean-vs.glsl.ts +0 -38
- package/src/utils/grid-aggregation-utils.ts +0 -147
- package/src/utils/prop-utils.ts +0 -29
- package/src/utils/resource-utils.ts +0 -53
- package/src/utils/scale-utils.js +0 -219
- /package/dist/{utils → common/utils}/prop-utils.d.ts +0 -0
|
@@ -1,33 +1,18 @@
|
|
|
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
|
/* global setTimeout clearTimeout */
|
|
21
5
|
import { getBounds, boundsContain, packVertices, scaleToAspectRatio, getTextureCoordinates } from "./heatmap-layer-utils.js";
|
|
22
6
|
import { TextureTransform } from '@luma.gl/engine';
|
|
23
|
-
import { AttributeManager, COORDINATE_SYSTEM, log } from '@deck.gl/core';
|
|
7
|
+
import { AttributeManager, COORDINATE_SYSTEM, log, project32 } from '@deck.gl/core';
|
|
24
8
|
import TriangleLayer from "./triangle-layer.js";
|
|
25
|
-
import AggregationLayer from "
|
|
26
|
-
import { defaultColorRange, colorRangeToFlatArray } from "../utils/color-utils.js";
|
|
9
|
+
import AggregationLayer from "./aggregation-layer.js";
|
|
10
|
+
import { defaultColorRange, colorRangeToFlatArray } from "../common/utils/color-utils.js";
|
|
27
11
|
import weightsVs from "./weights-vs.glsl.js";
|
|
28
12
|
import weightsFs from "./weights-fs.glsl.js";
|
|
29
13
|
import maxVs from "./max-vs.glsl.js";
|
|
30
14
|
import maxFs from "./max-fs.glsl.js";
|
|
15
|
+
import { maxWeightUniforms, weightUniforms } from "./heatmap-layer-uniforms.js";
|
|
31
16
|
const RESOLUTION = 2; // (number of common space pixels) / (number texels)
|
|
32
17
|
const TEXTURE_PROPS = {
|
|
33
18
|
format: 'rgba8unorm',
|
|
@@ -68,6 +53,13 @@ const DIMENSIONS = {
|
|
|
68
53
|
};
|
|
69
54
|
/** Visualizes the spatial distribution of data. */
|
|
70
55
|
class HeatmapLayer extends AggregationLayer {
|
|
56
|
+
getShaders(shaders) {
|
|
57
|
+
let modules = [project32];
|
|
58
|
+
if (shaders.modules) {
|
|
59
|
+
modules = [...modules, ...shaders.modules];
|
|
60
|
+
}
|
|
61
|
+
return super.getShaders({ ...shaders, modules });
|
|
62
|
+
}
|
|
71
63
|
initializeState() {
|
|
72
64
|
super.initializeAggregationLayer(DIMENSIONS);
|
|
73
65
|
this.setState({ colorDomain: DEFAULT_COLOR_DOMAIN });
|
|
@@ -231,7 +223,8 @@ class HeatmapLayer extends AggregationLayer {
|
|
|
231
223
|
blendAlphaDstFactor: 'one'
|
|
232
224
|
},
|
|
233
225
|
topology: 'point-list',
|
|
234
|
-
...shaders
|
|
226
|
+
...shaders,
|
|
227
|
+
modules: [...shaders.modules, weightUniforms]
|
|
235
228
|
});
|
|
236
229
|
this.setState({ weightsTransform });
|
|
237
230
|
}
|
|
@@ -244,11 +237,13 @@ class HeatmapLayer extends AggregationLayer {
|
|
|
244
237
|
fs: weightsFs
|
|
245
238
|
});
|
|
246
239
|
this._createWeightsTransform(weightsTransformShaders);
|
|
247
|
-
const maxWeightsTransformShaders = this.getShaders({
|
|
240
|
+
const maxWeightsTransformShaders = this.getShaders({
|
|
241
|
+
vs: maxVs,
|
|
242
|
+
fs: maxFs,
|
|
243
|
+
modules: [maxWeightUniforms]
|
|
244
|
+
});
|
|
248
245
|
const maxWeightTransform = new TextureTransform(device, {
|
|
249
246
|
id: `${this.id}-max-weights-transform`,
|
|
250
|
-
bindings: { inTexture: weightsTexture },
|
|
251
|
-
uniforms: { textureSize },
|
|
252
247
|
targetTexture: maxWeightsTexture,
|
|
253
248
|
...maxWeightsTransformShaders,
|
|
254
249
|
vertexCount: textureSize * textureSize,
|
|
@@ -263,6 +258,10 @@ class HeatmapLayer extends AggregationLayer {
|
|
|
263
258
|
blendAlphaDstFactor: 'one'
|
|
264
259
|
}
|
|
265
260
|
});
|
|
261
|
+
const maxWeightProps = { inTexture: weightsTexture, textureSize };
|
|
262
|
+
maxWeightTransform.model.shaderInputs.setProps({
|
|
263
|
+
maxWeight: maxWeightProps
|
|
264
|
+
});
|
|
266
265
|
this.setState({
|
|
267
266
|
weightsTexture,
|
|
268
267
|
maxWeightsTexture,
|
|
@@ -296,8 +295,8 @@ class HeatmapLayer extends AggregationLayer {
|
|
|
296
295
|
const viewportCorners = [
|
|
297
296
|
viewport.unproject([0, 0]),
|
|
298
297
|
viewport.unproject([viewport.width, 0]),
|
|
299
|
-
viewport.unproject([
|
|
300
|
-
viewport.unproject([
|
|
298
|
+
viewport.unproject([0, viewport.height]),
|
|
299
|
+
viewport.unproject([viewport.width, viewport.height])
|
|
301
300
|
].map(p => p.map(Math.fround));
|
|
302
301
|
// #1: get world bounds for current viewport extends
|
|
303
302
|
const visibleWorldBounds = getBounds(viewportCorners); // TODO: Change to visible bounds
|
|
@@ -341,10 +340,11 @@ class HeatmapLayer extends AggregationLayer {
|
|
|
341
340
|
const colors = colorRangeToFlatArray(colorRange, false, Uint8Array);
|
|
342
341
|
if (colorTexture && colorTexture?.width === colorRange.length) {
|
|
343
342
|
// TODO(v9): Unclear whether `setSubImageData` is a public API, or what to use if not.
|
|
344
|
-
colorTexture.
|
|
343
|
+
colorTexture.setTexture2DData({ data: colors });
|
|
345
344
|
}
|
|
346
345
|
else {
|
|
347
346
|
colorTexture?.destroy();
|
|
347
|
+
// @ts-expect-error TODO(ib) - texture API change
|
|
348
348
|
colorTexture = this.context.device.createTexture({
|
|
349
349
|
...TEXTURE_PROPS,
|
|
350
350
|
data: colors,
|
|
@@ -356,7 +356,7 @@ class HeatmapLayer extends AggregationLayer {
|
|
|
356
356
|
}
|
|
357
357
|
_updateWeightmap() {
|
|
358
358
|
const { radiusPixels, colorDomain, aggregation } = this.props;
|
|
359
|
-
const { worldBounds, textureSize, weightsScale } = this.state;
|
|
359
|
+
const { worldBounds, textureSize, weightsScale, weightsTexture } = this.state;
|
|
360
360
|
const weightsTransform = this.state.weightsTransform;
|
|
361
361
|
this.state.isWeightMapDirty = false;
|
|
362
362
|
// convert world bounds to common using Layer's coordiante system and origin
|
|
@@ -376,11 +376,21 @@ class HeatmapLayer extends AggregationLayer {
|
|
|
376
376
|
const attributeManager = this.getAttributeManager();
|
|
377
377
|
const attributes = attributeManager.getAttributes();
|
|
378
378
|
const moduleSettings = this.getModuleSettings();
|
|
379
|
-
const uniforms = { radiusPixels, commonBounds, textureWidth: textureSize, weightsScale };
|
|
380
379
|
this._setModelAttributes(weightsTransform.model, attributes);
|
|
381
380
|
weightsTransform.model.setVertexCount(this.getNumInstances());
|
|
382
|
-
|
|
383
|
-
|
|
381
|
+
const weightProps = {
|
|
382
|
+
radiusPixels,
|
|
383
|
+
commonBounds,
|
|
384
|
+
textureWidth: textureSize,
|
|
385
|
+
weightsScale,
|
|
386
|
+
weightsTexture: weightsTexture
|
|
387
|
+
};
|
|
388
|
+
const { viewport, devicePixelRatio, coordinateSystem, coordinateOrigin } = moduleSettings;
|
|
389
|
+
const { modelMatrix } = this.props;
|
|
390
|
+
weightsTransform.model.shaderInputs.setProps({
|
|
391
|
+
project: { viewport, devicePixelRatio, modelMatrix, coordinateSystem, coordinateOrigin },
|
|
392
|
+
weight: weightProps
|
|
393
|
+
});
|
|
384
394
|
weightsTransform.run({
|
|
385
395
|
parameters: { viewport: [0, 0, textureSize, textureSize] },
|
|
386
396
|
clearColor: [0, 0, 0, 0]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"max-fs.glsl.d.ts","sourceRoot":"","sources":["../../src/heatmap-layer/max-fs.glsl.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"max-fs.glsl.d.ts","sourceRoot":"","sources":["../../src/heatmap-layer/max-fs.glsl.ts"],"names":[],"mappings":";AAIA,wBAQE"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
declare const _default: "#version 300 es\nuniform sampler2D inTexture;\
|
|
1
|
+
declare const _default: "#version 300 es\nuniform sampler2D inTexture;\nout vec4 outTexture;\n\nvoid main()\n{\n // Sample every pixel in texture\n int yIndex = gl_VertexID / int(maxWeight.textureSize);\n int xIndex = gl_VertexID - (yIndex * int(maxWeight.textureSize));\n vec2 uv = (0.5 + vec2(float(xIndex), float(yIndex))) / maxWeight.textureSize;\n outTexture = texture(inTexture, uv);\n\n gl_Position = vec4(0.0, 0.0, 0.0, 1.0);\n // Enforce default value for ANGLE issue (https://bugs.chromium.org/p/angleproject/issues/detail?id=3941)\n gl_PointSize = 1.0;\n}\n";
|
|
2
2
|
export default _default;
|
|
3
3
|
//# sourceMappingURL=max-vs.glsl.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"max-vs.glsl.d.ts","sourceRoot":"","sources":["../../src/heatmap-layer/max-vs.glsl.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"max-vs.glsl.d.ts","sourceRoot":"","sources":["../../src/heatmap-layer/max-vs.glsl.ts"],"names":[],"mappings":";AAIA,wBAiBE"}
|
|
@@ -1,13 +1,15 @@
|
|
|
1
|
+
// deck.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// Copyright (c) vis.gl contributors
|
|
1
4
|
export default `\
|
|
2
5
|
#version 300 es
|
|
3
6
|
uniform sampler2D inTexture;
|
|
4
|
-
uniform float textureSize;
|
|
5
7
|
out vec4 outTexture;
|
|
6
8
|
void main()
|
|
7
9
|
{
|
|
8
|
-
int yIndex = gl_VertexID / int(textureSize);
|
|
9
|
-
int xIndex = gl_VertexID - (yIndex * int(textureSize));
|
|
10
|
-
vec2 uv = (0.5 + vec2(float(xIndex), float(yIndex))) / textureSize;
|
|
10
|
+
int yIndex = gl_VertexID / int(maxWeight.textureSize);
|
|
11
|
+
int xIndex = gl_VertexID - (yIndex * int(maxWeight.textureSize));
|
|
12
|
+
vec2 uv = (0.5 + vec2(float(xIndex), float(yIndex))) / maxWeight.textureSize;
|
|
11
13
|
outTexture = texture(inTexture, uv);
|
|
12
14
|
gl_Position = vec4(0.0, 0.0, 0.0, 1.0);
|
|
13
15
|
gl_PointSize = 1.0;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
declare const _default: "#version 300 es\n#define SHADER_NAME triangle-layer-fragment-shader\n\nprecision highp float;\n\nuniform
|
|
1
|
+
declare const _default: "#version 300 es\n#define SHADER_NAME triangle-layer-fragment-shader\n\nprecision highp float;\n\nuniform sampler2D weightsTexture;\nuniform sampler2D colorTexture;\n\nin vec2 vTexCoords;\nin float vIntensityMin;\nin float vIntensityMax;\n\nout vec4 fragColor;\n\nvec4 getLinearColor(float value) {\n float factor = clamp(value * vIntensityMax, 0., 1.);\n vec4 color = texture(colorTexture, vec2(factor, 0.5));\n color.a *= min(value * vIntensityMin, 1.0);\n return color;\n}\n\nvoid main(void) {\n vec4 weights = texture(weightsTexture, vTexCoords);\n float weight = weights.r;\n\n if (triangle.aggregationMode > 0.5) {\n weight /= max(1.0, weights.a);\n }\n\n // discard pixels with 0 weight.\n if (weight <= 0.) {\n discard;\n }\n\n vec4 linearColor = getLinearColor(weight);\n linearColor.a *= layer.opacity;\n fragColor = linearColor;\n}\n";
|
|
2
2
|
export default _default;
|
|
3
3
|
//# sourceMappingURL=triangle-layer-fragment.glsl.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"triangle-layer-fragment.glsl.d.ts","sourceRoot":"","sources":["../../src/heatmap-layer/triangle-layer-fragment.glsl.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"triangle-layer-fragment.glsl.d.ts","sourceRoot":"","sources":["../../src/heatmap-layer/triangle-layer-fragment.glsl.ts"],"names":[],"mappings":";AAIA,wBAuCE"}
|
|
@@ -1,30 +1,12 @@
|
|
|
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 `\
|
|
21
5
|
#version 300 es
|
|
22
6
|
#define SHADER_NAME triangle-layer-fragment-shader
|
|
23
7
|
precision highp float;
|
|
24
|
-
uniform float opacity;
|
|
25
8
|
uniform sampler2D weightsTexture;
|
|
26
9
|
uniform sampler2D colorTexture;
|
|
27
|
-
uniform float aggregationMode;
|
|
28
10
|
in vec2 vTexCoords;
|
|
29
11
|
in float vIntensityMin;
|
|
30
12
|
in float vIntensityMax;
|
|
@@ -38,14 +20,14 @@ return color;
|
|
|
38
20
|
void main(void) {
|
|
39
21
|
vec4 weights = texture(weightsTexture, vTexCoords);
|
|
40
22
|
float weight = weights.r;
|
|
41
|
-
if (aggregationMode > 0.5) {
|
|
23
|
+
if (triangle.aggregationMode > 0.5) {
|
|
42
24
|
weight /= max(1.0, weights.a);
|
|
43
25
|
}
|
|
44
26
|
if (weight <= 0.) {
|
|
45
27
|
discard;
|
|
46
28
|
}
|
|
47
29
|
vec4 linearColor = getLinearColor(weight);
|
|
48
|
-
linearColor.a *= opacity;
|
|
30
|
+
linearColor.a *= layer.opacity;
|
|
49
31
|
fragColor = linearColor;
|
|
50
32
|
}
|
|
51
33
|
`;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Texture } from '@luma.gl/core';
|
|
2
|
+
export type TriangleProps = {
|
|
3
|
+
aggregationMode: number;
|
|
4
|
+
colorDomain: [number, number];
|
|
5
|
+
intensity: number;
|
|
6
|
+
threshold: number;
|
|
7
|
+
colorTexture: Texture;
|
|
8
|
+
maxTexture: Texture;
|
|
9
|
+
weightsTexture: Texture;
|
|
10
|
+
};
|
|
11
|
+
export declare const triangleUniforms: {
|
|
12
|
+
readonly name: "triangle";
|
|
13
|
+
readonly vs: "uniform triangleUniforms {\n float aggregationMode;\n vec2 colorDomain;\n float intensity;\n float threshold;\n} triangle;\n";
|
|
14
|
+
readonly fs: "uniform triangleUniforms {\n float aggregationMode;\n vec2 colorDomain;\n float intensity;\n float threshold;\n} triangle;\n";
|
|
15
|
+
readonly uniformTypes: {
|
|
16
|
+
readonly aggregationMode: "f32";
|
|
17
|
+
readonly colorDomain: "vec2<f32>";
|
|
18
|
+
readonly intensity: "f32";
|
|
19
|
+
readonly threshold: "f32";
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=triangle-layer-uniforms.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"triangle-layer-uniforms.d.ts","sourceRoot":"","sources":["../../src/heatmap-layer/triangle-layer-uniforms.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,OAAO,EAAC,MAAM,eAAe,CAAC;AAYtC,MAAM,MAAM,aAAa,GAAG;IAC1B,eAAe,EAAE,MAAM,CAAC;IACxB,WAAW,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC9B,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,OAAO,CAAC;IACtB,UAAU,EAAE,OAAO,CAAC;IACpB,cAAc,EAAE,OAAO,CAAC;CACzB,CAAC;AAEF,eAAO,MAAM,gBAAgB;;;;;;;;;;CAUmB,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
// deck.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// Copyright (c) vis.gl contributors
|
|
4
|
+
const uniformBlock = `\
|
|
5
|
+
uniform triangleUniforms {
|
|
6
|
+
float aggregationMode;
|
|
7
|
+
vec2 colorDomain;
|
|
8
|
+
float intensity;
|
|
9
|
+
float threshold;
|
|
10
|
+
} triangle;
|
|
11
|
+
`;
|
|
12
|
+
export const triangleUniforms = {
|
|
13
|
+
name: 'triangle',
|
|
14
|
+
vs: uniformBlock,
|
|
15
|
+
fs: uniformBlock,
|
|
16
|
+
uniformTypes: {
|
|
17
|
+
aggregationMode: 'f32',
|
|
18
|
+
colorDomain: 'vec2<f32>',
|
|
19
|
+
intensity: 'f32',
|
|
20
|
+
threshold: 'f32'
|
|
21
|
+
}
|
|
22
|
+
};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
declare const _default: "#version 300 es\n#define SHADER_NAME heatp-map-layer-vertex-shader\n\nuniform sampler2D maxTexture;\
|
|
1
|
+
declare const _default: "#version 300 es\n#define SHADER_NAME heatp-map-layer-vertex-shader\n\nuniform sampler2D maxTexture;\n\nin vec3 positions;\nin vec2 texCoords;\n\nout vec2 vTexCoords;\nout float vIntensityMin;\nout float vIntensityMax;\n\nvoid main(void) {\n gl_Position = project_position_to_clipspace(positions, vec3(0.0), vec3(0.0));\n vTexCoords = texCoords;\n vec4 maxTexture = texture(maxTexture, vec2(0.5));\n float maxValue = triangle.aggregationMode < 0.5 ? maxTexture.r : maxTexture.g;\n float minValue = maxValue * triangle.threshold;\n if (triangle.colorDomain[1] > 0.) {\n // if user specified custom domain use it.\n maxValue = triangle.colorDomain[1];\n minValue = triangle.colorDomain[0];\n }\n vIntensityMax = triangle.intensity / maxValue;\n vIntensityMin = triangle.intensity / minValue;\n}\n";
|
|
2
2
|
export default _default;
|
|
3
3
|
//# sourceMappingURL=triangle-layer-vertex.glsl.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"triangle-layer-vertex.glsl.d.ts","sourceRoot":"","sources":["../../src/heatmap-layer/triangle-layer-vertex.glsl.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"triangle-layer-vertex.glsl.d.ts","sourceRoot":"","sources":["../../src/heatmap-layer/triangle-layer-vertex.glsl.ts"],"names":[],"mappings":";AAMA,wBA2BE"}
|
|
@@ -1,31 +1,11 @@
|
|
|
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
|
// Inspired by screen-grid-layer vertex shader in deck.gl
|
|
21
5
|
export default `\
|
|
22
6
|
#version 300 es
|
|
23
7
|
#define SHADER_NAME heatp-map-layer-vertex-shader
|
|
24
8
|
uniform sampler2D maxTexture;
|
|
25
|
-
uniform float intensity;
|
|
26
|
-
uniform vec2 colorDomain;
|
|
27
|
-
uniform float threshold;
|
|
28
|
-
uniform float aggregationMode;
|
|
29
9
|
in vec3 positions;
|
|
30
10
|
in vec2 texCoords;
|
|
31
11
|
out vec2 vTexCoords;
|
|
@@ -35,13 +15,13 @@ void main(void) {
|
|
|
35
15
|
gl_Position = project_position_to_clipspace(positions, vec3(0.0), vec3(0.0));
|
|
36
16
|
vTexCoords = texCoords;
|
|
37
17
|
vec4 maxTexture = texture(maxTexture, vec2(0.5));
|
|
38
|
-
float maxValue = aggregationMode < 0.5 ? maxTexture.r : maxTexture.g;
|
|
39
|
-
float minValue = maxValue * threshold;
|
|
40
|
-
if (colorDomain[1] > 0.) {
|
|
41
|
-
maxValue = colorDomain[1];
|
|
42
|
-
minValue = colorDomain[0];
|
|
18
|
+
float maxValue = triangle.aggregationMode < 0.5 ? maxTexture.r : maxTexture.g;
|
|
19
|
+
float minValue = maxValue * triangle.threshold;
|
|
20
|
+
if (triangle.colorDomain[1] > 0.) {
|
|
21
|
+
maxValue = triangle.colorDomain[1];
|
|
22
|
+
minValue = triangle.colorDomain[0];
|
|
43
23
|
}
|
|
44
|
-
vIntensityMax = intensity / maxValue;
|
|
45
|
-
vIntensityMin = intensity / minValue;
|
|
24
|
+
vIntensityMax = triangle.intensity / maxValue;
|
|
25
|
+
vIntensityMin = triangle.intensity / minValue;
|
|
46
26
|
}
|
|
47
27
|
`;
|
|
@@ -8,8 +8,8 @@ type _TriangleLayerProps = {
|
|
|
8
8
|
texCoords: Buffer;
|
|
9
9
|
};
|
|
10
10
|
};
|
|
11
|
-
colorDomain: number
|
|
12
|
-
aggregationMode:
|
|
11
|
+
colorDomain: [number, number];
|
|
12
|
+
aggregationMode: number;
|
|
13
13
|
threshold: number;
|
|
14
14
|
intensity: number;
|
|
15
15
|
vertexCount: number;
|
|
@@ -24,16 +24,10 @@ export default class TriangleLayer extends Layer<_TriangleLayerProps> {
|
|
|
24
24
|
positions: Buffer;
|
|
25
25
|
texCoords: Buffer;
|
|
26
26
|
};
|
|
27
|
-
getShaders():
|
|
28
|
-
vs: string;
|
|
29
|
-
fs: string;
|
|
30
|
-
modules: import("@luma.gl/shadertools").ShaderModule[];
|
|
31
|
-
};
|
|
27
|
+
getShaders(): any;
|
|
32
28
|
initializeState({ device }: LayerContext): void;
|
|
33
29
|
_getModel(device: Device): Model;
|
|
34
|
-
draw(
|
|
35
|
-
uniforms: any;
|
|
36
|
-
}): void;
|
|
30
|
+
draw(): void;
|
|
37
31
|
}
|
|
38
32
|
export {};
|
|
39
33
|
//# sourceMappingURL=triangle-layer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"triangle-layer.d.ts","sourceRoot":"","sources":["../../src/heatmap-layer/triangle-layer.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"triangle-layer.d.ts","sourceRoot":"","sources":["../../src/heatmap-layer/triangle-layer.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAC,MAAM,eAAe,CAAC;AAC3D,OAAO,EAAC,KAAK,EAAC,MAAM,iBAAiB,CAAC;AACtC,OAAO,EAAC,KAAK,EAAE,YAAY,EAAY,MAAM,eAAe,CAAC;AAK7D,KAAK,mBAAmB,GAAG;IACzB,IAAI,EAAE;QAAC,UAAU,EAAE;YAAC,SAAS,EAAE,MAAM,CAAC;YAAC,SAAS,EAAE,MAAM,CAAA;SAAC,CAAA;KAAC,CAAC;IAC3D,WAAW,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC9B,eAAe,EAAE,MAAM,CAAC;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,OAAO,CAAC;IACtB,UAAU,EAAE,OAAO,CAAC;IACpB,cAAc,EAAE,OAAO,CAAC;CACzB,CAAC;AAEF,MAAM,CAAC,OAAO,OAAO,aAAc,SAAQ,KAAK,CAAC,mBAAmB,CAAC;IACnE,MAAM,CAAC,SAAS,SAAmB;IAEnC,KAAK,EAAG;QACN,KAAK,EAAE,KAAK,CAAC;QACb,SAAS,EAAE,MAAM,CAAC;QAClB,SAAS,EAAE,MAAM,CAAC;KACnB,CAAC;IAEF,UAAU;IAIV,eAAe,CAAC,EAAC,MAAM,EAAC,EAAE,YAAY,GAAG,IAAI;IAI7C,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,KAAK;IAgBhC,IAAI,IAAI,IAAI;CAuBb"}
|
|
@@ -1,58 +1,45 @@
|
|
|
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 } from '@luma.gl/engine';
|
|
21
5
|
import { Layer, project32 } from '@deck.gl/core';
|
|
22
6
|
import vs from "./triangle-layer-vertex.glsl.js";
|
|
23
7
|
import fs from "./triangle-layer-fragment.glsl.js";
|
|
8
|
+
import { triangleUniforms } from "./triangle-layer-uniforms.js";
|
|
24
9
|
class TriangleLayer extends Layer {
|
|
25
10
|
getShaders() {
|
|
26
|
-
return { vs, fs, modules: [project32] };
|
|
11
|
+
return super.getShaders({ vs, fs, modules: [project32, triangleUniforms] });
|
|
27
12
|
}
|
|
28
13
|
initializeState({ device }) {
|
|
29
14
|
this.setState({ model: this._getModel(device) });
|
|
30
15
|
}
|
|
31
16
|
_getModel(device) {
|
|
32
|
-
const { vertexCount, data
|
|
17
|
+
const { vertexCount, data } = this.props;
|
|
33
18
|
return new Model(device, {
|
|
34
19
|
...this.getShaders(),
|
|
35
20
|
id: this.props.id,
|
|
36
|
-
bindings: { weightsTexture, maxTexture, colorTexture },
|
|
37
21
|
attributes: data.attributes,
|
|
38
22
|
bufferLayout: [
|
|
39
23
|
{ name: 'positions', format: 'float32x3' },
|
|
40
24
|
{ name: 'texCoords', format: 'float32x2' }
|
|
41
25
|
],
|
|
42
|
-
topology: 'triangle-
|
|
26
|
+
topology: 'triangle-strip',
|
|
43
27
|
vertexCount
|
|
44
28
|
});
|
|
45
29
|
}
|
|
46
|
-
draw(
|
|
30
|
+
draw() {
|
|
47
31
|
const { model } = this.state;
|
|
48
|
-
const { intensity, threshold,
|
|
49
|
-
|
|
50
|
-
|
|
32
|
+
const { aggregationMode, colorDomain, intensity, threshold, colorTexture, maxTexture, weightsTexture } = this.props;
|
|
33
|
+
const triangleProps = {
|
|
34
|
+
aggregationMode,
|
|
35
|
+
colorDomain,
|
|
51
36
|
intensity,
|
|
52
37
|
threshold,
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
38
|
+
colorTexture,
|
|
39
|
+
maxTexture,
|
|
40
|
+
weightsTexture
|
|
41
|
+
};
|
|
42
|
+
model.shaderInputs.setProps({ triangle: triangleProps });
|
|
56
43
|
model.draw(this.context.renderPass);
|
|
57
44
|
}
|
|
58
45
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"weights-fs.glsl.d.ts","sourceRoot":"","sources":["../../src/heatmap-layer/weights-fs.glsl.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"weights-fs.glsl.d.ts","sourceRoot":"","sources":["../../src/heatmap-layer/weights-fs.glsl.ts"],"names":[],"mappings":";AAIA,wBAoBE"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
declare const _default: "#version 300 es\nin vec3 positions;\nin vec3 positions64Low;\nin float weights;\nout vec4 weightsTexture;\
|
|
1
|
+
declare const _default: "#version 300 es\nin vec3 positions;\nin vec3 positions64Low;\nin float weights;\nout vec4 weightsTexture;\n\nvoid main()\n{\n weightsTexture = vec4(weights * weight.weightsScale, 0., 0., 1.);\n\n float radiusTexels = project_pixel_size(weight.radiusPixels) * weight.textureWidth / (weight.commonBounds.z - weight.commonBounds.x);\n gl_PointSize = radiusTexels * 2.;\n\n vec3 commonPosition = project_position(positions, positions64Low);\n\n // // map xy from commonBounds to [-1, 1]\n gl_Position.xy = (commonPosition.xy - weight.commonBounds.xy) / (weight.commonBounds.zw - weight.commonBounds.xy) ;\n gl_Position.xy = (gl_Position.xy * 2.) - (1.);\n gl_Position.w = 1.0;\n}\n";
|
|
2
2
|
export default _default;
|
|
3
3
|
//# sourceMappingURL=weights-vs.glsl.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"weights-vs.glsl.d.ts","sourceRoot":"","sources":["../../src/heatmap-layer/weights-vs.glsl.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"weights-vs.glsl.d.ts","sourceRoot":"","sources":["../../src/heatmap-layer/weights-vs.glsl.ts"],"names":[],"mappings":";AAIA,wBAqBE"}
|
|
@@ -1,20 +1,19 @@
|
|
|
1
|
+
// deck.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// Copyright (c) vis.gl contributors
|
|
1
4
|
export default `\
|
|
2
5
|
#version 300 es
|
|
3
6
|
in vec3 positions;
|
|
4
7
|
in vec3 positions64Low;
|
|
5
8
|
in float weights;
|
|
6
9
|
out vec4 weightsTexture;
|
|
7
|
-
uniform float radiusPixels;
|
|
8
|
-
uniform float textureWidth;
|
|
9
|
-
uniform vec4 commonBounds;
|
|
10
|
-
uniform float weightsScale;
|
|
11
10
|
void main()
|
|
12
11
|
{
|
|
13
|
-
weightsTexture = vec4(weights * weightsScale, 0., 0., 1.);
|
|
14
|
-
float radiusTexels = project_pixel_size(radiusPixels) * textureWidth / (commonBounds.z - commonBounds.x);
|
|
12
|
+
weightsTexture = vec4(weights * weight.weightsScale, 0., 0., 1.);
|
|
13
|
+
float radiusTexels = project_pixel_size(weight.radiusPixels) * weight.textureWidth / (weight.commonBounds.z - weight.commonBounds.x);
|
|
15
14
|
gl_PointSize = radiusTexels * 2.;
|
|
16
15
|
vec3 commonPosition = project_position(positions, positions64Low);
|
|
17
|
-
gl_Position.xy = (commonPosition.xy - commonBounds.xy) / (commonBounds.zw - commonBounds.xy) ;
|
|
16
|
+
gl_Position.xy = (commonPosition.xy - weight.commonBounds.xy) / (weight.commonBounds.zw - weight.commonBounds.xy) ;
|
|
18
17
|
gl_Position.xy = (gl_Position.xy * 2.) - (1.);
|
|
19
18
|
gl_Position.w = 1.0;
|
|
20
19
|
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { NumberArray2 } from '@math.gl/core';
|
|
2
|
+
export type BinOptions = {
|
|
3
|
+
hexOriginCommon: NumberArray2;
|
|
4
|
+
radiusCommon: number;
|
|
5
|
+
};
|
|
6
|
+
export declare const binOptionsUniforms: {
|
|
7
|
+
readonly name: "binOptions";
|
|
8
|
+
readonly vs: "uniform binOptionsUniforms {\n vec2 hexOriginCommon;\n float radiusCommon;\n} binOptions;\n";
|
|
9
|
+
readonly uniformTypes: {
|
|
10
|
+
readonly hexOriginCommon: "vec2<f32>";
|
|
11
|
+
readonly radiusCommon: "f32";
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=bin-options-uniforms.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bin-options-uniforms.d.ts","sourceRoot":"","sources":["../../src/hexagon-layer/bin-options-uniforms.ts"],"names":[],"mappings":"AAKA,OAAO,EAAC,YAAY,EAAC,MAAM,eAAe,CAAC;AAS3C,MAAM,MAAM,UAAU,GAAG;IACvB,eAAe,EAAE,YAAY,CAAC;IAC9B,YAAY,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,eAAO,MAAM,kBAAkB;;;;;;;CAOc,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// deck.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// Copyright (c) vis.gl contributors
|
|
4
|
+
const uniformBlock = /* glsl */ `\
|
|
5
|
+
uniform binOptionsUniforms {
|
|
6
|
+
vec2 hexOriginCommon;
|
|
7
|
+
float radiusCommon;
|
|
8
|
+
} binOptions;
|
|
9
|
+
`;
|
|
10
|
+
export const binOptionsUniforms = {
|
|
11
|
+
name: 'binOptions',
|
|
12
|
+
vs: uniformBlock,
|
|
13
|
+
uniformTypes: {
|
|
14
|
+
hexOriginCommon: 'vec2<f32>',
|
|
15
|
+
radiusCommon: 'f32'
|
|
16
|
+
}
|
|
17
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hexagon-cell-layer-vertex.glsl.d.ts","sourceRoot":"","sources":["../../src/hexagon-layer/hexagon-cell-layer-vertex.glsl.ts"],"names":[],"mappings":";AAMA,wBAkEE"}
|