@deck.gl/aggregation-layers 9.0.40 → 9.1.0-beta.3
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 +70 -0
- package/dist/common/aggregation-layer.js.map +1 -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 +5 -0
- package/dist/common/aggregator/aggregator.js.map +1 -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 +67 -0
- package/dist/common/aggregator/cpu-aggregator/aggregate.js.map +1 -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 +140 -0
- package/dist/common/aggregator/cpu-aggregator/cpu-aggregator.js.map +1 -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 +44 -0
- package/dist/common/aggregator/cpu-aggregator/sort-bins.js.map +1 -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 +56 -0
- package/dist/common/aggregator/cpu-aggregator/vertex-accessor.js.map +1 -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 +21 -0
- package/dist/common/aggregator/gpu-aggregator/aggregation-transform-uniforms.js.map +1 -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 +18 -0
- package/dist/common/aggregator/gpu-aggregator/bin-sorter-uniforms.js.map +1 -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 +25 -0
- package/dist/common/aggregator/gpu-aggregator/utils.js.map +1 -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 +216 -0
- package/dist/common/aggregator/gpu-aggregator/webgl-aggregation-transform.js.map +1 -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 +202 -0
- package/dist/common/aggregator/gpu-aggregator/webgl-aggregator.js.map +1 -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 +224 -0
- package/dist/common/aggregator/gpu-aggregator/webgl-bin-sorter.js.map +1 -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 +6 -0
- package/dist/common/aggregator/index.js.map +1 -0
- package/dist/common/types.d.ts +11 -0
- package/dist/common/types.d.ts.map +1 -0
- package/dist/common/types.js +5 -0
- package/dist/common/types.js.map +1 -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 +21 -0
- package/dist/common/utils/bounds-utils.js.map +1 -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 +66 -0
- package/dist/common/utils/color-utils.js.map +1 -0
- package/dist/common/utils/prop-utils.d.ts.map +1 -0
- package/dist/common/utils/prop-utils.js +13 -0
- package/dist/common/utils/prop-utils.js.map +1 -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 +181 -0
- package/dist/common/utils/scale-utils.js.map +1 -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 +18 -0
- package/dist/contour-layer/bin-options-uniforms.js.map +1 -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 +233 -192
- package/dist/contour-layer/contour-layer.js.map +1 -0
- 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 +25 -29
- package/dist/contour-layer/contour-utils.js.map +1 -0
- package/dist/contour-layer/marching-squares-codes.d.ts.map +1 -1
- package/dist/contour-layer/marching-squares-codes.js +4 -0
- package/dist/contour-layer/marching-squares-codes.js.map +1 -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 +72 -68
- package/dist/contour-layer/marching-squares.js.map +1 -0
- 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 +47 -0
- package/dist/contour-layer/value-reader.js.map +1 -0
- package/dist/dist.dev.js +4844 -4083
- 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 +18 -0
- package/dist/grid-layer/bin-options-uniforms.js.map +1 -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 +52 -0
- package/dist/grid-layer/grid-cell-layer-vertex.glsl.js.map +1 -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 +94 -0
- package/dist/grid-layer/grid-cell-layer.js.map +1 -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 +24 -0
- package/dist/grid-layer/grid-layer-uniforms.js.map +1 -0
- package/dist/grid-layer/grid-layer.d.ts +176 -14
- package/dist/grid-layer/grid-layer.d.ts.map +1 -1
- package/dist/grid-layer/grid-layer.js +343 -46
- package/dist/grid-layer/grid-layer.js.map +1 -0
- 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} +7 -21
- package/dist/heatmap-layer/aggregation-layer.js.map +1 -0
- 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 +33 -0
- package/dist/heatmap-layer/heatmap-layer-uniforms.js.map +1 -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 +4 -0
- package/dist/heatmap-layer/heatmap-layer-utils.js.map +1 -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 +44 -33
- package/dist/heatmap-layer/heatmap-layer.js.map +1 -0
- package/dist/heatmap-layer/max-fs.glsl.d.ts.map +1 -1
- package/dist/heatmap-layer/max-fs.glsl.js +4 -0
- package/dist/heatmap-layer/max-fs.glsl.js.map +1 -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 +7 -4
- package/dist/heatmap-layer/max-vs.glsl.js.map +1 -0
- 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 +6 -23
- package/dist/heatmap-layer/triangle-layer-fragment.glsl.js.map +1 -0
- 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 +23 -0
- package/dist/heatmap-layer/triangle-layer-uniforms.js.map +1 -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 +11 -30
- package/dist/heatmap-layer/triangle-layer-vertex.glsl.js.map +1 -0
- 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 +18 -30
- package/dist/heatmap-layer/triangle-layer.js.map +1 -0
- package/dist/heatmap-layer/weights-fs.glsl.d.ts.map +1 -1
- package/dist/heatmap-layer/weights-fs.glsl.js +4 -0
- package/dist/heatmap-layer/weights-fs.glsl.js.map +1 -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 +7 -7
- package/dist/heatmap-layer/weights-vs.glsl.js.map +1 -0
- 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 +18 -0
- package/dist/hexagon-layer/bin-options-uniforms.js.map +1 -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 +56 -0
- package/dist/hexagon-layer/hexagon-cell-layer-vertex.glsl.js.map +1 -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 +95 -0
- package/dist/hexagon-layer/hexagon-cell-layer.js.map +1 -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 +22 -0
- package/dist/hexagon-layer/hexagon-layer-uniforms.js.map +1 -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 +308 -123
- package/dist/hexagon-layer/hexagon-layer.js.map +1 -0
- 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 +70 -0
- package/dist/hexagon-layer/hexbin.js.map +1 -0
- package/dist/index.cjs +3026 -2947
- 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 +6 -27
- package/dist/index.js.map +1 -0
- 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 +16 -0
- package/dist/screen-grid-layer/bin-options-uniforms.js.map +1 -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 +53 -134
- package/dist/screen-grid-layer/screen-grid-cell-layer.js.map +1 -0
- 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 +5 -24
- package/dist/screen-grid-layer/screen-grid-layer-fragment.glsl.js.map +1 -0
- 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 +20 -0
- package/dist/screen-grid-layer/screen-grid-layer-uniforms.js.map +1 -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 +22 -62
- package/dist/screen-grid-layer/screen-grid-layer-vertex.glsl.js.map +1 -0
- 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 +158 -174
- package/dist/screen-grid-layer/screen-grid-layer.js.map +1 -0
- 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,22 +1,6 @@
|
|
|
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
|
|
|
21
5
|
import {
|
|
22
6
|
CompositeLayer,
|
|
@@ -27,12 +11,13 @@ import {
|
|
|
27
11
|
CompositeLayerProps,
|
|
28
12
|
Attribute
|
|
29
13
|
} from '@deck.gl/core';
|
|
30
|
-
import {filterProps} from '
|
|
14
|
+
import {filterProps} from '../common/utils/prop-utils';
|
|
31
15
|
|
|
32
16
|
export type AggregationLayerProps<DataT> = CompositeLayerProps & {
|
|
33
17
|
data: LayerDataSource<DataT>;
|
|
34
18
|
};
|
|
35
19
|
|
|
20
|
+
/** Legacy AggregationLayer, to be removed in v9.1 */
|
|
36
21
|
export default abstract class AggregationLayer<
|
|
37
22
|
DataT,
|
|
38
23
|
ExtraPropsT extends {} = {}
|
|
@@ -83,7 +68,7 @@ export default abstract class AggregationLayer<
|
|
|
83
68
|
getModuleSettings() {
|
|
84
69
|
// For regular layer draw this happens during draw cycle (_drawLayersInViewport) not during update cycle
|
|
85
70
|
// For aggregation layers this is called during updateState to update aggregation data
|
|
86
|
-
// NOTE: it is similar to LayerPass.
|
|
71
|
+
// NOTE: it is similar to LayerPass._getShaderModuleProps() but doesn't inlcude `effects` it is not needed for aggregation
|
|
87
72
|
const {viewport, mousePosition, device} = this.context;
|
|
88
73
|
const moduleSettings = Object.assign(Object.create(this.props), {
|
|
89
74
|
viewport,
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
// deck.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// Copyright (c) vis.gl contributors
|
|
4
|
+
|
|
5
|
+
import {Texture} from '@luma.gl/core';
|
|
6
|
+
import type {ShaderModule} from '@luma.gl/shadertools';
|
|
7
|
+
|
|
8
|
+
const uniformBlock = `\
|
|
9
|
+
uniform weightUniforms {
|
|
10
|
+
vec4 commonBounds;
|
|
11
|
+
float radiusPixels;
|
|
12
|
+
float textureWidth;
|
|
13
|
+
float weightsScale;
|
|
14
|
+
} weight;
|
|
15
|
+
`;
|
|
16
|
+
export type WeightProps = {
|
|
17
|
+
commonBounds: [number, number, number, number];
|
|
18
|
+
radiusPixels: number;
|
|
19
|
+
textureWidth: number;
|
|
20
|
+
weightsScale: number;
|
|
21
|
+
weightsTexture: Texture;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export const weightUniforms = {
|
|
25
|
+
name: 'weight',
|
|
26
|
+
vs: uniformBlock,
|
|
27
|
+
uniformTypes: {
|
|
28
|
+
commonBounds: 'vec4<f32>',
|
|
29
|
+
radiusPixels: 'f32',
|
|
30
|
+
textureWidth: 'f32',
|
|
31
|
+
weightsScale: 'f32'
|
|
32
|
+
}
|
|
33
|
+
} as const satisfies ShaderModule<WeightProps>;
|
|
34
|
+
|
|
35
|
+
export type MaxWeightProps = {
|
|
36
|
+
inTexture: Texture;
|
|
37
|
+
textureSize: number;
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
export const maxWeightUniforms = {
|
|
41
|
+
name: 'maxWeight',
|
|
42
|
+
vs: `\
|
|
43
|
+
uniform maxWeightUniforms {
|
|
44
|
+
float textureSize;
|
|
45
|
+
} maxWeight;
|
|
46
|
+
`,
|
|
47
|
+
uniformTypes: {
|
|
48
|
+
textureSize: 'f32'
|
|
49
|
+
}
|
|
50
|
+
} as const satisfies ShaderModule<MaxWeightProps>;
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
// deck.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// Copyright (c) vis.gl contributors
|
|
4
|
+
|
|
1
5
|
export function getBounds(points: number[][]): number[] {
|
|
2
6
|
// Now build bounding box in world space (aligned to world coordiante system)
|
|
3
7
|
const x = points.map(p => p[0]);
|
|
@@ -38,7 +42,11 @@ export function packVertices(points: number[][], dimensions: number = 2): Float3
|
|
|
38
42
|
}
|
|
39
43
|
|
|
40
44
|
// Expands boundingBox:[xMin, yMin, xMax, yMax] to match aspect ratio of given width and height
|
|
41
|
-
export function scaleToAspectRatio(
|
|
45
|
+
export function scaleToAspectRatio(
|
|
46
|
+
boundingBox: [number, number, number, number],
|
|
47
|
+
width: number,
|
|
48
|
+
height: number
|
|
49
|
+
): [number, number, number, number] {
|
|
42
50
|
const [xMin, yMin, xMax, yMax] = boundingBox;
|
|
43
51
|
|
|
44
52
|
const currentWidth = xMax - xMin;
|
|
@@ -1,22 +1,6 @@
|
|
|
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
|
|
|
21
5
|
/* global setTimeout clearTimeout */
|
|
22
6
|
import {
|
|
@@ -41,15 +25,22 @@ import {
|
|
|
41
25
|
log,
|
|
42
26
|
Position,
|
|
43
27
|
UpdateParameters,
|
|
44
|
-
DefaultProps
|
|
28
|
+
DefaultProps,
|
|
29
|
+
project32
|
|
45
30
|
} from '@deck.gl/core';
|
|
46
31
|
import TriangleLayer from './triangle-layer';
|
|
47
|
-
import AggregationLayer, {AggregationLayerProps} from '
|
|
48
|
-
import {defaultColorRange, colorRangeToFlatArray} from '../utils/color-utils';
|
|
32
|
+
import AggregationLayer, {AggregationLayerProps} from './aggregation-layer';
|
|
33
|
+
import {defaultColorRange, colorRangeToFlatArray} from '../common/utils/color-utils';
|
|
49
34
|
import weightsVs from './weights-vs.glsl';
|
|
50
35
|
import weightsFs from './weights-fs.glsl';
|
|
51
36
|
import maxVs from './max-vs.glsl';
|
|
52
37
|
import maxFs from './max-fs.glsl';
|
|
38
|
+
import {
|
|
39
|
+
MaxWeightProps,
|
|
40
|
+
maxWeightUniforms,
|
|
41
|
+
WeightProps,
|
|
42
|
+
weightUniforms
|
|
43
|
+
} from './heatmap-layer-uniforms';
|
|
53
44
|
|
|
54
45
|
const RESOLUTION = 2; // (number of common space pixels) / (number texels)
|
|
55
46
|
const TEXTURE_PROPS: TextureProps = {
|
|
@@ -201,6 +192,15 @@ export default class HeatmapLayer<
|
|
|
201
192
|
viewportCorners: number[][];
|
|
202
193
|
};
|
|
203
194
|
|
|
195
|
+
getShaders(shaders: any) {
|
|
196
|
+
let modules = [project32];
|
|
197
|
+
if (shaders.modules) {
|
|
198
|
+
modules = [...modules, ...shaders.modules];
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
return super.getShaders({...shaders, modules});
|
|
202
|
+
}
|
|
203
|
+
|
|
204
204
|
initializeState() {
|
|
205
205
|
super.initializeAggregationLayer(DIMENSIONS);
|
|
206
206
|
this.setState({colorDomain: DEFAULT_COLOR_DOMAIN});
|
|
@@ -391,7 +391,7 @@ export default class HeatmapLayer<
|
|
|
391
391
|
}
|
|
392
392
|
}
|
|
393
393
|
|
|
394
|
-
_createWeightsTransform(shaders: {vs: string; fs?: string}) {
|
|
394
|
+
_createWeightsTransform(shaders: {vs: string; fs?: string; modules: any[]}) {
|
|
395
395
|
let {weightsTransform} = this.state;
|
|
396
396
|
const {weightsTexture} = this.state;
|
|
397
397
|
const attributeManager = this.getAttributeManager()!;
|
|
@@ -411,7 +411,8 @@ export default class HeatmapLayer<
|
|
|
411
411
|
blendAlphaDstFactor: 'one'
|
|
412
412
|
},
|
|
413
413
|
topology: 'point-list',
|
|
414
|
-
...shaders
|
|
414
|
+
...shaders,
|
|
415
|
+
modules: [...shaders.modules, weightUniforms]
|
|
415
416
|
} as TextureTransformProps);
|
|
416
417
|
|
|
417
418
|
this.setState({weightsTransform});
|
|
@@ -428,12 +429,14 @@ export default class HeatmapLayer<
|
|
|
428
429
|
});
|
|
429
430
|
this._createWeightsTransform(weightsTransformShaders);
|
|
430
431
|
|
|
431
|
-
const maxWeightsTransformShaders = this.getShaders({
|
|
432
|
+
const maxWeightsTransformShaders = this.getShaders({
|
|
433
|
+
vs: maxVs,
|
|
434
|
+
fs: maxFs,
|
|
435
|
+
modules: [maxWeightUniforms]
|
|
436
|
+
});
|
|
432
437
|
const maxWeightTransform = new TextureTransform(device, {
|
|
433
438
|
id: `${this.id}-max-weights-transform`,
|
|
434
|
-
|
|
435
|
-
uniforms: {textureSize},
|
|
436
|
-
targetTexture: maxWeightsTexture,
|
|
439
|
+
targetTexture: maxWeightsTexture!,
|
|
437
440
|
...maxWeightsTransformShaders,
|
|
438
441
|
vertexCount: textureSize * textureSize,
|
|
439
442
|
topology: 'point-list',
|
|
@@ -448,6 +451,11 @@ export default class HeatmapLayer<
|
|
|
448
451
|
}
|
|
449
452
|
});
|
|
450
453
|
|
|
454
|
+
const maxWeightProps: MaxWeightProps = {inTexture: weightsTexture!, textureSize};
|
|
455
|
+
maxWeightTransform.model.shaderInputs.setProps({
|
|
456
|
+
maxWeight: maxWeightProps
|
|
457
|
+
});
|
|
458
|
+
|
|
451
459
|
this.setState({
|
|
452
460
|
weightsTexture,
|
|
453
461
|
maxWeightsTexture,
|
|
@@ -486,8 +494,8 @@ export default class HeatmapLayer<
|
|
|
486
494
|
const viewportCorners = [
|
|
487
495
|
viewport.unproject([0, 0]),
|
|
488
496
|
viewport.unproject([viewport.width, 0]),
|
|
489
|
-
viewport.unproject([
|
|
490
|
-
viewport.unproject([
|
|
497
|
+
viewport.unproject([0, viewport.height]),
|
|
498
|
+
viewport.unproject([viewport.width, viewport.height])
|
|
491
499
|
].map(p => p.map(Math.fround));
|
|
492
500
|
|
|
493
501
|
// #1: get world bounds for current viewport extends
|
|
@@ -550,9 +558,10 @@ export default class HeatmapLayer<
|
|
|
550
558
|
|
|
551
559
|
if (colorTexture && colorTexture?.width === colorRange.length) {
|
|
552
560
|
// TODO(v9): Unclear whether `setSubImageData` is a public API, or what to use if not.
|
|
553
|
-
(colorTexture as any).
|
|
561
|
+
(colorTexture as any).setTexture2DData({data: colors});
|
|
554
562
|
} else {
|
|
555
563
|
colorTexture?.destroy();
|
|
564
|
+
// @ts-expect-error TODO(ib) - texture API change
|
|
556
565
|
colorTexture = this.context.device.createTexture({
|
|
557
566
|
...TEXTURE_PROPS,
|
|
558
567
|
data: colors,
|
|
@@ -565,7 +574,7 @@ export default class HeatmapLayer<
|
|
|
565
574
|
|
|
566
575
|
_updateWeightmap() {
|
|
567
576
|
const {radiusPixels, colorDomain, aggregation} = this.props;
|
|
568
|
-
const {worldBounds, textureSize, weightsScale} = this.state;
|
|
577
|
+
const {worldBounds, textureSize, weightsScale, weightsTexture} = this.state;
|
|
569
578
|
const weightsTransform = this.state.weightsTransform!;
|
|
570
579
|
this.state.isWeightMapDirty = false;
|
|
571
580
|
|
|
@@ -588,11 +597,22 @@ export default class HeatmapLayer<
|
|
|
588
597
|
const attributeManager = this.getAttributeManager()!;
|
|
589
598
|
const attributes = attributeManager.getAttributes();
|
|
590
599
|
const moduleSettings = this.getModuleSettings();
|
|
591
|
-
const uniforms = {radiusPixels, commonBounds, textureWidth: textureSize, weightsScale};
|
|
592
600
|
this._setModelAttributes(weightsTransform.model, attributes);
|
|
593
601
|
weightsTransform.model.setVertexCount(this.getNumInstances());
|
|
594
|
-
|
|
595
|
-
|
|
602
|
+
|
|
603
|
+
const weightProps: WeightProps = {
|
|
604
|
+
radiusPixels,
|
|
605
|
+
commonBounds,
|
|
606
|
+
textureWidth: textureSize,
|
|
607
|
+
weightsScale,
|
|
608
|
+
weightsTexture: weightsTexture!
|
|
609
|
+
};
|
|
610
|
+
const {viewport, devicePixelRatio, coordinateSystem, coordinateOrigin} = moduleSettings;
|
|
611
|
+
const {modelMatrix} = this.props;
|
|
612
|
+
weightsTransform.model.shaderInputs.setProps({
|
|
613
|
+
project: {viewport, devicePixelRatio, modelMatrix, coordinateSystem, coordinateOrigin},
|
|
614
|
+
weight: weightProps
|
|
615
|
+
});
|
|
596
616
|
weightsTransform.run({
|
|
597
617
|
parameters: {viewport: [0, 0, textureSize, textureSize]},
|
|
598
618
|
clearColor: [0, 0, 0, 0]
|
|
@@ -623,7 +643,10 @@ export default class HeatmapLayer<
|
|
|
623
643
|
// input: worldBounds: [minLong, minLat, maxLong, maxLat]
|
|
624
644
|
// input: opts.useLayerCoordinateSystem : layers coordiante system is used
|
|
625
645
|
// optput: commonBounds: [minX, minY, maxX, maxY] scaled to fit the current texture
|
|
626
|
-
_worldToCommonBounds(
|
|
646
|
+
_worldToCommonBounds(
|
|
647
|
+
worldBounds,
|
|
648
|
+
opts: {useLayerCoordinateSystem?: boolean} = {}
|
|
649
|
+
): [number, number, number, number] {
|
|
627
650
|
const {useLayerCoordinateSystem = false} = opts;
|
|
628
651
|
const [minLong, minLat, maxLong, maxLat] = worldBounds;
|
|
629
652
|
const {viewport} = this.context;
|
|
@@ -1,15 +1,18 @@
|
|
|
1
|
+
// deck.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// Copyright (c) vis.gl contributors
|
|
4
|
+
|
|
1
5
|
export default `\
|
|
2
6
|
#version 300 es
|
|
3
7
|
uniform sampler2D inTexture;
|
|
4
|
-
uniform float textureSize;
|
|
5
8
|
out vec4 outTexture;
|
|
6
9
|
|
|
7
10
|
void main()
|
|
8
11
|
{
|
|
9
12
|
// Sample every pixel in texture
|
|
10
|
-
int yIndex = gl_VertexID / int(textureSize);
|
|
11
|
-
int xIndex = gl_VertexID - (yIndex * int(textureSize));
|
|
12
|
-
vec2 uv = (0.5 + vec2(float(xIndex), float(yIndex))) / textureSize;
|
|
13
|
+
int yIndex = gl_VertexID / int(maxWeight.textureSize);
|
|
14
|
+
int xIndex = gl_VertexID - (yIndex * int(maxWeight.textureSize));
|
|
15
|
+
vec2 uv = (0.5 + vec2(float(xIndex), float(yIndex))) / maxWeight.textureSize;
|
|
13
16
|
outTexture = texture(inTexture, uv);
|
|
14
17
|
|
|
15
18
|
gl_Position = vec4(0.0, 0.0, 0.0, 1.0);
|
|
@@ -1,22 +1,6 @@
|
|
|
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
|
|
|
21
5
|
export default `\
|
|
22
6
|
#version 300 es
|
|
@@ -24,10 +8,8 @@ export default `\
|
|
|
24
8
|
|
|
25
9
|
precision highp float;
|
|
26
10
|
|
|
27
|
-
uniform float opacity;
|
|
28
11
|
uniform sampler2D weightsTexture;
|
|
29
12
|
uniform sampler2D colorTexture;
|
|
30
|
-
uniform float aggregationMode;
|
|
31
13
|
|
|
32
14
|
in vec2 vTexCoords;
|
|
33
15
|
in float vIntensityMin;
|
|
@@ -46,7 +28,7 @@ void main(void) {
|
|
|
46
28
|
vec4 weights = texture(weightsTexture, vTexCoords);
|
|
47
29
|
float weight = weights.r;
|
|
48
30
|
|
|
49
|
-
if (aggregationMode > 0.5) {
|
|
31
|
+
if (triangle.aggregationMode > 0.5) {
|
|
50
32
|
weight /= max(1.0, weights.a);
|
|
51
33
|
}
|
|
52
34
|
|
|
@@ -56,7 +38,7 @@ void main(void) {
|
|
|
56
38
|
}
|
|
57
39
|
|
|
58
40
|
vec4 linearColor = getLinearColor(weight);
|
|
59
|
-
linearColor.a *= opacity;
|
|
41
|
+
linearColor.a *= layer.opacity;
|
|
60
42
|
fragColor = linearColor;
|
|
61
43
|
}
|
|
62
44
|
`;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
// deck.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// Copyright (c) vis.gl contributors
|
|
4
|
+
|
|
5
|
+
import {Texture} from '@luma.gl/core';
|
|
6
|
+
import type {ShaderModule} from '@luma.gl/shadertools';
|
|
7
|
+
|
|
8
|
+
const uniformBlock = `\
|
|
9
|
+
uniform triangleUniforms {
|
|
10
|
+
float aggregationMode;
|
|
11
|
+
vec2 colorDomain;
|
|
12
|
+
float intensity;
|
|
13
|
+
float threshold;
|
|
14
|
+
} triangle;
|
|
15
|
+
`;
|
|
16
|
+
|
|
17
|
+
export type TriangleProps = {
|
|
18
|
+
aggregationMode: number;
|
|
19
|
+
colorDomain: [number, number];
|
|
20
|
+
intensity: number;
|
|
21
|
+
threshold: number;
|
|
22
|
+
colorTexture: Texture;
|
|
23
|
+
maxTexture: Texture;
|
|
24
|
+
weightsTexture: Texture;
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export const triangleUniforms = {
|
|
28
|
+
name: 'triangle',
|
|
29
|
+
vs: uniformBlock,
|
|
30
|
+
fs: uniformBlock,
|
|
31
|
+
uniformTypes: {
|
|
32
|
+
aggregationMode: 'f32',
|
|
33
|
+
colorDomain: 'vec2<f32>',
|
|
34
|
+
intensity: 'f32',
|
|
35
|
+
threshold: 'f32'
|
|
36
|
+
}
|
|
37
|
+
} as const satisfies ShaderModule<TriangleProps>;
|
|
@@ -1,22 +1,6 @@
|
|
|
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
|
|
|
21
5
|
// Inspired by screen-grid-layer vertex shader in deck.gl
|
|
22
6
|
|
|
@@ -25,10 +9,6 @@ export default `\
|
|
|
25
9
|
#define SHADER_NAME heatp-map-layer-vertex-shader
|
|
26
10
|
|
|
27
11
|
uniform sampler2D maxTexture;
|
|
28
|
-
uniform float intensity;
|
|
29
|
-
uniform vec2 colorDomain;
|
|
30
|
-
uniform float threshold;
|
|
31
|
-
uniform float aggregationMode;
|
|
32
12
|
|
|
33
13
|
in vec3 positions;
|
|
34
14
|
in vec2 texCoords;
|
|
@@ -41,14 +21,14 @@ void main(void) {
|
|
|
41
21
|
gl_Position = project_position_to_clipspace(positions, vec3(0.0), vec3(0.0));
|
|
42
22
|
vTexCoords = texCoords;
|
|
43
23
|
vec4 maxTexture = texture(maxTexture, vec2(0.5));
|
|
44
|
-
float maxValue = aggregationMode < 0.5 ? maxTexture.r : maxTexture.g;
|
|
45
|
-
float minValue = maxValue * threshold;
|
|
46
|
-
if (colorDomain[1] > 0.) {
|
|
24
|
+
float maxValue = triangle.aggregationMode < 0.5 ? maxTexture.r : maxTexture.g;
|
|
25
|
+
float minValue = maxValue * triangle.threshold;
|
|
26
|
+
if (triangle.colorDomain[1] > 0.) {
|
|
47
27
|
// if user specified custom domain use it.
|
|
48
|
-
maxValue = colorDomain[1];
|
|
49
|
-
minValue = colorDomain[0];
|
|
28
|
+
maxValue = triangle.colorDomain[1];
|
|
29
|
+
minValue = triangle.colorDomain[0];
|
|
50
30
|
}
|
|
51
|
-
vIntensityMax = intensity / maxValue;
|
|
52
|
-
vIntensityMin = intensity / minValue;
|
|
31
|
+
vIntensityMax = triangle.intensity / maxValue;
|
|
32
|
+
vIntensityMin = triangle.intensity / minValue;
|
|
53
33
|
}
|
|
54
34
|
`;
|
|
@@ -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
|
|
|
21
5
|
import type {Buffer, Device, Texture} from '@luma.gl/core';
|
|
22
6
|
import {Model} from '@luma.gl/engine';
|
|
23
7
|
import {Layer, LayerContext, project32} from '@deck.gl/core';
|
|
24
8
|
import vs from './triangle-layer-vertex.glsl';
|
|
25
9
|
import fs from './triangle-layer-fragment.glsl';
|
|
10
|
+
import {TriangleProps, triangleUniforms} from './triangle-layer-uniforms';
|
|
26
11
|
|
|
27
12
|
type _TriangleLayerProps = {
|
|
28
13
|
data: {attributes: {positions: Buffer; texCoords: Buffer}};
|
|
29
|
-
colorDomain: number
|
|
30
|
-
aggregationMode:
|
|
14
|
+
colorDomain: [number, number];
|
|
15
|
+
aggregationMode: number;
|
|
31
16
|
threshold: number;
|
|
32
17
|
intensity: number;
|
|
33
18
|
vertexCount: number;
|
|
@@ -46,7 +31,7 @@ export default class TriangleLayer extends Layer<_TriangleLayerProps> {
|
|
|
46
31
|
};
|
|
47
32
|
|
|
48
33
|
getShaders() {
|
|
49
|
-
return {vs, fs, modules: [project32]};
|
|
34
|
+
return super.getShaders({vs, fs, modules: [project32, triangleUniforms]});
|
|
50
35
|
}
|
|
51
36
|
|
|
52
37
|
initializeState({device}: LayerContext): void {
|
|
@@ -54,32 +39,42 @@ export default class TriangleLayer extends Layer<_TriangleLayerProps> {
|
|
|
54
39
|
}
|
|
55
40
|
|
|
56
41
|
_getModel(device: Device): Model {
|
|
57
|
-
const {vertexCount, data
|
|
42
|
+
const {vertexCount, data} = this.props;
|
|
58
43
|
|
|
59
44
|
return new Model(device, {
|
|
60
45
|
...this.getShaders(),
|
|
61
46
|
id: this.props.id,
|
|
62
|
-
bindings: {weightsTexture, maxTexture, colorTexture},
|
|
63
47
|
attributes: data.attributes,
|
|
64
48
|
bufferLayout: [
|
|
65
49
|
{name: 'positions', format: 'float32x3'},
|
|
66
50
|
{name: 'texCoords', format: 'float32x2'}
|
|
67
51
|
],
|
|
68
|
-
topology: 'triangle-
|
|
52
|
+
topology: 'triangle-strip',
|
|
69
53
|
vertexCount
|
|
70
54
|
});
|
|
71
55
|
}
|
|
72
56
|
|
|
73
|
-
draw(
|
|
57
|
+
draw(): void {
|
|
74
58
|
const {model} = this.state;
|
|
75
|
-
const {
|
|
76
|
-
|
|
77
|
-
|
|
59
|
+
const {
|
|
60
|
+
aggregationMode,
|
|
61
|
+
colorDomain,
|
|
78
62
|
intensity,
|
|
79
63
|
threshold,
|
|
64
|
+
colorTexture,
|
|
65
|
+
maxTexture,
|
|
66
|
+
weightsTexture
|
|
67
|
+
} = this.props;
|
|
68
|
+
const triangleProps: TriangleProps = {
|
|
80
69
|
aggregationMode,
|
|
81
|
-
colorDomain
|
|
82
|
-
|
|
70
|
+
colorDomain,
|
|
71
|
+
intensity,
|
|
72
|
+
threshold,
|
|
73
|
+
colorTexture,
|
|
74
|
+
maxTexture,
|
|
75
|
+
weightsTexture
|
|
76
|
+
};
|
|
77
|
+
model.shaderInputs.setProps({triangle: triangleProps});
|
|
83
78
|
model.draw(this.context.renderPass);
|
|
84
79
|
}
|
|
85
80
|
}
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
+
// deck.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// Copyright (c) vis.gl contributors
|
|
4
|
+
|
|
1
5
|
export default `\
|
|
2
6
|
#version 300 es
|
|
3
7
|
in vec3 positions;
|
|
4
8
|
in vec3 positions64Low;
|
|
5
9
|
in float weights;
|
|
6
10
|
out vec4 weightsTexture;
|
|
7
|
-
uniform float radiusPixels;
|
|
8
|
-
uniform float textureWidth;
|
|
9
|
-
uniform vec4 commonBounds;
|
|
10
|
-
uniform float weightsScale;
|
|
11
11
|
|
|
12
12
|
void main()
|
|
13
13
|
{
|
|
14
|
-
weightsTexture = vec4(weights * weightsScale, 0., 0., 1.);
|
|
14
|
+
weightsTexture = vec4(weights * weight.weightsScale, 0., 0., 1.);
|
|
15
15
|
|
|
16
|
-
float radiusTexels = project_pixel_size(radiusPixels) * textureWidth / (commonBounds.z - commonBounds.x);
|
|
16
|
+
float radiusTexels = project_pixel_size(weight.radiusPixels) * weight.textureWidth / (weight.commonBounds.z - weight.commonBounds.x);
|
|
17
17
|
gl_PointSize = radiusTexels * 2.;
|
|
18
18
|
|
|
19
19
|
vec3 commonPosition = project_position(positions, positions64Low);
|
|
20
20
|
|
|
21
21
|
// // map xy from commonBounds to [-1, 1]
|
|
22
|
-
gl_Position.xy = (commonPosition.xy - commonBounds.xy) / (commonBounds.zw - commonBounds.xy) ;
|
|
22
|
+
gl_Position.xy = (commonPosition.xy - weight.commonBounds.xy) / (weight.commonBounds.zw - weight.commonBounds.xy) ;
|
|
23
23
|
gl_Position.xy = (gl_Position.xy * 2.) - (1.);
|
|
24
24
|
gl_Position.w = 1.0;
|
|
25
25
|
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
// deck.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// Copyright (c) vis.gl contributors
|
|
4
|
+
|
|
5
|
+
import type {ShaderModule} from '@luma.gl/shadertools';
|
|
6
|
+
import {NumberArray2} from '@math.gl/core';
|
|
7
|
+
|
|
8
|
+
const uniformBlock = /* glsl */ `\
|
|
9
|
+
uniform binOptionsUniforms {
|
|
10
|
+
vec2 hexOriginCommon;
|
|
11
|
+
float radiusCommon;
|
|
12
|
+
} binOptions;
|
|
13
|
+
`;
|
|
14
|
+
|
|
15
|
+
export type BinOptions = {
|
|
16
|
+
hexOriginCommon: NumberArray2;
|
|
17
|
+
radiusCommon: number;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export const binOptionsUniforms = {
|
|
21
|
+
name: 'binOptions',
|
|
22
|
+
vs: uniformBlock,
|
|
23
|
+
uniformTypes: {
|
|
24
|
+
hexOriginCommon: 'vec2<f32>',
|
|
25
|
+
radiusCommon: 'f32'
|
|
26
|
+
}
|
|
27
|
+
} as const satisfies ShaderModule<BinOptions>;
|