@deck.gl/aggregation-layers 9.0.0-beta.1 → 9.0.0-beta.11
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 +2 -2
- package/dist/aggregation-layer.d.ts.map +1 -0
- 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 +1442 -10868
- 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 +4328 -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 +164 -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/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 -2
- package/src/contour-layer/contour-layer.ts +2 -3
- 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 +2 -2
- package/src/heatmap-layer/heatmap-layer-utils.ts +0 -23
- package/src/heatmap-layer/heatmap-layer.ts +91 -127
- 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 -23
- 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 +3 -6
- package/src/screen-grid-layer/screen-grid-layer.ts +1 -11
- package/src/utils/gpu-grid-aggregation/gpu-grid-aggregator.ts +16 -30
- package/dist/es5/aggregation-layer.js +0 -215
- 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 -59
- 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 -156
- 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 -44
- 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/aggregation-layer.d.ts.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}/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/resource-utils.d.ts.map +0 -0
- /package/{typed → dist}/utils/scale-utils.d.ts +0 -0
- /package/{typed → dist}/utils/scale-utils.d.ts.map +0 -0
|
@@ -1,399 +0,0 @@
|
|
|
1
|
-
import { GL } from '@luma.gl/constants';
|
|
2
|
-
import { log } from '@deck.gl/core';
|
|
3
|
-
import GPUGridAggregator from '../utils/gpu-grid-aggregation/gpu-grid-aggregator';
|
|
4
|
-
import { AGGREGATION_OPERATION } from '../utils/aggregation-operation-utils';
|
|
5
|
-
import { defaultColorRange, colorRangeToFlatArray } from '../utils/color-utils';
|
|
6
|
-
import GPUGridCellLayer from './gpu-grid-cell-layer';
|
|
7
|
-
import { pointToDensityGridDataCPU } from './../cpu-grid-layer/grid-aggregator';
|
|
8
|
-
import GridAggregationLayer from '../grid-aggregation-layer';
|
|
9
|
-
import { getBoundingBox, getGridParams } from '../utils/grid-aggregation-utils';
|
|
10
|
-
const defaultProps = {
|
|
11
|
-
colorDomain: null,
|
|
12
|
-
colorRange: defaultColorRange,
|
|
13
|
-
getColorWeight: {
|
|
14
|
-
type: 'accessor',
|
|
15
|
-
value: 1
|
|
16
|
-
},
|
|
17
|
-
colorAggregation: 'SUM',
|
|
18
|
-
elevationDomain: null,
|
|
19
|
-
elevationRange: [0, 1000],
|
|
20
|
-
getElevationWeight: {
|
|
21
|
-
type: 'accessor',
|
|
22
|
-
value: 1
|
|
23
|
-
},
|
|
24
|
-
elevationAggregation: 'SUM',
|
|
25
|
-
elevationScale: {
|
|
26
|
-
type: 'number',
|
|
27
|
-
min: 0,
|
|
28
|
-
value: 1
|
|
29
|
-
},
|
|
30
|
-
cellSize: {
|
|
31
|
-
type: 'number',
|
|
32
|
-
min: 1,
|
|
33
|
-
max: 1000,
|
|
34
|
-
value: 1000
|
|
35
|
-
},
|
|
36
|
-
coverage: {
|
|
37
|
-
type: 'number',
|
|
38
|
-
min: 0,
|
|
39
|
-
max: 1,
|
|
40
|
-
value: 1
|
|
41
|
-
},
|
|
42
|
-
getPosition: {
|
|
43
|
-
type: 'accessor',
|
|
44
|
-
value: x => x.position
|
|
45
|
-
},
|
|
46
|
-
extruded: false,
|
|
47
|
-
material: true
|
|
48
|
-
};
|
|
49
|
-
const DIMENSIONS = {
|
|
50
|
-
data: {
|
|
51
|
-
props: ['cellSize', 'colorAggregation', 'elevationAggregation']
|
|
52
|
-
}
|
|
53
|
-
};
|
|
54
|
-
const POSITION_ATTRIBUTE_NAME = 'positions';
|
|
55
|
-
export default class GPUGridLayer extends GridAggregationLayer {
|
|
56
|
-
constructor(...args) {
|
|
57
|
-
super(...args);
|
|
58
|
-
this.state = void 0;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
initializeState({
|
|
62
|
-
device
|
|
63
|
-
}) {
|
|
64
|
-
const isSupported = GPUGridAggregator.isSupported(device);
|
|
65
|
-
|
|
66
|
-
if (!isSupported) {
|
|
67
|
-
log.error('GPUGridLayer is not supported on this browser, use GridLayer instead')();
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
super.initializeAggregationLayer({
|
|
71
|
-
dimensions: DIMENSIONS
|
|
72
|
-
});
|
|
73
|
-
this.setState({
|
|
74
|
-
gpuAggregation: false,
|
|
75
|
-
projectPoints: false,
|
|
76
|
-
isSupported,
|
|
77
|
-
weights: {
|
|
78
|
-
color: {
|
|
79
|
-
needMin: true,
|
|
80
|
-
needMax: true,
|
|
81
|
-
combineMaxMin: true,
|
|
82
|
-
maxMinBuffer: device.createBuffer({
|
|
83
|
-
byteLength: 4 * 4,
|
|
84
|
-
accessor: {
|
|
85
|
-
size: 4,
|
|
86
|
-
type: 5126,
|
|
87
|
-
divisor: 1
|
|
88
|
-
}
|
|
89
|
-
})
|
|
90
|
-
},
|
|
91
|
-
elevation: {
|
|
92
|
-
needMin: true,
|
|
93
|
-
needMax: true,
|
|
94
|
-
combineMaxMin: true,
|
|
95
|
-
maxMinBuffer: device.createBuffer({
|
|
96
|
-
byteLength: 4 * 4,
|
|
97
|
-
accessor: {
|
|
98
|
-
size: 4,
|
|
99
|
-
type: 5126,
|
|
100
|
-
divisor: 1
|
|
101
|
-
}
|
|
102
|
-
})
|
|
103
|
-
}
|
|
104
|
-
},
|
|
105
|
-
positionAttributeName: 'positions'
|
|
106
|
-
});
|
|
107
|
-
const attributeManager = this.getAttributeManager();
|
|
108
|
-
attributeManager.add({
|
|
109
|
-
[POSITION_ATTRIBUTE_NAME]: {
|
|
110
|
-
size: 3,
|
|
111
|
-
accessor: 'getPosition',
|
|
112
|
-
type: 5130,
|
|
113
|
-
fp64: this.use64bitPositions()
|
|
114
|
-
},
|
|
115
|
-
color: {
|
|
116
|
-
size: 3,
|
|
117
|
-
accessor: 'getColorWeight'
|
|
118
|
-
},
|
|
119
|
-
elevation: {
|
|
120
|
-
size: 3,
|
|
121
|
-
accessor: 'getElevationWeight'
|
|
122
|
-
}
|
|
123
|
-
});
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
updateState(opts) {
|
|
127
|
-
if (this.state.isSupported === false) {
|
|
128
|
-
return;
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
super.updateState(opts);
|
|
132
|
-
const {
|
|
133
|
-
aggregationDirty
|
|
134
|
-
} = this.state;
|
|
135
|
-
|
|
136
|
-
if (aggregationDirty) {
|
|
137
|
-
this.setState({
|
|
138
|
-
gridHash: null
|
|
139
|
-
});
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
getHashKeyForIndex(index) {
|
|
144
|
-
const {
|
|
145
|
-
numRow,
|
|
146
|
-
numCol,
|
|
147
|
-
boundingBox,
|
|
148
|
-
gridOffset
|
|
149
|
-
} = this.state;
|
|
150
|
-
const gridSize = [numCol, numRow];
|
|
151
|
-
const gridOrigin = [boundingBox.xMin, boundingBox.yMin];
|
|
152
|
-
const cellSize = [gridOffset.xOffset, gridOffset.yOffset];
|
|
153
|
-
const yIndex = Math.floor(index / gridSize[0]);
|
|
154
|
-
const xIndex = index - yIndex * gridSize[0];
|
|
155
|
-
const latIdx = Math.floor((yIndex * cellSize[1] + gridOrigin[1] + 90 + cellSize[1] / 2) / cellSize[1]);
|
|
156
|
-
const lonIdx = Math.floor((xIndex * cellSize[0] + gridOrigin[0] + 180 + cellSize[0] / 2) / cellSize[0]);
|
|
157
|
-
return `${latIdx}-${lonIdx}`;
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
getPositionForIndex(index) {
|
|
161
|
-
const {
|
|
162
|
-
numRow,
|
|
163
|
-
numCol,
|
|
164
|
-
boundingBox,
|
|
165
|
-
gridOffset
|
|
166
|
-
} = this.state;
|
|
167
|
-
const gridSize = [numCol, numRow];
|
|
168
|
-
const gridOrigin = [boundingBox.xMin, boundingBox.yMin];
|
|
169
|
-
const cellSize = [gridOffset.xOffset, gridOffset.yOffset];
|
|
170
|
-
const yIndex = Math.floor(index / gridSize[0]);
|
|
171
|
-
const xIndex = index - yIndex * gridSize[0];
|
|
172
|
-
const yPos = yIndex * cellSize[1] + gridOrigin[1];
|
|
173
|
-
const xPos = xIndex * cellSize[0] + gridOrigin[0];
|
|
174
|
-
return [xPos, yPos];
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
getPickingInfo({
|
|
178
|
-
info,
|
|
179
|
-
mode
|
|
180
|
-
}) {
|
|
181
|
-
const {
|
|
182
|
-
index
|
|
183
|
-
} = info;
|
|
184
|
-
let object = null;
|
|
185
|
-
|
|
186
|
-
if (index >= 0) {
|
|
187
|
-
const gpuGridAggregator = this.state.gpuGridAggregator;
|
|
188
|
-
const position = this.getPositionForIndex(index);
|
|
189
|
-
const colorInfo = GPUGridAggregator.getAggregationData({
|
|
190
|
-
pixelIndex: index,
|
|
191
|
-
...gpuGridAggregator.getData('color')
|
|
192
|
-
});
|
|
193
|
-
const elevationInfo = GPUGridAggregator.getAggregationData({
|
|
194
|
-
pixelIndex: index,
|
|
195
|
-
...gpuGridAggregator.getData('elevation')
|
|
196
|
-
});
|
|
197
|
-
object = {
|
|
198
|
-
colorValue: colorInfo.cellWeight,
|
|
199
|
-
elevationValue: elevationInfo.cellWeight,
|
|
200
|
-
count: colorInfo.cellCount || elevationInfo.cellCount,
|
|
201
|
-
position,
|
|
202
|
-
totalCount: colorInfo.totalCount || elevationInfo.totalCount
|
|
203
|
-
};
|
|
204
|
-
|
|
205
|
-
if (mode !== 'hover') {
|
|
206
|
-
const {
|
|
207
|
-
props
|
|
208
|
-
} = this;
|
|
209
|
-
let {
|
|
210
|
-
gridHash
|
|
211
|
-
} = this.state;
|
|
212
|
-
|
|
213
|
-
if (!gridHash) {
|
|
214
|
-
const {
|
|
215
|
-
gridOffset,
|
|
216
|
-
translation,
|
|
217
|
-
boundingBox
|
|
218
|
-
} = this.state;
|
|
219
|
-
const {
|
|
220
|
-
viewport
|
|
221
|
-
} = this.context;
|
|
222
|
-
const attributes = this.getAttributes();
|
|
223
|
-
const cpuAggregation = pointToDensityGridDataCPU(props, {
|
|
224
|
-
gridOffset,
|
|
225
|
-
attributes,
|
|
226
|
-
viewport,
|
|
227
|
-
translation,
|
|
228
|
-
boundingBox
|
|
229
|
-
});
|
|
230
|
-
gridHash = cpuAggregation.gridHash;
|
|
231
|
-
this.setState({
|
|
232
|
-
gridHash
|
|
233
|
-
});
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
const key = this.getHashKeyForIndex(index);
|
|
237
|
-
const cpuAggregationData = gridHash[key];
|
|
238
|
-
Object.assign(object, cpuAggregationData);
|
|
239
|
-
}
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
info.picked = Boolean(object);
|
|
243
|
-
info.object = object;
|
|
244
|
-
return info;
|
|
245
|
-
}
|
|
246
|
-
|
|
247
|
-
renderLayers() {
|
|
248
|
-
if (!this.state.isSupported) {
|
|
249
|
-
return null;
|
|
250
|
-
}
|
|
251
|
-
|
|
252
|
-
const {
|
|
253
|
-
elevationScale,
|
|
254
|
-
extruded,
|
|
255
|
-
cellSize: cellSizeMeters,
|
|
256
|
-
coverage,
|
|
257
|
-
material,
|
|
258
|
-
elevationRange,
|
|
259
|
-
colorDomain,
|
|
260
|
-
elevationDomain
|
|
261
|
-
} = this.props;
|
|
262
|
-
const {
|
|
263
|
-
weights,
|
|
264
|
-
numRow,
|
|
265
|
-
numCol,
|
|
266
|
-
gridOrigin,
|
|
267
|
-
gridOffset
|
|
268
|
-
} = this.state;
|
|
269
|
-
const {
|
|
270
|
-
color,
|
|
271
|
-
elevation
|
|
272
|
-
} = weights;
|
|
273
|
-
const colorRange = colorRangeToFlatArray(this.props.colorRange);
|
|
274
|
-
const SubLayerClass = this.getSubLayerClass('gpu-grid-cell', GPUGridCellLayer);
|
|
275
|
-
return new SubLayerClass({
|
|
276
|
-
gridSize: [numCol, numRow],
|
|
277
|
-
gridOrigin,
|
|
278
|
-
gridOffset: [gridOffset.xOffset, gridOffset.yOffset],
|
|
279
|
-
colorRange,
|
|
280
|
-
elevationRange,
|
|
281
|
-
colorDomain,
|
|
282
|
-
elevationDomain,
|
|
283
|
-
cellSize: cellSizeMeters,
|
|
284
|
-
coverage,
|
|
285
|
-
material,
|
|
286
|
-
elevationScale,
|
|
287
|
-
extruded
|
|
288
|
-
}, this.getSubLayerProps({
|
|
289
|
-
id: 'gpu-grid-cell'
|
|
290
|
-
}), {
|
|
291
|
-
data: {
|
|
292
|
-
attributes: {
|
|
293
|
-
colors: color.aggregationBuffer,
|
|
294
|
-
elevations: elevation.aggregationBuffer
|
|
295
|
-
}
|
|
296
|
-
},
|
|
297
|
-
colorMaxMinBuffer: color.maxMinBuffer,
|
|
298
|
-
elevationMaxMinBuffer: elevation.maxMinBuffer,
|
|
299
|
-
numInstances: numCol * numRow
|
|
300
|
-
});
|
|
301
|
-
}
|
|
302
|
-
|
|
303
|
-
finalizeState(context) {
|
|
304
|
-
const {
|
|
305
|
-
color,
|
|
306
|
-
elevation
|
|
307
|
-
} = this.state.weights;
|
|
308
|
-
[color, elevation].forEach(weight => {
|
|
309
|
-
const {
|
|
310
|
-
aggregationBuffer,
|
|
311
|
-
maxMinBuffer
|
|
312
|
-
} = weight;
|
|
313
|
-
maxMinBuffer === null || maxMinBuffer === void 0 ? void 0 : maxMinBuffer.destroy();
|
|
314
|
-
aggregationBuffer === null || aggregationBuffer === void 0 ? void 0 : aggregationBuffer.destroy();
|
|
315
|
-
});
|
|
316
|
-
super.finalizeState(context);
|
|
317
|
-
}
|
|
318
|
-
|
|
319
|
-
updateAggregationState(opts) {
|
|
320
|
-
const {
|
|
321
|
-
props,
|
|
322
|
-
oldProps
|
|
323
|
-
} = opts;
|
|
324
|
-
const {
|
|
325
|
-
cellSize,
|
|
326
|
-
coordinateSystem
|
|
327
|
-
} = props;
|
|
328
|
-
const {
|
|
329
|
-
viewport
|
|
330
|
-
} = this.context;
|
|
331
|
-
const cellSizeChanged = oldProps.cellSize !== cellSize;
|
|
332
|
-
const {
|
|
333
|
-
dimensions
|
|
334
|
-
} = this.state;
|
|
335
|
-
const positionsChanged = this.isAttributeChanged(POSITION_ATTRIBUTE_NAME);
|
|
336
|
-
const attributesChanged = positionsChanged || this.isAttributeChanged();
|
|
337
|
-
let {
|
|
338
|
-
boundingBox
|
|
339
|
-
} = this.state;
|
|
340
|
-
|
|
341
|
-
if (positionsChanged) {
|
|
342
|
-
boundingBox = getBoundingBox(this.getAttributes(), this.getNumInstances());
|
|
343
|
-
this.setState({
|
|
344
|
-
boundingBox
|
|
345
|
-
});
|
|
346
|
-
}
|
|
347
|
-
|
|
348
|
-
if (positionsChanged || cellSizeChanged) {
|
|
349
|
-
const {
|
|
350
|
-
gridOffset,
|
|
351
|
-
translation,
|
|
352
|
-
width,
|
|
353
|
-
height,
|
|
354
|
-
numCol,
|
|
355
|
-
numRow
|
|
356
|
-
} = getGridParams(boundingBox, cellSize, viewport, coordinateSystem);
|
|
357
|
-
this.allocateResources(numRow, numCol);
|
|
358
|
-
this.setState({
|
|
359
|
-
gridOffset,
|
|
360
|
-
translation,
|
|
361
|
-
gridOrigin: [-1 * translation[0], -1 * translation[1]],
|
|
362
|
-
width,
|
|
363
|
-
height,
|
|
364
|
-
numCol,
|
|
365
|
-
numRow
|
|
366
|
-
});
|
|
367
|
-
}
|
|
368
|
-
|
|
369
|
-
const aggregationDataDirty = attributesChanged || this.isAggregationDirty(opts, {
|
|
370
|
-
dimension: dimensions.data,
|
|
371
|
-
compareAll: true
|
|
372
|
-
});
|
|
373
|
-
|
|
374
|
-
if (aggregationDataDirty) {
|
|
375
|
-
this._updateAccessors(opts);
|
|
376
|
-
}
|
|
377
|
-
|
|
378
|
-
this.setState({
|
|
379
|
-
aggregationDataDirty
|
|
380
|
-
});
|
|
381
|
-
}
|
|
382
|
-
|
|
383
|
-
_updateAccessors(opts) {
|
|
384
|
-
const {
|
|
385
|
-
colorAggregation,
|
|
386
|
-
elevationAggregation
|
|
387
|
-
} = opts.props;
|
|
388
|
-
const {
|
|
389
|
-
color,
|
|
390
|
-
elevation
|
|
391
|
-
} = this.state.weights;
|
|
392
|
-
color.operation = AGGREGATION_OPERATION[colorAggregation];
|
|
393
|
-
elevation.operation = AGGREGATION_OPERATION[elevationAggregation];
|
|
394
|
-
}
|
|
395
|
-
|
|
396
|
-
}
|
|
397
|
-
GPUGridLayer.layerName = 'GPUGridLayer';
|
|
398
|
-
GPUGridLayer.defaultProps = defaultProps;
|
|
399
|
-
//# sourceMappingURL=gpu-grid-layer.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/gpu-grid-layer/gpu-grid-layer.ts"],"names":["GL","log","GPUGridAggregator","AGGREGATION_OPERATION","defaultColorRange","colorRangeToFlatArray","GPUGridCellLayer","pointToDensityGridDataCPU","GridAggregationLayer","getBoundingBox","getGridParams","defaultProps","colorDomain","colorRange","getColorWeight","type","value","colorAggregation","elevationDomain","elevationRange","getElevationWeight","elevationAggregation","elevationScale","min","cellSize","max","coverage","getPosition","x","position","extruded","material","DIMENSIONS","data","props","POSITION_ATTRIBUTE_NAME","GPUGridLayer","state","initializeState","device","isSupported","error","initializeAggregationLayer","dimensions","setState","gpuAggregation","projectPoints","weights","color","needMin","needMax","combineMaxMin","maxMinBuffer","createBuffer","byteLength","accessor","size","divisor","elevation","positionAttributeName","attributeManager","getAttributeManager","add","fp64","use64bitPositions","updateState","opts","aggregationDirty","gridHash","getHashKeyForIndex","index","numRow","numCol","boundingBox","gridOffset","gridSize","gridOrigin","xMin","yMin","xOffset","yOffset","yIndex","Math","floor","xIndex","latIdx","lonIdx","getPositionForIndex","yPos","xPos","getPickingInfo","info","mode","object","gpuGridAggregator","colorInfo","getAggregationData","pixelIndex","getData","elevationInfo","colorValue","cellWeight","elevationValue","count","cellCount","totalCount","translation","viewport","context","attributes","getAttributes","cpuAggregation","key","cpuAggregationData","Object","assign","picked","Boolean","renderLayers","cellSizeMeters","SubLayerClass","getSubLayerClass","getSubLayerProps","id","colors","aggregationBuffer","elevations","colorMaxMinBuffer","elevationMaxMinBuffer","numInstances","finalizeState","forEach","weight","destroy","updateAggregationState","oldProps","coordinateSystem","cellSizeChanged","positionsChanged","isAttributeChanged","attributesChanged","getNumInstances","width","height","allocateResources","aggregationDataDirty","isAggregationDirty","dimension","compareAll","_updateAccessors","operation","layerName"],"mappings":"AAoBA,SAAQA,EAAR,QAAiB,oBAAjB;AACA,SAOEC,GAPF,QAWO,eAXP;AAaA,OAAOC,iBAAP,MAA8B,mDAA9B;AACA,SAAQC,qBAAR,QAAoC,sCAApC;AACA,SAAQC,iBAAR,EAA2BC,qBAA3B,QAAuD,sBAAvD;AACA,OAAOC,gBAAP,MAA6B,uBAA7B;AACA,SAAQC,yBAAR,QAAkD,qCAAlD;AACA,OAAOC,oBAAP,MAA8D,2BAA9D;AACA,SAAQC,cAAR,EAAwBC,aAAxB,QAA4C,iCAA5C;AAEA,MAAMC,YAA6C,GAAG;AAEpDC,EAAAA,WAAW,EAAE,IAFuC;AAGpDC,EAAAA,UAAU,EAAET,iBAHwC;AAIpDU,EAAAA,cAAc,EAAE;AAACC,IAAAA,IAAI,EAAE,UAAP;AAAmBC,IAAAA,KAAK,EAAE;AAA1B,GAJoC;AAKpDC,EAAAA,gBAAgB,EAAE,KALkC;AAQpDC,EAAAA,eAAe,EAAE,IARmC;AASpDC,EAAAA,cAAc,EAAE,CAAC,CAAD,EAAI,IAAJ,CAToC;AAUpDC,EAAAA,kBAAkB,EAAE;AAACL,IAAAA,IAAI,EAAE,UAAP;AAAmBC,IAAAA,KAAK,EAAE;AAA1B,GAVgC;AAWpDK,EAAAA,oBAAoB,EAAE,KAX8B;AAYpDC,EAAAA,cAAc,EAAE;AAACP,IAAAA,IAAI,EAAE,QAAP;AAAiBQ,IAAAA,GAAG,EAAE,CAAtB;AAAyBP,IAAAA,KAAK,EAAE;AAAhC,GAZoC;AAepDQ,EAAAA,QAAQ,EAAE;AAACT,IAAAA,IAAI,EAAE,QAAP;AAAiBQ,IAAAA,GAAG,EAAE,CAAtB;AAAyBE,IAAA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ALY;AAMZvE,QAAAA,MANY;AAOZD,QAAAA;AAPY,OAAd;AASD;;AAED,UAAM0E,oBAAoB,GACxBL,iBAAiB,IACjB,KAAKM,kBAAL,CAAwBhF,IAAxB,EAA8B;AAC5BiF,MAAAA,SAAS,EAAExG,UAAU,CAACV,IADM;AAE5BmH,MAAAA,UAAU,EAAE;AAFgB,KAA9B,CAFF;;AAOA,QAAIH,oBAAJ,EAA0B;AACxB,WAAKI,gBAAL,CAAsBnF,IAAtB;AACD;;AACD,SAAKtB,QAAL,CAAc;AACZqG,MAAAA;AADY,KAAd;AAGD;;AAIDI,EAAAA,gBAAgB,CAACnF,IAAD,EAAO;AACrB,UAAM;AAACjD,MAAAA,gBAAD;AAAmBI,MAAAA;AAAnB,QAA2C6C,IAAI,CAAChC,KAAtD;AACA,UAAM;AAACc,MAAAA,KAAD;AAAQU,MAAAA;AAAR,QAAqB,KAAKrB,KAAL,CAAWU,OAAtC;AACAC,IAAAA,KAAK,CAACsG,SAAN,GAAkBnJ,qBAAqB,CAACc,gBAAD,CAAvC;AACAyC,IAAAA,SAAS,CAAC4F,SAAV,GAAsBnJ,qBAAqB,CAACkB,oBAAD,CAA3C;AACD;;AAxRsF;AAHpEe,Y,CAIZmH,S,GAAY,c;AAJAnH,Y,CAKZzB,Y,GAAeA,Y","sourcesContent":["// Copyright (c) 2015 - 2017 Uber Technologies, Inc.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nimport {GL} from '@luma.gl/constants';\nimport {\n Accessor,\n AccessorFunction,\n Color,\n Material,\n GetPickingInfoParams,\n LayerContext,\n log,\n PickingInfo,\n Position,\n DefaultProps\n} from '@deck.gl/core';\n\nimport GPUGridAggregator from '../utils/gpu-grid-aggregation/gpu-grid-aggregator';\nimport {AGGREGATION_OPERATION} from '../utils/aggregation-operation-utils';\nimport {defaultColorRange, colorRangeToFlatArray} from '../utils/color-utils';\nimport GPUGridCellLayer from './gpu-grid-cell-layer';\nimport {pointToDensityGridDataCPU, GridHash} from './../cpu-grid-layer/grid-aggregator';\nimport GridAggregationLayer, {GridAggregationLayerProps} from '../grid-aggregation-layer';\nimport {getBoundingBox, getGridParams} from '../utils/grid-aggregation-utils';\n\nconst defaultProps: DefaultProps<GPUGridLayerProps> = {\n // color\n colorDomain: null,\n colorRange: defaultColorRange,\n getColorWeight: {type: 'accessor', value: 1},\n colorAggregation: 'SUM',\n\n // elevation\n elevationDomain: null,\n elevationRange: [0, 1000],\n getElevationWeight: {type: 'accessor', value: 1},\n elevationAggregation: 'SUM',\n elevationScale: {type: 'number', min: 0, value: 1},\n\n // grid\n cellSize: {type: 'number', min: 1, max: 1000, value: 1000},\n coverage: {type: 'number', min: 0, max: 1, value: 1},\n getPosition: {type: 'accessor', value: (x: any) => x.position},\n extruded: false,\n\n // Optional material for 'lighting' shader module\n material: true\n};\n\n// This layer only perform GPU aggregation, no need to seperate data and weight props\n// aggregation will be dirty when any of the props are changed.\n\nconst DIMENSIONS = {\n data: {\n props: ['cellSize', 'colorAggregation', 'elevationAggregation']\n }\n // rest of the changes are detected by `state.attributesChanged`\n};\nconst POSITION_ATTRIBUTE_NAME = 'positions';\n\n/** All properties supported by GPUGridLayer. */\nexport type GPUGridLayerProps<DataT = unknown> = _GPUGridLayerProps<DataT> &\n GridAggregationLayerProps<DataT>;\n\n/** Properties added by GPUGridLayer. */\nexport type _GPUGridLayerProps<DataT> = {\n /**\n * Size of each cell in meters.\n * @default 1000\n */\n cellSize?: number;\n\n /**\n * Color scale domain, default is set to the extent of aggregated weights in each cell.\n * @default [min(colorWeight), max(colorWeight)]\n */\n colorDomain?: [number, number] | null;\n\n /**\n * Default: [colorbrewer](http://colorbrewer2.org/#type=sequential&scheme=YlOrRd&n=6) `6-class YlOrRd`\n */\n colorRange?: Color[];\n\n /**\n * Cell size multiplier, clamped between 0 - 1.\n * @default 1\n */\n coverage?: number;\n\n /**\n * Elevation scale input domain, default is set to between 0 and the max of aggregated weights in each cell.\n * @default [0, max(elevationWeight)]\n */\n elevationDomain?: [number, number] | null;\n\n /**\n * Elevation scale output range.\n * @default [0, 1000]\n */\n elevationRange?: [number, number];\n\n /**\n * Cell elevation multiplier.\n * @default 1\n */\n elevationScale?: number;\n\n /**\n * Whether to enable cell elevation. If set to false, all cell will be flat.\n * @default true\n */\n extruded?: boolean;\n\n /**\n * Material settings for lighting effect. Applies if `extruded: true`.\n *\n * @default true\n * @see https://deck.gl/docs/developer-guide/using-lighting\n */\n material?: Material;\n\n /**\n * Defines the operation used to aggregate all data object weights to calculate a cell's color value.\n * @default 'SUM'\n */\n colorAggregation?: 'SUM' | 'MEAN' | 'MIN' | 'MAX';\n\n /**\n * Defines the operation used to aggregate all data object weights to calculate a cell's elevation value.\n * @default 'SUM'\n */\n elevationAggregation?: 'SUM' | 'MEAN' | 'MIN' | 'MAX';\n\n /**\n * Method called to retrieve the position of each object.\n * @default object => object.position\n */\n getPosition?: AccessorFunction<DataT, Position>;\n\n /**\n * The weight of a data object used to calculate the color value for a cell.\n * @default 1\n */\n getColorWeight?: Accessor<DataT, number>;\n\n /**\n * The weight of a data object used to calculate the elevation value for a cell.\n * @default 1\n */\n getElevationWeight?: Accessor<DataT, number>;\n};\n\n/** Aggregate data into a grid-based heatmap. Aggregation is performed on GPU (WebGL2 only). */\nexport default class GPUGridLayer<\n DataT = any,\n ExtraPropsT extends {} = {}\n> extends GridAggregationLayer<DataT, ExtraPropsT & Required<_GPUGridLayerProps<DataT>>> {\n static layerName = 'GPUGridLayer';\n static defaultProps = defaultProps;\n\n state!: GridAggregationLayer<DataT>['state'] & {\n isSupported: boolean;\n gridHash?: GridHash;\n };\n\n initializeState({device}: LayerContext): void {\n const isSupported = GPUGridAggregator.isSupported(device);\n if (!isSupported) {\n log.error('GPUGridLayer is not supported on this browser, use GridLayer instead')();\n }\n super.initializeAggregationLayer({\n dimensions: DIMENSIONS\n });\n this.setState({\n gpuAggregation: false, // TODO(v9): Re-enable GPU aggregation.\n projectPoints: false, // aggregation in world space\n isSupported,\n weights: {\n color: {\n needMin: true,\n needMax: true,\n combineMaxMin: true,\n maxMinBuffer: device.createBuffer({\n byteLength: 4 * 4,\n // @ts-expect-error webgl-legacy\n accessor: {size: 4, type: GL.FLOAT, divisor: 1}\n })\n },\n elevation: {\n needMin: true,\n needMax: true,\n combineMaxMin: true,\n maxMinBuffer: device.createBuffer({\n byteLength: 4 * 4,\n // @ts-expect-error\n accessor: {size: 4, type: GL.FLOAT, divisor: 1}\n })\n }\n },\n positionAttributeName: 'positions'\n });\n const attributeManager = this.getAttributeManager()!;\n attributeManager.add({\n [POSITION_ATTRIBUTE_NAME]: {\n size: 3,\n accessor: 'getPosition',\n type: GL.DOUBLE,\n fp64: this.use64bitPositions()\n },\n color: {size: 3, accessor: 'getColorWeight'},\n elevation: {size: 3, accessor: 'getElevationWeight'}\n });\n }\n\n updateState(opts) {\n if (this.state.isSupported === false) {\n // Skip update, layer not supported\n return;\n }\n super.updateState(opts);\n const {aggregationDirty} = this.state;\n if (aggregationDirty) {\n // reset cached CPU Aggregation results (used for picking)\n this.setState({\n gridHash: null\n });\n }\n }\n\n getHashKeyForIndex(index: number): string {\n const {numRow, numCol, boundingBox, gridOffset} = this.state;\n const gridSize = [numCol, numRow];\n const gridOrigin = [boundingBox.xMin, boundingBox.yMin];\n const cellSize = [gridOffset.xOffset, gridOffset.yOffset];\n\n const yIndex = Math.floor(index / gridSize[0]);\n const xIndex = index - yIndex * gridSize[0];\n // This will match the index to the hash-key to access aggregation data from CPU aggregation results.\n const latIdx = Math.floor(\n (yIndex * cellSize[1] + gridOrigin[1] + 90 + cellSize[1] / 2) / cellSize[1]\n );\n const lonIdx = Math.floor(\n (xIndex * cellSize[0] + gridOrigin[0] + 180 + cellSize[0] / 2) / cellSize[0]\n );\n return `${latIdx}-${lonIdx}`;\n }\n\n getPositionForIndex(index: number): Position {\n const {numRow, numCol, boundingBox, gridOffset} = this.state;\n const gridSize = [numCol, numRow];\n const gridOrigin = [boundingBox.xMin, boundingBox.yMin];\n const cellSize = [gridOffset.xOffset, gridOffset.yOffset];\n\n const yIndex = Math.floor(index / gridSize[0]);\n const xIndex = index - yIndex * gridSize[0];\n const yPos = yIndex * cellSize[1] + gridOrigin[1];\n const xPos = xIndex * cellSize[0] + gridOrigin[0];\n return [xPos, yPos];\n }\n\n getPickingInfo({info, mode}: GetPickingInfoParams): PickingInfo {\n const {index} = info;\n let object: any = null;\n if (index >= 0) {\n const gpuGridAggregator = this.state.gpuGridAggregator!;\n const position = this.getPositionForIndex(index);\n const colorInfo = GPUGridAggregator.getAggregationData({\n pixelIndex: index,\n ...gpuGridAggregator.getData('color')\n });\n const elevationInfo = GPUGridAggregator.getAggregationData({\n pixelIndex: index,\n ...gpuGridAggregator.getData('elevation')\n });\n\n object = {\n colorValue: colorInfo.cellWeight,\n elevationValue: elevationInfo.cellWeight,\n count: colorInfo.cellCount || elevationInfo.cellCount,\n position,\n totalCount: colorInfo.totalCount || elevationInfo.totalCount\n };\n if (mode !== 'hover') {\n // perform CPU aggregation for full list of points for each cell\n const {props} = this;\n let {gridHash} = this.state;\n if (!gridHash) {\n const {gridOffset, translation, boundingBox} = this.state;\n const {viewport} = this.context;\n const attributes = this.getAttributes();\n const cpuAggregation = pointToDensityGridDataCPU(props as any, {\n gridOffset,\n attributes,\n viewport,\n translation,\n boundingBox\n });\n gridHash = cpuAggregation.gridHash;\n this.setState({gridHash});\n }\n const key = this.getHashKeyForIndex(index);\n const cpuAggregationData = gridHash[key];\n Object.assign(object, cpuAggregationData);\n }\n }\n\n // override object with picked cell\n info.picked = Boolean(object);\n info.object = object;\n\n return info;\n }\n\n renderLayers() {\n if (!this.state.isSupported) {\n return null;\n }\n const {\n elevationScale,\n extruded,\n cellSize: cellSizeMeters,\n coverage,\n material,\n elevationRange,\n colorDomain,\n elevationDomain\n } = this.props;\n\n const {weights, numRow, numCol, gridOrigin, gridOffset} = this.state;\n const {color, elevation} = weights;\n const colorRange = colorRangeToFlatArray(this.props.colorRange);\n\n const SubLayerClass = this.getSubLayerClass('gpu-grid-cell', GPUGridCellLayer);\n\n return new SubLayerClass(\n {\n gridSize: [numCol, numRow],\n gridOrigin,\n gridOffset: [gridOffset.xOffset, gridOffset.yOffset],\n colorRange,\n elevationRange,\n colorDomain,\n elevationDomain,\n\n cellSize: cellSizeMeters,\n coverage,\n material,\n elevationScale,\n extruded\n },\n this.getSubLayerProps({\n id: 'gpu-grid-cell'\n }),\n {\n data: {\n attributes: {\n colors: color.aggregationBuffer,\n elevations: elevation.aggregationBuffer\n }\n },\n colorMaxMinBuffer: color.maxMinBuffer,\n elevationMaxMinBuffer: elevation.maxMinBuffer,\n numInstances: numCol * numRow\n }\n );\n }\n\n finalizeState(context: LayerContext) {\n const {color, elevation} = this.state.weights;\n [color, elevation].forEach(weight => {\n const {aggregationBuffer, maxMinBuffer} = weight;\n maxMinBuffer?.destroy();\n aggregationBuffer?.destroy();\n });\n super.finalizeState(context);\n }\n\n // Aggregation Overrides\n\n updateAggregationState(opts) {\n const {props, oldProps} = opts;\n const {cellSize, coordinateSystem} = props;\n const {viewport} = this.context;\n const cellSizeChanged = oldProps.cellSize !== cellSize;\n const {dimensions} = this.state;\n\n const positionsChanged = this.isAttributeChanged(POSITION_ATTRIBUTE_NAME);\n // any attribute changed\n const attributesChanged = positionsChanged || this.isAttributeChanged();\n\n let {boundingBox} = this.state;\n if (positionsChanged) {\n boundingBox = getBoundingBox(this.getAttributes(), this.getNumInstances());\n this.setState({boundingBox});\n }\n if (positionsChanged || cellSizeChanged) {\n const {gridOffset, translation, width, height, numCol, numRow} = getGridParams(\n boundingBox,\n cellSize,\n viewport,\n coordinateSystem\n );\n this.allocateResources(numRow, numCol);\n this.setState({\n gridOffset,\n translation,\n gridOrigin: [-1 * translation[0], -1 * translation[1]],\n width,\n height,\n numCol,\n numRow\n });\n }\n\n const aggregationDataDirty =\n attributesChanged ||\n this.isAggregationDirty(opts, {\n dimension: dimensions.data,\n compareAll: true\n });\n\n if (aggregationDataDirty) {\n this._updateAccessors(opts);\n }\n this.setState({\n aggregationDataDirty\n });\n }\n\n // Private\n\n _updateAccessors(opts) {\n const {colorAggregation, elevationAggregation} = opts.props;\n const {color, elevation} = this.state.weights;\n color.operation = AGGREGATION_OPERATION[colorAggregation];\n elevation.operation = AGGREGATION_OPERATION[elevationAggregation];\n }\n}\n"],"file":"gpu-grid-layer.js"}
|
|
@@ -1,240 +0,0 @@
|
|
|
1
|
-
import { GL } from '@luma.gl/constants';
|
|
2
|
-
import { log } from '@deck.gl/core';
|
|
3
|
-
import AggregationLayer from './aggregation-layer';
|
|
4
|
-
import GPUGridAggregator from './utils/gpu-grid-aggregation/gpu-grid-aggregator';
|
|
5
|
-
import BinSorter from './utils/bin-sorter';
|
|
6
|
-
import { pointToDensityGridDataCPU } from './cpu-grid-layer/grid-aggregator';
|
|
7
|
-
export default class GridAggregationLayer extends AggregationLayer {
|
|
8
|
-
constructor(...args) {
|
|
9
|
-
super(...args);
|
|
10
|
-
this.state = void 0;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
initializeAggregationLayer({
|
|
14
|
-
dimensions
|
|
15
|
-
}) {
|
|
16
|
-
super.initializeAggregationLayer(dimensions);
|
|
17
|
-
this.setState({
|
|
18
|
-
layerData: {},
|
|
19
|
-
gpuGridAggregator: new GPUGridAggregator(this.context.device, {
|
|
20
|
-
id: `${this.id}-gpu-aggregator`
|
|
21
|
-
}),
|
|
22
|
-
cpuGridAggregator: pointToDensityGridDataCPU
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
updateState(opts) {
|
|
27
|
-
super.updateState(opts);
|
|
28
|
-
this.updateAggregationState(opts);
|
|
29
|
-
const {
|
|
30
|
-
aggregationDataDirty,
|
|
31
|
-
aggregationWeightsDirty,
|
|
32
|
-
gpuAggregation
|
|
33
|
-
} = this.state;
|
|
34
|
-
|
|
35
|
-
if (this.getNumInstances() <= 0) {
|
|
36
|
-
return;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
let aggregationDirty = false;
|
|
40
|
-
|
|
41
|
-
if (aggregationDataDirty || gpuAggregation && aggregationWeightsDirty) {
|
|
42
|
-
this._updateAggregation(opts);
|
|
43
|
-
|
|
44
|
-
aggregationDirty = true;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
if (!gpuAggregation && (aggregationDataDirty || aggregationWeightsDirty)) {
|
|
48
|
-
this._updateWeightBins();
|
|
49
|
-
|
|
50
|
-
this._uploadAggregationResults();
|
|
51
|
-
|
|
52
|
-
aggregationDirty = true;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
this.setState({
|
|
56
|
-
aggregationDirty
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
finalizeState(context) {
|
|
61
|
-
var _this$state$gpuGridAg;
|
|
62
|
-
|
|
63
|
-
const {
|
|
64
|
-
count
|
|
65
|
-
} = this.state.weights;
|
|
66
|
-
|
|
67
|
-
if (count && count.aggregationBuffer) {
|
|
68
|
-
count.aggregationBuffer.delete();
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
(_this$state$gpuGridAg = this.state.gpuGridAggregator) === null || _this$state$gpuGridAg === void 0 ? void 0 : _this$state$gpuGridAg.delete();
|
|
72
|
-
super.finalizeState(context);
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
updateShaders(shaders) {
|
|
76
|
-
if (this.state.gpuAggregation) {
|
|
77
|
-
this.state.gpuGridAggregator.updateShaders(shaders);
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
updateAggregationState(opts) {
|
|
82
|
-
log.assert(false);
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
allocateResources(numRow, numCol) {
|
|
86
|
-
if (this.state.numRow !== numRow || this.state.numCol !== numCol) {
|
|
87
|
-
const dataBytes = numCol * numRow * 4 * 4;
|
|
88
|
-
const {
|
|
89
|
-
weights
|
|
90
|
-
} = this.state;
|
|
91
|
-
|
|
92
|
-
for (const name in weights) {
|
|
93
|
-
const weight = weights[name];
|
|
94
|
-
|
|
95
|
-
if (weight.aggregationBuffer) {
|
|
96
|
-
weight.aggregationBuffer.delete();
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
weight.aggregationBuffer = this.context.device.createBuffer({
|
|
100
|
-
byteLength: dataBytes,
|
|
101
|
-
accessor: {
|
|
102
|
-
size: 4,
|
|
103
|
-
type: 5126,
|
|
104
|
-
divisor: 1
|
|
105
|
-
}
|
|
106
|
-
});
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
updateResults({
|
|
112
|
-
aggregationData,
|
|
113
|
-
maxMinData,
|
|
114
|
-
maxData,
|
|
115
|
-
minData
|
|
116
|
-
}) {
|
|
117
|
-
const {
|
|
118
|
-
count
|
|
119
|
-
} = this.state.weights;
|
|
120
|
-
|
|
121
|
-
if (count) {
|
|
122
|
-
count.aggregationData = aggregationData;
|
|
123
|
-
count.maxMinData = maxMinData;
|
|
124
|
-
count.maxData = maxData;
|
|
125
|
-
count.minData = minData;
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
_updateAggregation(opts) {
|
|
130
|
-
const {
|
|
131
|
-
cpuGridAggregator,
|
|
132
|
-
gpuGridAggregator,
|
|
133
|
-
gridOffset,
|
|
134
|
-
posOffset,
|
|
135
|
-
translation = [0, 0],
|
|
136
|
-
scaling = [0, 0, 0],
|
|
137
|
-
boundingBox,
|
|
138
|
-
projectPoints,
|
|
139
|
-
gpuAggregation,
|
|
140
|
-
numCol,
|
|
141
|
-
numRow
|
|
142
|
-
} = this.state;
|
|
143
|
-
const {
|
|
144
|
-
props
|
|
145
|
-
} = opts;
|
|
146
|
-
const {
|
|
147
|
-
viewport
|
|
148
|
-
} = this.context;
|
|
149
|
-
const attributes = this.getAttributes();
|
|
150
|
-
const vertexCount = this.getNumInstances();
|
|
151
|
-
|
|
152
|
-
if (!gpuAggregation) {
|
|
153
|
-
const result = cpuGridAggregator(props, {
|
|
154
|
-
gridOffset,
|
|
155
|
-
projectPoints,
|
|
156
|
-
attributes,
|
|
157
|
-
viewport,
|
|
158
|
-
posOffset,
|
|
159
|
-
boundingBox
|
|
160
|
-
});
|
|
161
|
-
this.setState({
|
|
162
|
-
layerData: result
|
|
163
|
-
});
|
|
164
|
-
} else {
|
|
165
|
-
const {
|
|
166
|
-
weights
|
|
167
|
-
} = this.state;
|
|
168
|
-
gpuGridAggregator.run({
|
|
169
|
-
weights,
|
|
170
|
-
cellSize: [gridOffset.xOffset, gridOffset.yOffset],
|
|
171
|
-
numCol,
|
|
172
|
-
numRow,
|
|
173
|
-
translation,
|
|
174
|
-
scaling,
|
|
175
|
-
vertexCount,
|
|
176
|
-
projectPoints,
|
|
177
|
-
attributes,
|
|
178
|
-
moduleSettings: this.getModuleSettings()
|
|
179
|
-
});
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
_updateWeightBins() {
|
|
184
|
-
const {
|
|
185
|
-
getValue
|
|
186
|
-
} = this.state;
|
|
187
|
-
const sortedBins = new BinSorter(this.state.layerData.data || [], {
|
|
188
|
-
getValue
|
|
189
|
-
});
|
|
190
|
-
this.setState({
|
|
191
|
-
sortedBins
|
|
192
|
-
});
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
_uploadAggregationResults() {
|
|
196
|
-
const {
|
|
197
|
-
numCol,
|
|
198
|
-
numRow
|
|
199
|
-
} = this.state;
|
|
200
|
-
const {
|
|
201
|
-
data
|
|
202
|
-
} = this.state.layerData;
|
|
203
|
-
const {
|
|
204
|
-
aggregatedBins,
|
|
205
|
-
minValue,
|
|
206
|
-
maxValue,
|
|
207
|
-
totalCount
|
|
208
|
-
} = this.state.sortedBins;
|
|
209
|
-
const ELEMENTCOUNT = 4;
|
|
210
|
-
const aggregationSize = numCol * numRow * ELEMENTCOUNT;
|
|
211
|
-
const aggregationData = new Float32Array(aggregationSize).fill(0);
|
|
212
|
-
|
|
213
|
-
for (const bin of aggregatedBins) {
|
|
214
|
-
const {
|
|
215
|
-
lonIdx,
|
|
216
|
-
latIdx
|
|
217
|
-
} = data[bin.i];
|
|
218
|
-
const {
|
|
219
|
-
value,
|
|
220
|
-
counts
|
|
221
|
-
} = bin;
|
|
222
|
-
const cellIndex = (lonIdx + latIdx * numCol) * ELEMENTCOUNT;
|
|
223
|
-
aggregationData[cellIndex] = value;
|
|
224
|
-
aggregationData[cellIndex + ELEMENTCOUNT - 1] = counts;
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
const maxMinData = new Float32Array([maxValue, 0, 0, minValue]);
|
|
228
|
-
const maxData = new Float32Array([maxValue, 0, 0, totalCount]);
|
|
229
|
-
const minData = new Float32Array([minValue, 0, 0, totalCount]);
|
|
230
|
-
this.updateResults({
|
|
231
|
-
aggregationData,
|
|
232
|
-
maxMinData,
|
|
233
|
-
maxData,
|
|
234
|
-
minData
|
|
235
|
-
});
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
}
|
|
239
|
-
GridAggregationLayer.layerName = 'GridAggregationLayer';
|
|
240
|
-
//# sourceMappingURL=grid-aggregation-layer.js.map
|