@deck.gl/aggregation-layers 9.0.0-alpha.7 → 9.0.0-beta.10
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/{typed → dist}/aggregation-layer.d.ts.map +1 -1
- package/dist/aggregation-layer.js +153 -0
- package/{typed → dist}/contour-layer/contour-layer.d.ts +1 -1
- package/dist/contour-layer/contour-layer.d.ts.map +1 -0
- package/dist/contour-layer/contour-layer.js +240 -0
- package/dist/contour-layer/contour-utils.js +64 -0
- package/dist/contour-layer/marching-squares-codes.js +337 -0
- package/dist/contour-layer/marching-squares.js +147 -0
- package/{typed → dist}/cpu-grid-layer/cpu-grid-layer.d.ts +3 -3
- package/dist/cpu-grid-layer/cpu-grid-layer.d.ts.map +1 -0
- package/dist/cpu-grid-layer/cpu-grid-layer.js +129 -0
- package/dist/cpu-grid-layer/grid-aggregator.js +141 -0
- package/dist/dist.dev.js +1447 -10846
- package/dist/gpu-grid-layer/gpu-grid-cell-layer-fragment.glsl.js +30 -0
- package/dist/gpu-grid-layer/gpu-grid-cell-layer-vertex.glsl.js +112 -0
- package/{typed → dist}/gpu-grid-layer/gpu-grid-cell-layer.d.ts +1 -1
- package/dist/gpu-grid-layer/gpu-grid-cell-layer.d.ts.map +1 -0
- package/dist/gpu-grid-layer/gpu-grid-cell-layer.js +145 -0
- package/{typed → dist}/gpu-grid-layer/gpu-grid-layer.d.ts +4 -4
- package/dist/gpu-grid-layer/gpu-grid-layer.d.ts.map +1 -0
- package/dist/gpu-grid-layer/gpu-grid-layer.js +288 -0
- package/{typed → dist}/grid-aggregation-layer.d.ts +3 -3
- package/dist/grid-aggregation-layer.d.ts.map +1 -0
- package/dist/grid-aggregation-layer.js +172 -0
- package/{typed → dist}/grid-layer/grid-layer.d.ts +2 -2
- package/dist/grid-layer/grid-layer.d.ts.map +1 -0
- package/dist/grid-layer/grid-layer.js +63 -0
- package/{typed → dist}/heatmap-layer/heatmap-layer-utils.d.ts +0 -9
- package/dist/heatmap-layer/heatmap-layer-utils.d.ts.map +1 -0
- package/dist/heatmap-layer/heatmap-layer-utils.js +63 -0
- package/{typed → dist}/heatmap-layer/heatmap-layer.d.ts +5 -6
- package/dist/heatmap-layer/heatmap-layer.d.ts.map +1 -0
- package/dist/heatmap-layer/heatmap-layer.js +455 -0
- package/dist/heatmap-layer/max-fs.glsl.js +9 -0
- package/dist/heatmap-layer/max-vs.glsl.d.ts +3 -0
- package/{typed → dist}/heatmap-layer/max-vs.glsl.d.ts.map +1 -1
- package/dist/heatmap-layer/max-vs.glsl.js +15 -0
- package/dist/heatmap-layer/triangle-layer-fragment.glsl.d.ts +3 -0
- package/dist/heatmap-layer/triangle-layer-fragment.glsl.js +51 -0
- package/dist/heatmap-layer/triangle-layer-vertex.glsl.js +47 -0
- package/{typed → dist}/heatmap-layer/triangle-layer.d.ts +10 -2
- package/dist/heatmap-layer/triangle-layer.d.ts.map +1 -0
- package/dist/heatmap-layer/triangle-layer.js +59 -0
- package/dist/heatmap-layer/weights-fs.glsl.js +17 -0
- package/dist/heatmap-layer/weights-vs.glsl.d.ts +3 -0
- package/{typed → dist}/heatmap-layer/weights-vs.glsl.d.ts.map +1 -1
- package/dist/heatmap-layer/weights-vs.glsl.js +21 -0
- package/dist/hexagon-layer/hexagon-aggregator.js +112 -0
- package/{typed → dist}/hexagon-layer/hexagon-layer.d.ts +4 -4
- package/dist/hexagon-layer/hexagon-layer.d.ts.map +1 -0
- package/dist/hexagon-layer/hexagon-layer.js +173 -0
- package/dist/index.cjs +4327 -0
- package/dist/index.cjs.map +7 -0
- package/dist/index.d.ts +20 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +32 -0
- package/{typed → dist}/screen-grid-layer/screen-grid-cell-layer.d.ts +2 -3
- package/dist/screen-grid-layer/screen-grid-cell-layer.d.ts.map +1 -0
- package/dist/screen-grid-layer/screen-grid-cell-layer.js +163 -0
- package/dist/screen-grid-layer/screen-grid-layer-fragment.glsl.js +35 -0
- package/dist/screen-grid-layer/screen-grid-layer-vertex.glsl.js +72 -0
- package/{typed → dist}/screen-grid-layer/screen-grid-layer.d.ts +1 -4
- package/dist/screen-grid-layer/screen-grid-layer.d.ts.map +1 -0
- package/dist/screen-grid-layer/screen-grid-layer.js +209 -0
- package/dist/types.js +1 -0
- package/dist/utils/aggregation-operation-utils.js +94 -0
- package/{typed → dist}/utils/bin-sorter.d.ts +1 -1
- package/dist/utils/bin-sorter.js +167 -0
- package/dist/utils/color-utils.js +53 -0
- package/dist/utils/cpu-aggregator.js +421 -0
- package/dist/utils/gpu-grid-aggregation/aggregate-all-fs.glsl.js +36 -0
- package/dist/utils/gpu-grid-aggregation/aggregate-all-vs.glsl.js +42 -0
- package/dist/utils/gpu-grid-aggregation/aggregate-to-grid-fs.glsl.js +30 -0
- package/dist/utils/gpu-grid-aggregation/aggregate-to-grid-vs.glsl.js +61 -0
- package/dist/utils/gpu-grid-aggregation/gpu-grid-aggregator-constants.js +41 -0
- package/dist/utils/gpu-grid-aggregation/gpu-grid-aggregator-utils.js +1 -0
- package/{typed → dist}/utils/gpu-grid-aggregation/gpu-grid-aggregator.d.ts.map +1 -1
- package/dist/utils/gpu-grid-aggregation/gpu-grid-aggregator.js +555 -0
- package/dist/utils/gpu-grid-aggregation/transform-mean-vs.glsl.js +32 -0
- package/dist/utils/grid-aggregation-utils.js +114 -0
- package/dist/utils/prop-utils.js +28 -0
- package/{typed → dist}/utils/resource-utils.d.ts.map +1 -1
- package/dist/utils/resource-utils.js +38 -0
- package/dist/utils/scale-utils.js +184 -0
- package/dist.min.js +299 -555
- package/package.json +19 -14
- package/src/aggregation-layer.ts +3 -1
- package/src/contour-layer/contour-layer.ts +4 -5
- package/src/cpu-grid-layer/cpu-grid-layer.ts +1 -2
- package/src/gpu-grid-layer/gpu-grid-cell-layer.ts +1 -1
- package/src/gpu-grid-layer/gpu-grid-layer.ts +3 -3
- package/src/grid-layer/grid-layer.ts +4 -2
- package/src/heatmap-layer/heatmap-layer-utils.ts +0 -23
- package/src/heatmap-layer/heatmap-layer.ts +92 -128
- package/src/heatmap-layer/max-vs.glsl.ts +11 -5
- package/src/heatmap-layer/triangle-layer-fragment.glsl.ts +2 -2
- package/src/heatmap-layer/triangle-layer.ts +17 -24
- package/src/heatmap-layer/weights-vs.glsl.ts +4 -2
- package/src/hexagon-layer/hexagon-layer.ts +2 -3
- package/src/screen-grid-layer/screen-grid-cell-layer.ts +0 -4
- package/src/screen-grid-layer/screen-grid-layer.ts +2 -12
- package/src/utils/cpu-aggregator.ts +1 -1
- package/src/utils/gpu-grid-aggregation/gpu-grid-aggregator.ts +14 -28
- package/src/utils/resource-utils.ts +2 -8
- package/dist/es5/aggregation-layer.js +0 -213
- package/dist/es5/aggregation-layer.js.map +0 -1
- package/dist/es5/contour-layer/contour-layer.js +0 -353
- package/dist/es5/contour-layer/contour-layer.js.map +0 -1
- package/dist/es5/contour-layer/contour-utils.js +0 -110
- package/dist/es5/contour-layer/contour-utils.js.map +0 -1
- package/dist/es5/contour-layer/marching-squares-codes.js +0 -152
- package/dist/es5/contour-layer/marching-squares-codes.js.map +0 -1
- package/dist/es5/contour-layer/marching-squares.js +0 -168
- package/dist/es5/contour-layer/marching-squares.js.map +0 -1
- package/dist/es5/cpu-grid-layer/cpu-grid-layer.js +0 -235
- package/dist/es5/cpu-grid-layer/cpu-grid-layer.js.map +0 -1
- package/dist/es5/cpu-grid-layer/grid-aggregator.js +0 -180
- package/dist/es5/cpu-grid-layer/grid-aggregator.js.map +0 -1
- package/dist/es5/gpu-grid-layer/gpu-grid-cell-layer-fragment.glsl.js +0 -9
- package/dist/es5/gpu-grid-layer/gpu-grid-cell-layer-fragment.glsl.js.map +0 -1
- package/dist/es5/gpu-grid-layer/gpu-grid-cell-layer-vertex.glsl.js +0 -9
- package/dist/es5/gpu-grid-layer/gpu-grid-cell-layer-vertex.glsl.js.map +0 -1
- package/dist/es5/gpu-grid-layer/gpu-grid-cell-layer.js +0 -247
- package/dist/es5/gpu-grid-layer/gpu-grid-cell-layer.js.map +0 -1
- package/dist/es5/gpu-grid-layer/gpu-grid-layer.js +0 -424
- package/dist/es5/gpu-grid-layer/gpu-grid-layer.js.map +0 -1
- package/dist/es5/grid-aggregation-layer.js +0 -280
- package/dist/es5/grid-aggregation-layer.js.map +0 -1
- package/dist/es5/grid-layer/grid-layer.js +0 -125
- package/dist/es5/grid-layer/grid-layer.js.map +0 -1
- package/dist/es5/heatmap-layer/heatmap-layer-utils.js +0 -122
- package/dist/es5/heatmap-layer/heatmap-layer-utils.js.map +0 -1
- package/dist/es5/heatmap-layer/heatmap-layer.js +0 -672
- package/dist/es5/heatmap-layer/heatmap-layer.js.map +0 -1
- package/dist/es5/heatmap-layer/max-fs.glsl.js +0 -9
- package/dist/es5/heatmap-layer/max-fs.glsl.js.map +0 -1
- package/dist/es5/heatmap-layer/max-vs.glsl.js +0 -9
- package/dist/es5/heatmap-layer/max-vs.glsl.js.map +0 -1
- package/dist/es5/heatmap-layer/triangle-layer-fragment.glsl.js +0 -9
- package/dist/es5/heatmap-layer/triangle-layer-fragment.glsl.js.map +0 -1
- package/dist/es5/heatmap-layer/triangle-layer-vertex.glsl.js +0 -9
- package/dist/es5/heatmap-layer/triangle-layer-vertex.glsl.js.map +0 -1
- package/dist/es5/heatmap-layer/triangle-layer.js +0 -122
- package/dist/es5/heatmap-layer/triangle-layer.js.map +0 -1
- package/dist/es5/heatmap-layer/weights-fs.glsl.js +0 -9
- package/dist/es5/heatmap-layer/weights-fs.glsl.js.map +0 -1
- package/dist/es5/heatmap-layer/weights-vs.glsl.js +0 -9
- package/dist/es5/heatmap-layer/weights-vs.glsl.js.map +0 -1
- package/dist/es5/hexagon-layer/hexagon-aggregator.js +0 -118
- package/dist/es5/hexagon-layer/hexagon-aggregator.js.map +0 -1
- package/dist/es5/hexagon-layer/hexagon-layer.js +0 -289
- package/dist/es5/hexagon-layer/hexagon-layer.js.map +0 -1
- package/dist/es5/index.js +0 -104
- package/dist/es5/index.js.map +0 -1
- package/dist/es5/screen-grid-layer/screen-grid-cell-layer.js +0 -244
- package/dist/es5/screen-grid-layer/screen-grid-cell-layer.js.map +0 -1
- package/dist/es5/screen-grid-layer/screen-grid-layer-fragment.glsl.js +0 -9
- package/dist/es5/screen-grid-layer/screen-grid-layer-fragment.glsl.js.map +0 -1
- package/dist/es5/screen-grid-layer/screen-grid-layer-vertex.glsl.js +0 -9
- package/dist/es5/screen-grid-layer/screen-grid-layer-vertex.glsl.js.map +0 -1
- package/dist/es5/screen-grid-layer/screen-grid-layer.js +0 -317
- package/dist/es5/screen-grid-layer/screen-grid-layer.js.map +0 -1
- package/dist/es5/types.js +0 -2
- package/dist/es5/types.js.map +0 -1
- package/dist/es5/utils/aggregation-operation-utils.js +0 -123
- package/dist/es5/utils/aggregation-operation-utils.js.map +0 -1
- package/dist/es5/utils/bin-sorter.js +0 -248
- package/dist/es5/utils/bin-sorter.js.map +0 -1
- package/dist/es5/utils/color-utils.js +0 -39
- package/dist/es5/utils/color-utils.js.map +0 -1
- package/dist/es5/utils/cpu-aggregator.js +0 -496
- package/dist/es5/utils/cpu-aggregator.js.map +0 -1
- package/dist/es5/utils/gpu-grid-aggregation/aggregate-all-fs.glsl.js +0 -9
- package/dist/es5/utils/gpu-grid-aggregation/aggregate-all-fs.glsl.js.map +0 -1
- package/dist/es5/utils/gpu-grid-aggregation/aggregate-all-vs.glsl.js +0 -9
- package/dist/es5/utils/gpu-grid-aggregation/aggregate-all-vs.glsl.js.map +0 -1
- package/dist/es5/utils/gpu-grid-aggregation/aggregate-to-grid-fs.glsl.js +0 -9
- package/dist/es5/utils/gpu-grid-aggregation/aggregate-to-grid-fs.glsl.js.map +0 -1
- package/dist/es5/utils/gpu-grid-aggregation/aggregate-to-grid-vs.glsl.js +0 -9
- package/dist/es5/utils/gpu-grid-aggregation/aggregate-to-grid-vs.glsl.js.map +0 -1
- package/dist/es5/utils/gpu-grid-aggregation/gpu-grid-aggregator-constants.js +0 -63
- package/dist/es5/utils/gpu-grid-aggregation/gpu-grid-aggregator-constants.js.map +0 -1
- package/dist/es5/utils/gpu-grid-aggregation/gpu-grid-aggregator-utils.js +0 -2
- package/dist/es5/utils/gpu-grid-aggregation/gpu-grid-aggregator-utils.js.map +0 -1
- package/dist/es5/utils/gpu-grid-aggregation/gpu-grid-aggregator.js +0 -732
- package/dist/es5/utils/gpu-grid-aggregation/gpu-grid-aggregator.js.map +0 -1
- package/dist/es5/utils/gpu-grid-aggregation/gpu-grid-aggregator.md +0 -155
- package/dist/es5/utils/gpu-grid-aggregation/transform-mean-vs.glsl.js +0 -9
- package/dist/es5/utils/gpu-grid-aggregation/transform-mean-vs.glsl.js.map +0 -1
- package/dist/es5/utils/grid-aggregation-utils.js +0 -118
- package/dist/es5/utils/grid-aggregation-utils.js.map +0 -1
- package/dist/es5/utils/prop-utils.js +0 -19
- package/dist/es5/utils/prop-utils.js.map +0 -1
- package/dist/es5/utils/resource-utils.js +0 -61
- package/dist/es5/utils/resource-utils.js.map +0 -1
- package/dist/es5/utils/scale-utils.js +0 -254
- package/dist/es5/utils/scale-utils.js.map +0 -1
- package/dist/esm/aggregation-layer.js +0 -154
- package/dist/esm/aggregation-layer.js.map +0 -1
- package/dist/esm/contour-layer/contour-layer.js +0 -316
- package/dist/esm/contour-layer/contour-layer.js.map +0 -1
- package/dist/esm/contour-layer/contour-utils.js +0 -81
- package/dist/esm/contour-layer/contour-utils.js.map +0 -1
- package/dist/esm/contour-layer/marching-squares-codes.js +0 -219
- package/dist/esm/contour-layer/marching-squares-codes.js.map +0 -1
- package/dist/esm/contour-layer/marching-squares.js +0 -151
- package/dist/esm/contour-layer/marching-squares.js.map +0 -1
- package/dist/esm/cpu-grid-layer/cpu-grid-layer.js +0 -186
- package/dist/esm/cpu-grid-layer/cpu-grid-layer.js.map +0 -1
- package/dist/esm/cpu-grid-layer/grid-aggregator.js +0 -142
- package/dist/esm/cpu-grid-layer/grid-aggregator.js.map +0 -1
- package/dist/esm/gpu-grid-layer/gpu-grid-cell-layer-fragment.glsl.js +0 -16
- package/dist/esm/gpu-grid-layer/gpu-grid-cell-layer-fragment.glsl.js.map +0 -1
- package/dist/esm/gpu-grid-layer/gpu-grid-cell-layer-vertex.glsl.js +0 -122
- package/dist/esm/gpu-grid-layer/gpu-grid-cell-layer-vertex.glsl.js.map +0 -1
- package/dist/esm/gpu-grid-layer/gpu-grid-cell-layer.js +0 -196
- package/dist/esm/gpu-grid-layer/gpu-grid-cell-layer.js.map +0 -1
- package/dist/esm/gpu-grid-layer/gpu-grid-layer.js +0 -399
- package/dist/esm/gpu-grid-layer/gpu-grid-layer.js.map +0 -1
- package/dist/esm/grid-aggregation-layer.js +0 -240
- package/dist/esm/grid-aggregation-layer.js.map +0 -1
- package/dist/esm/grid-layer/grid-layer.js +0 -80
- package/dist/esm/grid-layer/grid-layer.js.map +0 -1
- package/dist/esm/heatmap-layer/heatmap-layer-utils.js +0 -68
- package/dist/esm/heatmap-layer/heatmap-layer-utils.js.map +0 -1
- package/dist/esm/heatmap-layer/heatmap-layer.js +0 -626
- package/dist/esm/heatmap-layer/heatmap-layer.js.map +0 -1
- package/dist/esm/heatmap-layer/max-fs.glsl.js +0 -10
- package/dist/esm/heatmap-layer/max-fs.glsl.js.map +0 -1
- package/dist/esm/heatmap-layer/max-vs.glsl.js +0 -14
- package/dist/esm/heatmap-layer/max-vs.glsl.js.map +0 -1
- package/dist/esm/heatmap-layer/triangle-layer-fragment.glsl.js +0 -43
- package/dist/esm/heatmap-layer/triangle-layer-fragment.glsl.js.map +0 -1
- package/dist/esm/heatmap-layer/triangle-layer-vertex.glsl.js +0 -33
- package/dist/esm/heatmap-layer/triangle-layer-vertex.glsl.js.map +0 -1
- package/dist/esm/heatmap-layer/triangle-layer.js +0 -80
- package/dist/esm/heatmap-layer/triangle-layer.js.map +0 -1
- package/dist/esm/heatmap-layer/weights-fs.glsl.js +0 -22
- package/dist/esm/heatmap-layer/weights-fs.glsl.js.map +0 -1
- package/dist/esm/heatmap-layer/weights-vs.glsl.js +0 -25
- package/dist/esm/heatmap-layer/weights-vs.glsl.js.map +0 -1
- package/dist/esm/hexagon-layer/hexagon-aggregator.js +0 -87
- package/dist/esm/hexagon-layer/hexagon-aggregator.js.map +0 -1
- package/dist/esm/hexagon-layer/hexagon-layer.js +0 -232
- package/dist/esm/hexagon-layer/hexagon-layer.js.map +0 -1
- package/dist/esm/index.js +0 -13
- package/dist/esm/index.js.map +0 -1
- package/dist/esm/screen-grid-layer/screen-grid-cell-layer.js +0 -203
- package/dist/esm/screen-grid-layer/screen-grid-cell-layer.js.map +0 -1
- package/dist/esm/screen-grid-layer/screen-grid-layer-fragment.glsl.js +0 -21
- package/dist/esm/screen-grid-layer/screen-grid-layer-fragment.glsl.js.map +0 -1
- package/dist/esm/screen-grid-layer/screen-grid-layer-vertex.glsl.js +0 -66
- package/dist/esm/screen-grid-layer/screen-grid-layer-vertex.glsl.js.map +0 -1
- package/dist/esm/screen-grid-layer/screen-grid-layer.js +0 -285
- package/dist/esm/screen-grid-layer/screen-grid-layer.js.map +0 -1
- package/dist/esm/types.js +0 -2
- package/dist/esm/types.js.map +0 -1
- package/dist/esm/utils/aggregation-operation-utils.js +0 -91
- package/dist/esm/utils/aggregation-operation-utils.js.map +0 -1
- package/dist/esm/utils/bin-sorter.js +0 -165
- package/dist/esm/utils/bin-sorter.js.map +0 -1
- package/dist/esm/utils/color-utils.js +0 -28
- package/dist/esm/utils/color-utils.js.map +0 -1
- package/dist/esm/utils/cpu-aggregator.js +0 -487
- package/dist/esm/utils/cpu-aggregator.js.map +0 -1
- package/dist/esm/utils/gpu-grid-aggregation/aggregate-all-fs.glsl.js +0 -21
- package/dist/esm/utils/gpu-grid-aggregation/aggregate-all-fs.glsl.js.map +0 -1
- package/dist/esm/utils/gpu-grid-aggregation/aggregate-all-vs.glsl.js +0 -35
- package/dist/esm/utils/gpu-grid-aggregation/aggregate-all-vs.glsl.js.map +0 -1
- package/dist/esm/utils/gpu-grid-aggregation/aggregate-to-grid-fs.glsl.js +0 -16
- package/dist/esm/utils/gpu-grid-aggregation/aggregate-to-grid-fs.glsl.js.map +0 -1
- package/dist/esm/utils/gpu-grid-aggregation/aggregate-to-grid-vs.glsl.js +0 -60
- package/dist/esm/utils/gpu-grid-aggregation/aggregate-to-grid-vs.glsl.js.map +0 -1
- package/dist/esm/utils/gpu-grid-aggregation/gpu-grid-aggregator-constants.js +0 -42
- package/dist/esm/utils/gpu-grid-aggregation/gpu-grid-aggregator-constants.js.map +0 -1
- package/dist/esm/utils/gpu-grid-aggregation/gpu-grid-aggregator-utils.js +0 -2
- package/dist/esm/utils/gpu-grid-aggregation/gpu-grid-aggregator-utils.js.map +0 -1
- package/dist/esm/utils/gpu-grid-aggregation/gpu-grid-aggregator.js +0 -720
- package/dist/esm/utils/gpu-grid-aggregation/gpu-grid-aggregator.js.map +0 -1
- package/dist/esm/utils/gpu-grid-aggregation/gpu-grid-aggregator.md +0 -155
- package/dist/esm/utils/gpu-grid-aggregation/transform-mean-vs.glsl.js +0 -19
- package/dist/esm/utils/gpu-grid-aggregation/transform-mean-vs.glsl.js.map +0 -1
- package/dist/esm/utils/grid-aggregation-utils.js +0 -109
- package/dist/esm/utils/grid-aggregation-utils.js.map +0 -1
- package/dist/esm/utils/prop-utils.js +0 -12
- package/dist/esm/utils/prop-utils.js.map +0 -1
- package/dist/esm/utils/resource-utils.js +0 -45
- package/dist/esm/utils/resource-utils.js.map +0 -1
- package/dist/esm/utils/scale-utils.js +0 -192
- package/dist/esm/utils/scale-utils.js.map +0 -1
- package/typed/contour-layer/contour-layer.d.ts.map +0 -1
- package/typed/cpu-grid-layer/cpu-grid-layer.d.ts.map +0 -1
- package/typed/gpu-grid-layer/gpu-grid-cell-layer.d.ts.map +0 -1
- package/typed/gpu-grid-layer/gpu-grid-layer.d.ts.map +0 -1
- package/typed/grid-aggregation-layer.d.ts.map +0 -1
- package/typed/grid-layer/grid-layer.d.ts.map +0 -1
- package/typed/heatmap-layer/heatmap-layer-utils.d.ts.map +0 -1
- package/typed/heatmap-layer/heatmap-layer.d.ts.map +0 -1
- package/typed/heatmap-layer/max-vs.glsl.d.ts +0 -3
- package/typed/heatmap-layer/triangle-layer-fragment.glsl.d.ts +0 -3
- package/typed/heatmap-layer/triangle-layer.d.ts.map +0 -1
- package/typed/heatmap-layer/weights-vs.glsl.d.ts +0 -3
- package/typed/hexagon-layer/hexagon-layer.d.ts.map +0 -1
- package/typed/index.d.ts +0 -20
- package/typed/index.d.ts.map +0 -1
- package/typed/screen-grid-layer/screen-grid-cell-layer.d.ts.map +0 -1
- package/typed/screen-grid-layer/screen-grid-layer.d.ts.map +0 -1
- /package/{typed → dist}/aggregation-layer.d.ts +0 -0
- /package/{typed → dist}/contour-layer/contour-utils.d.ts +0 -0
- /package/{typed → dist}/contour-layer/contour-utils.d.ts.map +0 -0
- /package/{typed → dist}/contour-layer/marching-squares-codes.d.ts +0 -0
- /package/{typed → dist}/contour-layer/marching-squares-codes.d.ts.map +0 -0
- /package/{typed → dist}/contour-layer/marching-squares.d.ts +0 -0
- /package/{typed → dist}/contour-layer/marching-squares.d.ts.map +0 -0
- /package/{typed → dist}/cpu-grid-layer/grid-aggregator.d.ts +0 -0
- /package/{typed → dist}/cpu-grid-layer/grid-aggregator.d.ts.map +0 -0
- /package/{typed → dist}/gpu-grid-layer/gpu-grid-cell-layer-fragment.glsl.d.ts +0 -0
- /package/{typed → dist}/gpu-grid-layer/gpu-grid-cell-layer-fragment.glsl.d.ts.map +0 -0
- /package/{typed → dist}/gpu-grid-layer/gpu-grid-cell-layer-vertex.glsl.d.ts +0 -0
- /package/{typed → dist}/gpu-grid-layer/gpu-grid-cell-layer-vertex.glsl.d.ts.map +0 -0
- /package/{typed → dist}/heatmap-layer/max-fs.glsl.d.ts +0 -0
- /package/{typed → dist}/heatmap-layer/max-fs.glsl.d.ts.map +0 -0
- /package/{typed → dist}/heatmap-layer/triangle-layer-fragment.glsl.d.ts.map +0 -0
- /package/{typed → dist}/heatmap-layer/triangle-layer-vertex.glsl.d.ts +0 -0
- /package/{typed → dist}/heatmap-layer/triangle-layer-vertex.glsl.d.ts.map +0 -0
- /package/{typed → dist}/heatmap-layer/weights-fs.glsl.d.ts +0 -0
- /package/{typed → dist}/heatmap-layer/weights-fs.glsl.d.ts.map +0 -0
- /package/{typed → dist}/hexagon-layer/hexagon-aggregator.d.ts +0 -0
- /package/{typed → dist}/hexagon-layer/hexagon-aggregator.d.ts.map +0 -0
- /package/{typed → dist}/screen-grid-layer/screen-grid-layer-fragment.glsl.d.ts +0 -0
- /package/{typed → dist}/screen-grid-layer/screen-grid-layer-fragment.glsl.d.ts.map +0 -0
- /package/{typed → dist}/screen-grid-layer/screen-grid-layer-vertex.glsl.d.ts +0 -0
- /package/{typed → dist}/screen-grid-layer/screen-grid-layer-vertex.glsl.d.ts.map +0 -0
- /package/{typed → dist}/types.d.ts +0 -0
- /package/{typed → dist}/types.d.ts.map +0 -0
- /package/{typed → dist}/utils/aggregation-operation-utils.d.ts +0 -0
- /package/{typed → dist}/utils/aggregation-operation-utils.d.ts.map +0 -0
- /package/{typed → dist}/utils/bin-sorter.d.ts.map +0 -0
- /package/{typed → dist}/utils/color-utils.d.ts +0 -0
- /package/{typed → dist}/utils/color-utils.d.ts.map +0 -0
- /package/{typed → dist}/utils/cpu-aggregator.d.ts +0 -0
- /package/{typed → dist}/utils/cpu-aggregator.d.ts.map +0 -0
- /package/{typed → dist}/utils/gpu-grid-aggregation/aggregate-all-fs.glsl.d.ts +0 -0
- /package/{typed → dist}/utils/gpu-grid-aggregation/aggregate-all-fs.glsl.d.ts.map +0 -0
- /package/{typed → dist}/utils/gpu-grid-aggregation/aggregate-all-vs.glsl.d.ts +0 -0
- /package/{typed → dist}/utils/gpu-grid-aggregation/aggregate-all-vs.glsl.d.ts.map +0 -0
- /package/{typed → dist}/utils/gpu-grid-aggregation/aggregate-to-grid-fs.glsl.d.ts +0 -0
- /package/{typed → dist}/utils/gpu-grid-aggregation/aggregate-to-grid-fs.glsl.d.ts.map +0 -0
- /package/{typed → dist}/utils/gpu-grid-aggregation/aggregate-to-grid-vs.glsl.d.ts +0 -0
- /package/{typed → dist}/utils/gpu-grid-aggregation/aggregate-to-grid-vs.glsl.d.ts.map +0 -0
- /package/{typed → dist}/utils/gpu-grid-aggregation/gpu-grid-aggregator-constants.d.ts +0 -0
- /package/{typed → dist}/utils/gpu-grid-aggregation/gpu-grid-aggregator-constants.d.ts.map +0 -0
- /package/{typed → dist}/utils/gpu-grid-aggregation/gpu-grid-aggregator-utils.d.ts +0 -0
- /package/{typed → dist}/utils/gpu-grid-aggregation/gpu-grid-aggregator-utils.d.ts.map +0 -0
- /package/{typed → dist}/utils/gpu-grid-aggregation/gpu-grid-aggregator.d.ts +0 -0
- /package/{typed → dist}/utils/gpu-grid-aggregation/transform-mean-vs.glsl.d.ts +0 -0
- /package/{typed → dist}/utils/gpu-grid-aggregation/transform-mean-vs.glsl.d.ts.map +0 -0
- /package/{typed → dist}/utils/grid-aggregation-utils.d.ts +0 -0
- /package/{typed → dist}/utils/grid-aggregation-utils.d.ts.map +0 -0
- /package/{typed → dist}/utils/prop-utils.d.ts +0 -0
- /package/{typed → dist}/utils/prop-utils.d.ts.map +0 -0
- /package/{typed → dist}/utils/resource-utils.d.ts +0 -0
- /package/{typed → dist}/utils/scale-utils.d.ts +0 -0
- /package/{typed → dist}/utils/scale-utils.d.ts.map +0 -0
package/package.json
CHANGED
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
"name": "@deck.gl/aggregation-layers",
|
|
3
3
|
"description": "deck.gl layers that aggregate the input data into alternative representations",
|
|
4
4
|
"license": "MIT",
|
|
5
|
-
"
|
|
5
|
+
"type": "module",
|
|
6
|
+
"version": "9.0.0-beta.10",
|
|
6
7
|
"publishConfig": {
|
|
7
8
|
"access": "public"
|
|
8
9
|
},
|
|
@@ -16,13 +17,19 @@
|
|
|
16
17
|
"type": "git",
|
|
17
18
|
"url": "https://github.com/visgl/deck.gl.git"
|
|
18
19
|
},
|
|
19
|
-
"
|
|
20
|
-
"
|
|
21
|
-
"
|
|
20
|
+
"types": "dist/index.d.ts",
|
|
21
|
+
"main": "dist/index.cjs",
|
|
22
|
+
"module": "dist/index.js",
|
|
23
|
+
"exports": {
|
|
24
|
+
".": {
|
|
25
|
+
"types": "./dist/index.d.ts",
|
|
26
|
+
"import": "./dist/index.js",
|
|
27
|
+
"require": "./dist/index.cjs"
|
|
28
|
+
}
|
|
29
|
+
},
|
|
22
30
|
"files": [
|
|
23
31
|
"dist",
|
|
24
32
|
"src",
|
|
25
|
-
"typed",
|
|
26
33
|
"dist.min.js"
|
|
27
34
|
],
|
|
28
35
|
"sideEffects": false,
|
|
@@ -31,18 +38,16 @@
|
|
|
31
38
|
"prepublishOnly": "npm run build-bundle && npm run build-bundle -- --env=dev"
|
|
32
39
|
},
|
|
33
40
|
"dependencies": {
|
|
34
|
-
"@
|
|
35
|
-
"@luma.gl/
|
|
36
|
-
"@luma.gl/core": "9.0.0-alpha.53",
|
|
37
|
-
"@luma.gl/shadertools": "9.0.0-alpha.53",
|
|
41
|
+
"@luma.gl/constants": "^9.0.4",
|
|
42
|
+
"@luma.gl/shadertools": "^9.0.4",
|
|
38
43
|
"@math.gl/web-mercator": "^4.0.0",
|
|
39
44
|
"d3-hexbin": "^0.2.1"
|
|
40
45
|
},
|
|
41
46
|
"peerDependencies": {
|
|
42
|
-
"@deck.gl/core": "^9.0.0-
|
|
43
|
-
"@deck.gl/layers": "^9.0.0-
|
|
44
|
-
"@luma.gl/core": "9.0.
|
|
45
|
-
"@luma.gl/engine": "9.0.
|
|
47
|
+
"@deck.gl/core": "^9.0.0-beta",
|
|
48
|
+
"@deck.gl/layers": "^9.0.0-beta",
|
|
49
|
+
"@luma.gl/core": "^9.0.4",
|
|
50
|
+
"@luma.gl/engine": "^9.0.4"
|
|
46
51
|
},
|
|
47
|
-
"gitHead": "
|
|
52
|
+
"gitHead": "6c44f602069374cd21268ff279c5bf818c905ff7"
|
|
48
53
|
}
|
package/src/aggregation-layer.ts
CHANGED
|
@@ -87,7 +87,9 @@ export default abstract class AggregationLayer<
|
|
|
87
87
|
const moduleSettings = Object.assign(Object.create(this.props), {
|
|
88
88
|
viewport,
|
|
89
89
|
mousePosition,
|
|
90
|
-
|
|
90
|
+
picking: {
|
|
91
|
+
isActive: 0
|
|
92
|
+
},
|
|
91
93
|
// @ts-expect-error TODO - assuming WebGL context
|
|
92
94
|
devicePixelRatio: device.canvasContext.cssToDeviceRatio()
|
|
93
95
|
});
|
|
@@ -18,14 +18,12 @@
|
|
|
18
18
|
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
19
19
|
// THE SOFTWARE.
|
|
20
20
|
|
|
21
|
-
import {GL} from '@luma.gl/constants';
|
|
22
21
|
import {LineLayer, SolidPolygonLayer} from '@deck.gl/layers';
|
|
23
22
|
import {generateContours} from './contour-utils';
|
|
24
23
|
import {
|
|
25
24
|
Accessor,
|
|
26
25
|
AccessorFunction,
|
|
27
26
|
Color,
|
|
28
|
-
Layer,
|
|
29
27
|
log,
|
|
30
28
|
Position,
|
|
31
29
|
UpdateParameters,
|
|
@@ -47,7 +45,7 @@ const defaultProps: DefaultProps<ContourLayerProps> = {
|
|
|
47
45
|
cellSize: {type: 'number', min: 1, max: 1000, value: 1000},
|
|
48
46
|
getPosition: {type: 'accessor', value: (x: any) => x.position},
|
|
49
47
|
getWeight: {type: 'accessor', value: 1},
|
|
50
|
-
gpuAggregation:
|
|
48
|
+
gpuAggregation: false, // TODO(v9): Re-enable GPU aggregation.
|
|
51
49
|
aggregation: 'SUM',
|
|
52
50
|
|
|
53
51
|
// contour lines
|
|
@@ -186,7 +184,7 @@ export default class ContourLayer<
|
|
|
186
184
|
[POSITION_ATTRIBUTE_NAME]: {
|
|
187
185
|
size: 3,
|
|
188
186
|
accessor: 'getPosition',
|
|
189
|
-
type:
|
|
187
|
+
type: 'float64',
|
|
190
188
|
fp64: this.use64bitPositions()
|
|
191
189
|
},
|
|
192
190
|
// this attribute is used in gpu aggregation path only
|
|
@@ -351,7 +349,8 @@ export default class ContourLayer<
|
|
|
351
349
|
const {count} = this.state.weights;
|
|
352
350
|
let {aggregationData} = count;
|
|
353
351
|
if (!aggregationData) {
|
|
354
|
-
|
|
352
|
+
// @ts-ignore
|
|
353
|
+
aggregationData = count.aggregationBuffer!.readSyncWebGL() as Float32Array;
|
|
355
354
|
count.aggregationData = aggregationData;
|
|
356
355
|
}
|
|
357
356
|
|
|
@@ -18,7 +18,6 @@
|
|
|
18
18
|
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
19
19
|
// THE SOFTWARE.
|
|
20
20
|
|
|
21
|
-
import {GL} from '@luma.gl/constants';
|
|
22
21
|
import {GridCellLayer} from '@deck.gl/layers';
|
|
23
22
|
import {Accessor, AccessorFunction, Color, Position, Material, DefaultProps} from '@deck.gl/core';
|
|
24
23
|
|
|
@@ -261,7 +260,7 @@ export default class CPUGridLayer<
|
|
|
261
260
|
};
|
|
262
261
|
const attributeManager = this.getAttributeManager()!;
|
|
263
262
|
attributeManager.add({
|
|
264
|
-
positions: {size: 3, type:
|
|
263
|
+
positions: {size: 3, type: 'float64', accessor: 'getPosition'}
|
|
265
264
|
});
|
|
266
265
|
// color and elevation attributes can't be added as attributes
|
|
267
266
|
// they are calcualted using 'getValue' accessor that takes an array of pints.
|
|
@@ -192,7 +192,7 @@ export default class GPUGridCellLayer extends Layer<_GPUGridCellLayerProps> {
|
|
|
192
192
|
// @ts-expect-error TODO v9 This code is not portable to WebGPU
|
|
193
193
|
const programHandle = model.pipeline.handle;
|
|
194
194
|
|
|
195
|
-
const gl = this.context.gl
|
|
195
|
+
const gl = this.context.gl;
|
|
196
196
|
const colorIndex = gl.getUniformBlockIndex(programHandle, 'ColorData');
|
|
197
197
|
const elevationIndex = gl.getUniformBlockIndex(programHandle, 'ElevationData');
|
|
198
198
|
gl.uniformBlockBinding(programHandle, colorIndex, COLOR_DATA_UBO_INDEX);
|
|
@@ -167,7 +167,7 @@ export type _GPUGridLayerProps<DataT> = {
|
|
|
167
167
|
getElevationWeight?: Accessor<DataT, number>;
|
|
168
168
|
};
|
|
169
169
|
|
|
170
|
-
/** Aggregate data into a grid-based heatmap. Aggregation is performed on GPU
|
|
170
|
+
/** Aggregate data into a grid-based heatmap. Aggregation is performed on GPU. */
|
|
171
171
|
export default class GPUGridLayer<
|
|
172
172
|
DataT = any,
|
|
173
173
|
ExtraPropsT extends {} = {}
|
|
@@ -189,7 +189,7 @@ export default class GPUGridLayer<
|
|
|
189
189
|
dimensions: DIMENSIONS
|
|
190
190
|
});
|
|
191
191
|
this.setState({
|
|
192
|
-
gpuAggregation:
|
|
192
|
+
gpuAggregation: false, // TODO(v9): Re-enable GPU aggregation.
|
|
193
193
|
projectPoints: false, // aggregation in world space
|
|
194
194
|
isSupported,
|
|
195
195
|
weights: {
|
|
@@ -221,7 +221,7 @@ export default class GPUGridLayer<
|
|
|
221
221
|
[POSITION_ATTRIBUTE_NAME]: {
|
|
222
222
|
size: 3,
|
|
223
223
|
accessor: 'getPosition',
|
|
224
|
-
type:
|
|
224
|
+
type: 'float64',
|
|
225
225
|
fp64: this.use64bitPositions()
|
|
226
226
|
},
|
|
227
227
|
color: {size: 3, accessor: 'getColorWeight'},
|
|
@@ -47,13 +47,15 @@ export default class GridLayer<DataT = any, ExtraPropsT extends {} = {}> extends
|
|
|
47
47
|
|
|
48
48
|
initializeState() {
|
|
49
49
|
this.state = {
|
|
50
|
-
useGPUAggregation:
|
|
50
|
+
useGPUAggregation: false // TODO(v9): Re-enable GPU aggregation.
|
|
51
51
|
};
|
|
52
52
|
}
|
|
53
53
|
|
|
54
54
|
updateState({props}: UpdateParameters<this>) {
|
|
55
55
|
this.setState({
|
|
56
|
-
|
|
56
|
+
// TODO(v9): Re-enable GPU aggregation.
|
|
57
|
+
// useGPUAggregation: this.canUseGPUAggregation(props)
|
|
58
|
+
useGPUAggregation: false
|
|
57
59
|
});
|
|
58
60
|
}
|
|
59
61
|
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
import {Device} from '@luma.gl/core';
|
|
2
|
-
import {GL} from '@luma.gl/constants';
|
|
3
|
-
|
|
4
1
|
export function getBounds(points: number[][]): number[] {
|
|
5
2
|
// Now build bounding box in world space (aligned to world coordiante system)
|
|
6
3
|
const x = points.map(p => p[0]);
|
|
@@ -77,23 +74,3 @@ export function getTextureCoordinates(point: number[], bounds: number[]) {
|
|
|
77
74
|
const [xMin, yMin, xMax, yMax] = bounds;
|
|
78
75
|
return [(point[0] - xMin) / (xMax - xMin), (point[1] - yMin) / (yMax - yMin)];
|
|
79
76
|
}
|
|
80
|
-
|
|
81
|
-
// Returns format and type for creating texture objects
|
|
82
|
-
export function getTextureParams({
|
|
83
|
-
device,
|
|
84
|
-
floatTargetSupport
|
|
85
|
-
}: {
|
|
86
|
-
device: Device;
|
|
87
|
-
floatTargetSupport?: boolean;
|
|
88
|
-
}) {
|
|
89
|
-
return floatTargetSupport
|
|
90
|
-
? {
|
|
91
|
-
// format: should be RGBA32F on WebGL2 (float textures), RGBA in WebGL1 for float or non float textures
|
|
92
|
-
format: device.info.type === 'webgl2' ? GL.RGBA32F : GL.RGBA,
|
|
93
|
-
type: GL.FLOAT
|
|
94
|
-
}
|
|
95
|
-
: {
|
|
96
|
-
format: GL.RGBA,
|
|
97
|
-
type: GL.UNSIGNED_BYTE
|
|
98
|
-
};
|
|
99
|
-
}
|
|
@@ -24,13 +24,10 @@ import {
|
|
|
24
24
|
boundsContain,
|
|
25
25
|
packVertices,
|
|
26
26
|
scaleToAspectRatio,
|
|
27
|
-
getTextureCoordinates
|
|
28
|
-
getTextureParams
|
|
27
|
+
getTextureCoordinates
|
|
29
28
|
} from './heatmap-layer-utils';
|
|
30
29
|
import {Buffer, DeviceFeature, Texture, TextureProps, TextureFormat} from '@luma.gl/core';
|
|
31
|
-
import {GL} from '@luma.gl/constants';
|
|
32
30
|
import {TextureTransform, TextureTransformProps} from '@luma.gl/engine';
|
|
33
|
-
import {withGLParameters} from '@luma.gl/webgl';
|
|
34
31
|
import {
|
|
35
32
|
Accessor,
|
|
36
33
|
AccessorFunction,
|
|
@@ -51,16 +48,16 @@ import AggregationLayer, {AggregationLayerProps} from '../aggregation-layer';
|
|
|
51
48
|
import {defaultColorRange, colorRangeToFlatArray} from '../utils/color-utils';
|
|
52
49
|
import weightsVs from './weights-vs.glsl';
|
|
53
50
|
import weightsFs from './weights-fs.glsl';
|
|
54
|
-
import
|
|
55
|
-
import
|
|
51
|
+
import maxVs from './max-vs.glsl';
|
|
52
|
+
import maxFs from './max-fs.glsl';
|
|
56
53
|
|
|
57
54
|
const RESOLUTION = 2; // (number of common space pixels) / (number texels)
|
|
58
55
|
const TEXTURE_PROPS: TextureProps = {
|
|
59
56
|
format: 'rgba8unorm',
|
|
60
57
|
mipmaps: false,
|
|
61
58
|
sampler: {
|
|
62
|
-
minFilter: '
|
|
63
|
-
magFilter: '
|
|
59
|
+
minFilter: 'linear',
|
|
60
|
+
magFilter: 'linear',
|
|
64
61
|
addressModeU: 'clamp-to-edge',
|
|
65
62
|
addressModeV: 'clamp-to-edge'
|
|
66
63
|
}
|
|
@@ -85,14 +82,9 @@ const defaultProps: DefaultProps<HeatmapLayerProps> = {
|
|
|
85
82
|
debounceTimeout: {type: 'number', min: 0, max: 1000, value: 500}
|
|
86
83
|
};
|
|
87
84
|
|
|
88
|
-
const REQUIRED_FEATURES: DeviceFeature[] = [
|
|
89
|
-
'blend-minmax-webgl1', // max weight calculation
|
|
90
|
-
'texture-formats-float32-webgl1' // weight-map as texture
|
|
91
|
-
];
|
|
92
|
-
|
|
93
85
|
const FLOAT_TARGET_FEATURES: DeviceFeature[] = [
|
|
94
|
-
'
|
|
95
|
-
'texture-blend-float-
|
|
86
|
+
'float32-renderable-webgl', // ability to render to float texture
|
|
87
|
+
'texture-blend-float-webgl' // ability to blend when rendering to float texture
|
|
96
88
|
];
|
|
97
89
|
|
|
98
90
|
const DIMENSIONS = {
|
|
@@ -189,7 +181,6 @@ export default class HeatmapLayer<
|
|
|
189
181
|
static defaultProps = defaultProps;
|
|
190
182
|
|
|
191
183
|
state!: AggregationLayer<DataT>['state'] & {
|
|
192
|
-
supported: boolean;
|
|
193
184
|
colorDomain?: number[];
|
|
194
185
|
isWeightMapDirty?: boolean;
|
|
195
186
|
weightsTexture?: Texture;
|
|
@@ -205,20 +196,14 @@ export default class HeatmapLayer<
|
|
|
205
196
|
maxWeightTransform?: TextureTransform;
|
|
206
197
|
textureSize: number;
|
|
207
198
|
format: TextureFormat;
|
|
208
|
-
type: GL;
|
|
209
199
|
weightsScale: number;
|
|
210
200
|
visibleWorldBounds: number[];
|
|
211
201
|
viewportCorners: number[][];
|
|
212
202
|
};
|
|
213
203
|
|
|
214
204
|
initializeState() {
|
|
215
|
-
if (!REQUIRED_FEATURES.every(feature => this.context.device.features.has(feature))) {
|
|
216
|
-
this.setState({supported: false});
|
|
217
|
-
log.error(`HeatmapLayer: ${this.id} is not supported on this browser`)();
|
|
218
|
-
return;
|
|
219
|
-
}
|
|
220
205
|
super.initializeAggregationLayer(DIMENSIONS);
|
|
221
|
-
this.setState({
|
|
206
|
+
this.setState({colorDomain: DEFAULT_COLOR_DOMAIN});
|
|
222
207
|
this._setupTextureParams();
|
|
223
208
|
this._setupAttributes();
|
|
224
209
|
this._setupResources();
|
|
@@ -231,9 +216,6 @@ export default class HeatmapLayer<
|
|
|
231
216
|
|
|
232
217
|
/* eslint-disable max-statements,complexity */
|
|
233
218
|
updateState(opts: UpdateParameters<this>) {
|
|
234
|
-
if (!this.state.supported) {
|
|
235
|
-
return;
|
|
236
|
-
}
|
|
237
219
|
super.updateState(opts);
|
|
238
220
|
this._updateHeatmapState(opts);
|
|
239
221
|
}
|
|
@@ -269,9 +251,6 @@ export default class HeatmapLayer<
|
|
|
269
251
|
}
|
|
270
252
|
|
|
271
253
|
renderLayers(): LayersList | Layer {
|
|
272
|
-
if (!this.state.supported) {
|
|
273
|
-
return [];
|
|
274
|
-
}
|
|
275
254
|
const {
|
|
276
255
|
weightsTexture,
|
|
277
256
|
triPositionBuffer,
|
|
@@ -303,7 +282,7 @@ export default class HeatmapLayer<
|
|
|
303
282
|
maxTexture: maxWeightsTexture,
|
|
304
283
|
colorTexture,
|
|
305
284
|
aggregationMode: AGGREGATION_MODE[aggregation] || 0,
|
|
306
|
-
|
|
285
|
+
weightsTexture,
|
|
307
286
|
intensity,
|
|
308
287
|
threshold,
|
|
309
288
|
colorDomain
|
|
@@ -369,24 +348,28 @@ export default class HeatmapLayer<
|
|
|
369
348
|
}
|
|
370
349
|
|
|
371
350
|
_createTextures() {
|
|
372
|
-
const {textureSize, format
|
|
351
|
+
const {textureSize, format} = this.state;
|
|
373
352
|
|
|
374
353
|
this.setState({
|
|
375
354
|
weightsTexture: this.context.device.createTexture({
|
|
355
|
+
...TEXTURE_PROPS,
|
|
376
356
|
width: textureSize,
|
|
377
357
|
height: textureSize,
|
|
378
|
-
format
|
|
379
|
-
type,
|
|
380
|
-
...TEXTURE_PROPS
|
|
358
|
+
format
|
|
381
359
|
}),
|
|
382
|
-
maxWeightsTexture: this.context.device.createTexture({
|
|
360
|
+
maxWeightsTexture: this.context.device.createTexture({
|
|
361
|
+
...TEXTURE_PROPS,
|
|
362
|
+
width: 1,
|
|
363
|
+
height: 1,
|
|
364
|
+
format
|
|
365
|
+
})
|
|
383
366
|
});
|
|
384
367
|
}
|
|
385
368
|
|
|
386
369
|
_setupAttributes() {
|
|
387
370
|
const attributeManager = this.getAttributeManager()!;
|
|
388
371
|
attributeManager.add({
|
|
389
|
-
positions: {size: 3, type:
|
|
372
|
+
positions: {size: 3, type: 'float64', accessor: 'getPosition'},
|
|
390
373
|
weights: {size: 1, accessor: 'getWeight'}
|
|
391
374
|
});
|
|
392
375
|
this.setState({positionAttributeName: 'positions'});
|
|
@@ -396,63 +379,73 @@ export default class HeatmapLayer<
|
|
|
396
379
|
const {device} = this.context;
|
|
397
380
|
const {weightsTextureSize} = this.props;
|
|
398
381
|
|
|
399
|
-
const textureSize = Math.min(weightsTextureSize, device.limits.maxTextureDimension2D
|
|
382
|
+
const textureSize = Math.min(weightsTextureSize, device.limits.maxTextureDimension2D);
|
|
400
383
|
const floatTargetSupport = FLOAT_TARGET_FEATURES.every(feature => device.features.has(feature));
|
|
401
|
-
const
|
|
384
|
+
const format: TextureFormat = floatTargetSupport ? 'rgba32float' : 'rgba8unorm';
|
|
402
385
|
const weightsScale = floatTargetSupport ? 1 : 1 / 255;
|
|
403
|
-
this.setState({textureSize, format,
|
|
386
|
+
this.setState({textureSize, format, weightsScale});
|
|
404
387
|
if (!floatTargetSupport) {
|
|
405
388
|
log.warn(
|
|
406
|
-
`HeatmapLayer: ${this.id} rendering to float texture not supported,
|
|
389
|
+
`HeatmapLayer: ${this.id} rendering to float texture not supported, falling back to low precision format`
|
|
407
390
|
)();
|
|
408
391
|
}
|
|
409
392
|
}
|
|
410
393
|
|
|
411
|
-
|
|
412
|
-
return super.getShaders(
|
|
413
|
-
type === 'max-weights-transform'
|
|
414
|
-
? {
|
|
415
|
-
vs: vsMax,
|
|
416
|
-
_fs: fsMax
|
|
417
|
-
}
|
|
418
|
-
: {
|
|
419
|
-
vs: weightsVs,
|
|
420
|
-
_fs: weightsFs
|
|
421
|
-
}
|
|
422
|
-
);
|
|
423
|
-
}
|
|
424
|
-
|
|
425
|
-
_createWeightsTransform(shaders = {}) {
|
|
394
|
+
_createWeightsTransform(shaders: {vs: string; fs?: string}) {
|
|
426
395
|
let {weightsTransform} = this.state;
|
|
427
|
-
|
|
396
|
+
const {weightsTexture} = this.state;
|
|
397
|
+
const attributeManager = this.getAttributeManager()!;
|
|
428
398
|
|
|
399
|
+
weightsTransform?.destroy();
|
|
429
400
|
weightsTransform = new TextureTransform(this.context.device, {
|
|
430
401
|
id: `${this.id}-weights-transform`,
|
|
402
|
+
bufferLayout: attributeManager.getBufferLayouts(),
|
|
431
403
|
vertexCount: 1,
|
|
432
|
-
targetTexture:
|
|
433
|
-
|
|
404
|
+
targetTexture: weightsTexture!,
|
|
405
|
+
parameters: {
|
|
406
|
+
depthWriteEnabled: false,
|
|
407
|
+
blendColorOperation: 'add',
|
|
408
|
+
blendColorSrcFactor: 'one',
|
|
409
|
+
blendColorDstFactor: 'one',
|
|
410
|
+
blendAlphaSrcFactor: 'one',
|
|
411
|
+
blendAlphaDstFactor: 'one'
|
|
412
|
+
},
|
|
413
|
+
topology: 'point-list',
|
|
434
414
|
...shaders
|
|
435
415
|
} as TextureTransformProps);
|
|
416
|
+
|
|
436
417
|
this.setState({weightsTransform});
|
|
437
418
|
}
|
|
438
419
|
|
|
439
420
|
_setupResources() {
|
|
440
421
|
this._createTextures();
|
|
422
|
+
const {device} = this.context;
|
|
441
423
|
const {textureSize, weightsTexture, maxWeightsTexture} = this.state;
|
|
442
424
|
|
|
443
|
-
const weightsTransformShaders = this.getShaders(
|
|
425
|
+
const weightsTransformShaders = this.getShaders({
|
|
426
|
+
vs: weightsVs,
|
|
427
|
+
fs: weightsFs
|
|
428
|
+
});
|
|
444
429
|
this._createWeightsTransform(weightsTransformShaders);
|
|
445
430
|
|
|
446
|
-
const maxWeightsTransformShaders = this.getShaders(
|
|
447
|
-
const maxWeightTransform = new TextureTransform(
|
|
431
|
+
const maxWeightsTransformShaders = this.getShaders({vs: maxVs, fs: maxFs});
|
|
432
|
+
const maxWeightTransform = new TextureTransform(device, {
|
|
448
433
|
id: `${this.id}-max-weights-transform`,
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
_targetTexture: maxWeightsTexture,
|
|
453
|
-
_targetTextureVarying: 'outTexture',
|
|
434
|
+
bindings: {inTexture: weightsTexture},
|
|
435
|
+
uniforms: {textureSize},
|
|
436
|
+
targetTexture: maxWeightsTexture,
|
|
454
437
|
...maxWeightsTransformShaders,
|
|
455
|
-
|
|
438
|
+
vertexCount: textureSize * textureSize,
|
|
439
|
+
topology: 'point-list',
|
|
440
|
+
parameters: {
|
|
441
|
+
depthWriteEnabled: false,
|
|
442
|
+
blendColorOperation: 'max',
|
|
443
|
+
blendAlphaOperation: 'max',
|
|
444
|
+
blendColorSrcFactor: 'one',
|
|
445
|
+
blendColorDstFactor: 'one',
|
|
446
|
+
blendAlphaSrcFactor: 'one',
|
|
447
|
+
blendAlphaDstFactor: 'one'
|
|
448
|
+
}
|
|
456
449
|
});
|
|
457
450
|
|
|
458
451
|
this.setState({
|
|
@@ -460,35 +453,27 @@ export default class HeatmapLayer<
|
|
|
460
453
|
maxWeightsTexture,
|
|
461
454
|
maxWeightTransform,
|
|
462
455
|
zoom: null,
|
|
463
|
-
triPositionBuffer:
|
|
464
|
-
|
|
465
|
-
// @ts-expect-error
|
|
466
|
-
accessor: {size: 3}
|
|
467
|
-
}),
|
|
468
|
-
triTexCoordBuffer: this.context.device.createBuffer({
|
|
469
|
-
byteLength: 48,
|
|
470
|
-
// @ts-expect-error
|
|
471
|
-
accessor: {size: 2}
|
|
472
|
-
})
|
|
456
|
+
triPositionBuffer: device.createBuffer({byteLength: 48}),
|
|
457
|
+
triTexCoordBuffer: device.createBuffer({byteLength: 48})
|
|
473
458
|
});
|
|
474
459
|
}
|
|
475
460
|
|
|
476
461
|
// overwrite super class method to update transform model
|
|
477
462
|
updateShaders(shaderOptions) {
|
|
478
|
-
//
|
|
479
|
-
this._createWeightsTransform(
|
|
463
|
+
// shader params (modules, injects) changed, update model object
|
|
464
|
+
this._createWeightsTransform({
|
|
465
|
+
vs: weightsVs,
|
|
466
|
+
fs: weightsFs,
|
|
467
|
+
...shaderOptions
|
|
468
|
+
});
|
|
480
469
|
}
|
|
481
470
|
|
|
482
471
|
_updateMaxWeightValue() {
|
|
483
|
-
const {maxWeightTransform} = this.state;
|
|
472
|
+
const {maxWeightTransform, textureSize} = this.state;
|
|
473
|
+
|
|
484
474
|
maxWeightTransform!.run({
|
|
485
|
-
parameters: {
|
|
486
|
-
|
|
487
|
-
blend: true,
|
|
488
|
-
depthTest: false,
|
|
489
|
-
blendFunc: [GL.ONE, GL.ONE],
|
|
490
|
-
blendEquation: GL.MAX
|
|
491
|
-
}
|
|
475
|
+
parameters: {viewport: [0, 0, 1, 1]},
|
|
476
|
+
clearColor: [0, 0, 0, 0]
|
|
492
477
|
});
|
|
493
478
|
}
|
|
494
479
|
|
|
@@ -563,18 +548,16 @@ export default class HeatmapLayer<
|
|
|
563
548
|
let {colorTexture} = this.state;
|
|
564
549
|
const colors = colorRangeToFlatArray(colorRange, false, Uint8Array as any);
|
|
565
550
|
|
|
566
|
-
if (colorTexture) {
|
|
567
|
-
//
|
|
568
|
-
colorTexture.
|
|
569
|
-
data: colors,
|
|
570
|
-
width: colorRange.length
|
|
571
|
-
});
|
|
551
|
+
if (colorTexture && colorTexture?.width === colorRange.length) {
|
|
552
|
+
// TODO(v9): Unclear whether `setSubImageData` is a public API, or what to use if not.
|
|
553
|
+
(colorTexture as any).setSubImageData({data: colors});
|
|
572
554
|
} else {
|
|
555
|
+
colorTexture?.destroy();
|
|
573
556
|
colorTexture = this.context.device.createTexture({
|
|
557
|
+
...TEXTURE_PROPS,
|
|
574
558
|
data: colors,
|
|
575
559
|
width: colorRange.length,
|
|
576
|
-
height: 1
|
|
577
|
-
...TEXTURE_PROPS
|
|
560
|
+
height: 1
|
|
578
561
|
});
|
|
579
562
|
}
|
|
580
563
|
this.setState({colorTexture});
|
|
@@ -602,41 +585,22 @@ export default class HeatmapLayer<
|
|
|
602
585
|
this.state.colorDomain = colorDomain || DEFAULT_COLOR_DOMAIN;
|
|
603
586
|
}
|
|
604
587
|
|
|
605
|
-
const
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
weightsTransform.
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
weightsTransform.run({
|
|
619
|
-
uniforms,
|
|
620
|
-
parameters: {
|
|
621
|
-
// @ts-expect-error TODO(v9): Resolve errors.
|
|
622
|
-
blend: true,
|
|
623
|
-
depthTest: false,
|
|
624
|
-
blendFunc: [GL.ONE, GL.ONE],
|
|
625
|
-
blendEquation: GL.FUNC_ADD
|
|
626
|
-
},
|
|
627
|
-
clearRenderTarget: true,
|
|
628
|
-
attributes: this.getAttributes(),
|
|
629
|
-
moduleSettings: this.getModuleSettings()
|
|
630
|
-
});
|
|
588
|
+
const attributeManager = this.getAttributeManager()!;
|
|
589
|
+
const attributes = attributeManager.getAttributes();
|
|
590
|
+
const moduleSettings = this.getModuleSettings();
|
|
591
|
+
const positions = attributes.positions.buffer;
|
|
592
|
+
const uniforms = {radiusPixels, commonBounds, textureWidth: textureSize, weightsScale};
|
|
593
|
+
const weights = attributes.weights.buffer;
|
|
594
|
+
weightsTransform.model.setAttributes({positions, weights});
|
|
595
|
+
weightsTransform.model.setVertexCount(this.getNumInstances());
|
|
596
|
+
weightsTransform.model.setUniforms(uniforms);
|
|
597
|
+
weightsTransform.model.updateModuleSettings(moduleSettings);
|
|
598
|
+
weightsTransform.run({
|
|
599
|
+
parameters: {viewport: [0, 0, textureSize, textureSize]},
|
|
600
|
+
clearColor: [0, 0, 0, 0]
|
|
631
601
|
});
|
|
632
|
-
this._updateMaxWeightValue();
|
|
633
602
|
|
|
634
|
-
|
|
635
|
-
// TODO v9 sampler support in luma.gl needs to improve
|
|
636
|
-
// weightsTexture.setSampler({
|
|
637
|
-
// magFilter: 'linear',
|
|
638
|
-
// minFilter: 'linear'
|
|
639
|
-
// });
|
|
603
|
+
this._updateMaxWeightValue();
|
|
640
604
|
}
|
|
641
605
|
|
|
642
606
|
_debouncedUpdateWeightmap(fromTimer = false) {
|
|
@@ -1,13 +1,19 @@
|
|
|
1
1
|
export default `\
|
|
2
2
|
#version 300 es
|
|
3
|
-
|
|
3
|
+
uniform sampler2D inTexture;
|
|
4
|
+
uniform float textureSize;
|
|
4
5
|
out vec4 outTexture;
|
|
5
6
|
|
|
6
7
|
void main()
|
|
7
8
|
{
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
// 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
|
+
outTexture = texture(inTexture, uv);
|
|
14
|
+
|
|
15
|
+
gl_Position = vec4(0.0, 0.0, 0.0, 1.0);
|
|
16
|
+
// Enforce default value for ANGLE issue (https://bugs.chromium.org/p/angleproject/issues/detail?id=3941)
|
|
17
|
+
gl_PointSize = 1.0;
|
|
12
18
|
}
|
|
13
19
|
`;
|
|
@@ -25,7 +25,7 @@ export default `\
|
|
|
25
25
|
precision highp float;
|
|
26
26
|
|
|
27
27
|
uniform float opacity;
|
|
28
|
-
uniform sampler2D
|
|
28
|
+
uniform sampler2D weightsTexture;
|
|
29
29
|
uniform sampler2D colorTexture;
|
|
30
30
|
uniform float aggregationMode;
|
|
31
31
|
|
|
@@ -43,7 +43,7 @@ vec4 getLinearColor(float value) {
|
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
void main(void) {
|
|
46
|
-
vec4 weights = texture(
|
|
46
|
+
vec4 weights = texture(weightsTexture, vTexCoords);
|
|
47
47
|
float weight = weights.r;
|
|
48
48
|
|
|
49
49
|
if (aggregationMode > 0.5) {
|