@deck.gl/aggregation-layers 9.0.0-beta.2 → 9.0.0-beta.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/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 +241 -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 +130 -0
- package/dist/cpu-grid-layer/grid-aggregator.js +141 -0
- package/dist/dist.dev.js +1296 -13614
- package/dist/gpu-grid-layer/gpu-grid-cell-layer-fragment.glsl.js +34 -0
- package/dist/{esm/gpu-grid-layer → gpu-grid-layer}/gpu-grid-cell-layer-vertex.glsl.js +20 -1
- 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 +3 -3
- 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/dist/heatmap-layer/heatmap-layer-utils.js +63 -0
- package/{typed → dist}/heatmap-layer/heatmap-layer.d.ts +1 -1
- package/dist/heatmap-layer/heatmap-layer.d.ts.map +1 -0
- package/dist/heatmap-layer/heatmap-layer.js +471 -0
- package/dist/{esm/heatmap-layer → heatmap-layer}/max-fs.glsl.js +0 -1
- package/dist/{esm/heatmap-layer → heatmap-layer}/max-vs.glsl.js +0 -1
- package/dist/heatmap-layer/triangle-layer-fragment.glsl.js +61 -0
- package/dist/heatmap-layer/triangle-layer-vertex.glsl.js +52 -0
- package/dist/heatmap-layer/triangle-layer.js +59 -0
- package/dist/{esm/heatmap-layer → heatmap-layer}/weights-fs.glsl.js +0 -1
- package/dist/{esm/heatmap-layer → heatmap-layer}/weights-vs.glsl.js +0 -1
- package/dist/hexagon-layer/hexagon-aggregator.js +112 -0
- package/{typed → dist}/hexagon-layer/hexagon-layer.d.ts +3 -3
- package/dist/hexagon-layer/hexagon-layer.d.ts.map +1 -0
- package/dist/hexagon-layer/hexagon-layer.js +174 -0
- package/dist/index.cjs +4494 -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 +1 -1
- package/dist/screen-grid-layer/screen-grid-cell-layer.d.ts.map +1 -0
- package/dist/screen-grid-layer/screen-grid-cell-layer.js +166 -0
- package/dist/screen-grid-layer/screen-grid-layer-fragment.glsl.js +40 -0
- package/dist/{esm/screen-grid-layer → screen-grid-layer}/screen-grid-layer-vertex.glsl.js +19 -1
- package/{typed → dist}/screen-grid-layer/screen-grid-layer.d.ts +1 -1
- package/dist/screen-grid-layer/screen-grid-layer.d.ts.map +1 -0
- package/dist/screen-grid-layer/screen-grid-layer.js +216 -0
- package/dist/types.js +1 -0
- package/dist/utils/aggregation-operation-utils.js +94 -0
- 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 +39 -0
- package/dist/utils/gpu-grid-aggregation/aggregate-all-vs.glsl.js +53 -0
- package/dist/utils/gpu-grid-aggregation/aggregate-to-grid-fs.glsl.js +34 -0
- package/dist/{esm/utils → utils}/gpu-grid-aggregation/aggregate-to-grid-vs.glsl.js +19 -1
- 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 +566 -0
- package/dist/utils/gpu-grid-aggregation/transform-mean-vs.glsl.js +37 -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 +60 -174
- package/package.json +18 -11
- package/src/utils/gpu-grid-aggregation/gpu-grid-aggregator.ts +10 -13
- 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 -107
- package/dist/es5/heatmap-layer/heatmap-layer-utils.js.map +0 -1
- package/dist/es5/heatmap-layer/heatmap-layer.js +0 -678
- 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 -121
- 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.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 -55
- package/dist/esm/heatmap-layer/heatmap-layer-utils.js.map +0 -1
- package/dist/esm/heatmap-layer/heatmap-layer.js +0 -638
- package/dist/esm/heatmap-layer/heatmap-layer.js.map +0 -1
- package/dist/esm/heatmap-layer/max-fs.glsl.js.map +0 -1
- 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 -78
- package/dist/esm/heatmap-layer/triangle-layer.js.map +0 -1
- package/dist/esm/heatmap-layer/weights-fs.glsl.js.map +0 -1
- 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.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.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/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.d.ts.map +0 -1
- 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}/aggregation-layer.d.ts.map +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/heatmap-layer-utils.d.ts +0 -0
- /package/{typed → dist}/heatmap-layer/heatmap-layer-utils.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/max-vs.glsl.d.ts +0 -0
- /package/{typed → dist}/heatmap-layer/max-vs.glsl.d.ts.map +0 -0
- /package/{typed → dist}/heatmap-layer/triangle-layer-fragment.glsl.d.ts +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/triangle-layer.d.ts +0 -0
- /package/{typed → dist}/heatmap-layer/triangle-layer.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}/heatmap-layer/weights-vs.glsl.d.ts +0 -0
- /package/{typed → dist}/heatmap-layer/weights-vs.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 +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 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/utils/gpu-grid-aggregation/gpu-grid-aggregator.ts"],"names":["Model","TextureTransform","fp64arithmetic","readPixelsToBuffer","withGLParameters","clear","GL","log","project32","_mergeShaders","mergeShaders","getShaderAssembler","DEFAULT_RUN_PARAMS","MAX_32_BIT_FLOAT","MIN_BLEND_EQUATION","MAX_BLEND_EQUATION","MAX_MIN_BLEND_EQUATION","EQUATION_MAP","DEFAULT_WEIGHT_PARAMS","PIXEL_SIZE","AGGREGATION_OPERATION","AGGREGATE_TO_GRID_VS","AGGREGATE_TO_GRID_FS","AGGREGATE_ALL_VS","AGGREGATE_ALL_FS","TRANSFORM_MEAN_VS","getFloatTexture","getFramebuffer","BUFFER_NAMES","ARRAY_BUFFER_MAP","maxData","minData","maxMinData","REQUIRED_FEATURES","GPUGridAggregator","getAggregationData","aggregationData","pixelIndex","index","results","cellCount","cellWeight","maxCellWieght","minCellWeight","totalCount","getCellData","countsData","size","numCells","length","cellWeights","Float32Array","cellCounts","Uint32Array","i","sizeIndex","isSupported","device","every","feature","features","has","constructor","props","state","weightAttributes","textures","meanTextures","buffers","framebuffers","maxMinFramebuffers","minFramebuffers","maxFramebuffers","equations","shaderOptions","modelDirty","resources","id","_hasGPUSupport","gridAggregationModel","allAggregationModel","meanTransform","info","type","_setupModels","delete","destroy","deleteResources","run","opts","setState","aggregationParams","_normalizeAggregationParams","_runAggregation","getData","weightId","data","aggregationBuffer","arrayName","bufferName","updateShaders","weights","normalizeWeightParams","updateObject","Object","assign","_getAggregateData","needMin","needMax","combineMaxMin","aggregationTexture","target","sourceType","maxMinBuffer","maxMinTexture","minBuffer","minTexture","maxBuffer","maxTexture","_trackGPUResultBuffers","_renderAggregateData","cellSize","projectPoints","attributes","moduleSettings","numCol","numRow","translation","scaling","gridSize","parameters","blend","depthTest","blendFunc","uniforms","_renderToWeightsTexture","_renderToMaxMinTexture","blendEquation","minOrMaxFb","clearParams","clearColor","framebuffer","viewport","color","setUniforms","setBindings","uSampler","texture","draw","operation","MIN","MEAN","transformOptions","_sourceTextures","aggregationValues","_targetTexture","elementCount","width","height","update","getMeanTransform","attach","_updateModels","_setupFramebuffers","framebufferSize","resize","SUM","_getMinMaxTexture","name","getAggregationModel","instanceCount","getAllAggregationModel","_setupWeightAttributes","vertexCount","setVertexCount","setAttributes","setInstanceCount","result","Array","isArray","forEach","obj","shaders","vs","fs","modules","drawMode","shaderAssembler","topology","isInstanced","position","_targetTextureVarying"],"mappings":"AAqBA,SAAQA,KAAR,EAAeC,gBAAf,QAAsC,iBAAtC;AACA,SAAQC,cAAR,QAA6B,sBAA7B;AACA,SAAQC,kBAAR,EAA4BC,gBAA5B,EAA8CC,KAA9C,QAA0D,gBAA1D;AACA,SAAQC,EAAR,QAAiB,oBAAjB;AACA,SAAQC,GAAR,EAAaC,SAAb,EAAwBC,aAAa,IAAIC,YAAzC,EAAuDC,kBAAvD,QAAgF,eAAhF;AAEA,SACEC,kBADF,EAEEC,gBAFF,EAGEC,kBAHF,EAIEC,kBAJF,EAKEC,sBALF,EAMEC,YANF,EAOEC,qBAPF,EAQEC,UARF,QASO,iCATP;AAUA,SAAQC,qBAAR,QAAoC,gCAApC;AAEA,OAAOC,oBAAP,MAAiC,6BAAjC;AACA,OAAOC,oBAAP,MAAiC,6BAAjC;AACA,OAAOC,gBAAP,MAA6B,yBAA7B;AACA,OAAOC,gBAAP,MAA6B,yBAA7B;AACA,OAAOC,iBAAP,MAA8B,0BAA9B;AACA,SAAQC,eAAR,EAAyBC,cAAzB,QAA8C,qBAA9C;AAEA,MAAMC,YAAY,GAAG,CAAC,mBAAD,EAAsB,cAAtB,EAAsC,WAAtC,EAAmD,WAAnD,CAArB;AACA,MAAMC,gBAAgB,GAAG;AACvBC,EAAAA,OAAO,EAAE,WADc;AAEvBC,EAAAA,OAAO,EAAE,WAFc;AAGvBC,EAAAA,UAAU,EAAE;AAHW,CAAzB;AAMA,MAAMC,iBAAkC,GAAG,CACzC,QADyC,EAEzC,qBAFyC,EAGzC,kCAHyC,EAIzC,4BAJyC,EAKzC,gCALyC,CAA3C;AAYA,eAAe,MAAMC,iBAAN,CAAwB;AAEZ,SAAlBC,kBAAk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c.\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 type {Device, DeviceFeature} from '@luma.gl/core';\nimport {Model, TextureTransform} from '@luma.gl/engine';\nimport {fp64arithmetic} from '@luma.gl/shadertools';\nimport {readPixelsToBuffer, withGLParameters, clear} from '@luma.gl/webgl';\nimport {GL} from '@luma.gl/constants';\nimport {log, project32, _mergeShaders as mergeShaders, getShaderAssembler} from '@deck.gl/core';\n\nimport {\n DEFAULT_RUN_PARAMS,\n MAX_32_BIT_FLOAT,\n MIN_BLEND_EQUATION,\n MAX_BLEND_EQUATION,\n MAX_MIN_BLEND_EQUATION,\n EQUATION_MAP,\n DEFAULT_WEIGHT_PARAMS,\n PIXEL_SIZE\n} from './gpu-grid-aggregator-constants';\nimport {AGGREGATION_OPERATION} from '../aggregation-operation-utils';\n\nimport AGGREGATE_TO_GRID_VS from './aggregate-to-grid-vs.glsl';\nimport AGGREGATE_TO_GRID_FS from './aggregate-to-grid-fs.glsl';\nimport AGGREGATE_ALL_VS from './aggregate-all-vs.glsl';\nimport AGGREGATE_ALL_FS from './aggregate-all-fs.glsl';\nimport TRANSFORM_MEAN_VS from './transform-mean-vs.glsl';\nimport {getFloatTexture, getFramebuffer} from './../resource-utils';\n\nconst BUFFER_NAMES = ['aggregationBuffer', 'maxMinBuffer', 'minBuffer', 'maxBuffer'];\nconst ARRAY_BUFFER_MAP = {\n maxData: 'maxBuffer',\n minData: 'minBuffer',\n maxMinData: 'maxMinBuffer'\n};\n\nconst REQUIRED_FEATURES: DeviceFeature[] = [\n 'webgl2',\n 'blend-minmax-webgl1',\n 'texture-renderable-float32-webgl',\n 'texture-blend-float-webgl1',\n 'texture-formats-float32-webgl1'\n];\n\nexport type GPUGridAggregatorProps = {\n id?: string;\n};\n\nexport default class GPUGridAggregator {\n // Decode and return aggregation data of given pixel.\n static getAggregationData({\n aggregationData,\n maxData,\n minData,\n maxMinData,\n pixelIndex\n }: {\n aggregationData?: Float32Array;\n maxData?: Float32Array;\n minData?: Float32Array;\n maxMinData?: Float32Array;\n pixelIndex: number;\n }) {\n const index = pixelIndex * PIXEL_SIZE;\n const results: {cellCount?; cellWeight?; maxCellWieght?; minCellWeight?; totalCount?} = {};\n if (aggregationData) {\n results.cellCount = aggregationData[index + 3];\n results.cellWeight = aggregationData[index];\n }\n if (maxMinData) {\n results.maxCellWieght = maxMinData[0];\n results.minCellWeight = maxMinData[3];\n } else {\n if (maxData) {\n results.maxCellWieght = maxData[0];\n results.totalCount = maxData[3];\n }\n if (minData) {\n results.minCellWeight = minData[0];\n results.totalCount = minData[3];\n }\n }\n return results;\n }\n\n // Decodes and retuns counts and weights of all cells\n static getCellData({countsData, size = 1}) {\n const numCells = countsData.length / 4;\n const cellWeights = new Float32Array(numCells * size);\n const cellCounts = new Uint32Array(numCells);\n for (let i = 0; i < numCells; i++) {\n // weights in RGB channels\n for (let sizeIndex = 0; sizeIndex < size; sizeIndex++) {\n cellWeights[i * size + sizeIndex] = countsData[i * 4 + sizeIndex];\n }\n // count in Alpha channel\n cellCounts[i] = countsData[i * 4 + 3];\n }\n return {cellCounts, cellWeights};\n }\n\n static isSupported(device: Device) {\n return REQUIRED_FEATURES.every(feature => device.features.has(feature));\n }\n\n // DEBUG ONLY\n // static logData({aggregationBuffer, minBuffer, maxBuffer, maxMinBuffer, limit = 10}) {\n // if (aggregationBuffer) {\n // console.log('Aggregation Data:');\n // const agrData = aggregationBuffer.getData();\n // for (let index = 0; index < agrData.length && limit > 0; index += 4) {\n // if (agrData[index + 3] > 0) {\n // console.log(\n // `index: ${index} weights: ${agrData[index]} ${agrData[index + 1]} ${\n // agrData[index + 2]\n // } count: ${agrData[index + 3]}`\n // );\n // limit--;\n // }\n // }\n // }\n // const obj = {minBuffer, maxBuffer, maxMinBuffer};\n // for (const key in obj) {\n // if (obj[key]) {\n // const data = obj[key].getData();\n // console.log(`${key} data : R: ${data[0]} G: ${data[1]} B: ${data[2]} A: ${data[3]}`);\n // }\n // }\n // }\n\n state = {\n // per weight GPU resources\n weightAttributes: {},\n textures: {},\n meanTextures: {},\n buffers: {},\n framebuffers: {},\n maxMinFramebuffers: {},\n minFramebuffers: {},\n maxFramebuffers: {},\n equations: {},\n\n shaderOptions: {},\n modelDirty: false,\n\n // common resources to be deleted\n resources: {},\n\n // results\n results: {}\n };\n\n id: string;\n device: Device;\n _hasGPUSupport: boolean;\n\n gridAggregationModel;\n allAggregationModel;\n meanTransform;\n\n constructor(device: Device, props: GPUGridAggregatorProps = {}) {\n this.id = props.id || 'gpu-grid-aggregator';\n this.device = device;\n\n const REQUIRED_FEATURES: DeviceFeature[] = [\n 'blend-minmax-webgl1', // set min/max blend modes\n 'texture-renderable-float32-webgl', // render to float texture\n 'texture-formats-float32-webgl1' // sample from a float texture\n ];\n\n // gl_InstanceID usage in min/max calculation shaders\n this._hasGPUSupport =\n this.device.info.type === 'webgl2' &&\n REQUIRED_FEATURES.every(feature => device.features.has(feature));\n if (this._hasGPUSupport) {\n this._setupModels();\n }\n }\n\n // Delete owned resources.\n delete() {\n const {gridAggregationModel, allAggregationModel, meanTransform} = this;\n const {\n textures,\n framebuffers,\n maxMinFramebuffers,\n minFramebuffers,\n maxFramebuffers,\n meanTextures,\n resources\n } = this.state;\n\n gridAggregationModel?.destroy();\n allAggregationModel?.destroy();\n meanTransform?.destroy();\n\n deleteResources([\n framebuffers,\n textures,\n maxMinFramebuffers,\n minFramebuffers,\n maxFramebuffers,\n meanTextures,\n resources\n ]);\n }\n\n // Perform aggregation and retun the results\n run(opts = {}) {\n // reset results\n this.setState({results: {}});\n const aggregationParams = this._normalizeAggregationParams(opts);\n if (!this._hasGPUSupport) {\n log.log(1, 'GPUGridAggregator: not supported')();\n }\n return this._runAggregation(aggregationParams);\n }\n\n // Reads aggregation data into JS Array object\n // For WebGL1, data is available in JS Array objects already.\n // For WebGL2, data is read from Buffer objects and cached for subsequent queries.\n getData(weightId) {\n const data: {\n aggregationData?: Float32Array;\n maxData?: Float32Array;\n minData?: Float32Array;\n maxMinData?: Float32Array;\n } = {};\n const results = this.state.results;\n if (!results[weightId].aggregationData) {\n // cache the results if reading from the buffer (WebGL2 path)\n results[weightId].aggregationData = results[weightId].aggregationBuffer.getData();\n }\n data.aggregationData = results[weightId].aggregationData;\n\n // Check for optional results\n for (const arrayName in ARRAY_BUFFER_MAP) {\n const bufferName = ARRAY_BUFFER_MAP[arrayName];\n\n if (results[weightId][arrayName] || results[weightId][bufferName]) {\n // cache the result\n results[weightId][arrayName] =\n results[weightId][arrayName] || results[weightId][bufferName].getData();\n data[arrayName] = results[weightId][arrayName];\n }\n }\n return data;\n }\n\n updateShaders(shaderOptions = {}) {\n this.setState({shaderOptions, modelDirty: true});\n }\n\n // PRIVATE\n\n _normalizeAggregationParams(opts) {\n const aggregationParams = {...DEFAULT_RUN_PARAMS, ...opts};\n const {weights} = aggregationParams;\n if (weights) {\n aggregationParams.weights = normalizeWeightParams(weights);\n }\n return aggregationParams;\n }\n\n // Update priveate state\n setState(updateObject) {\n Object.assign(this.state, updateObject);\n }\n\n // GPU Aggregation methods\n\n _getAggregateData(opts) {\n const results = {};\n const {\n textures,\n framebuffers,\n maxMinFramebuffers,\n minFramebuffers,\n maxFramebuffers,\n resources\n } = this.state;\n const {weights} = opts;\n\n for (const id in weights) {\n results[id] = {};\n const {needMin, needMax, combineMaxMin} = weights[id];\n results[id].aggregationTexture = textures[id];\n results[id].aggregationBuffer = readPixelsToBuffer(framebuffers[id], {\n target: weights[id].aggregationBuffer, // update if a buffer is provided\n sourceType: GL.FLOAT\n });\n if (needMin && needMax && combineMaxMin) {\n results[id].maxMinBuffer = readPixelsToBuffer(maxMinFramebuffers[id], {\n target: weights[id].maxMinBuffer, // update if a buffer is provided\n sourceType: GL.FLOAT\n });\n results[id].maxMinTexture = resources[`${id}-maxMinTexture`];\n } else {\n if (needMin) {\n results[id].minBuffer = readPixelsToBuffer(minFramebuffers[id], {\n target: weights[id].minBuffer, // update if a buffer is provided\n sourceType: GL.FLOAT\n });\n results[id].minTexture = resources[`${id}-minTexture`];\n }\n if (needMax) {\n results[id].maxBuffer = readPixelsToBuffer(maxFramebuffers[id], {\n target: weights[id].maxBuffer, // update if a buffer is provided\n sourceType: GL.FLOAT\n });\n results[id].maxTexture = resources[`${id}-maxTexture`];\n }\n }\n }\n this._trackGPUResultBuffers(results, weights);\n return results;\n }\n\n _renderAggregateData(opts) {\n const {\n cellSize,\n projectPoints,\n attributes,\n moduleSettings,\n numCol,\n numRow,\n weights,\n translation,\n scaling\n } = opts;\n const {maxMinFramebuffers, minFramebuffers, maxFramebuffers} = this.state;\n\n const gridSize = [numCol, numRow];\n const parameters = {\n blend: true,\n depthTest: false,\n blendFunc: [GL.ONE, GL.ONE]\n };\n const uniforms = {\n cellSize,\n gridSize,\n projectPoints,\n translation,\n scaling\n };\n\n for (const id in weights) {\n const {needMin, needMax} = weights[id];\n const combineMaxMin = needMin && needMax && weights[id].combineMaxMin;\n this._renderToWeightsTexture({\n id,\n parameters,\n moduleSettings,\n uniforms,\n gridSize,\n attributes,\n weights\n });\n if (combineMaxMin) {\n this._renderToMaxMinTexture({\n id,\n parameters: {...parameters, blendEquation: MAX_MIN_BLEND_EQUATION},\n gridSize,\n minOrMaxFb: maxMinFramebuffers[id],\n clearParams: {clearColor: [0, 0, 0, MAX_32_BIT_FLOAT]},\n combineMaxMin\n });\n } else {\n if (needMin) {\n this._renderToMaxMinTexture({\n id,\n parameters: {...parameters, blendEquation: MIN_BLEND_EQUATION},\n gridSize,\n minOrMaxFb: minFramebuffers[id],\n clearParams: {clearColor: [MAX_32_BIT_FLOAT, MAX_32_BIT_FLOAT, MAX_32_BIT_FLOAT, 0]},\n combineMaxMin\n });\n }\n if (needMax) {\n this._renderToMaxMinTexture({\n id,\n parameters: {...parameters, blendEquation: MAX_BLEND_EQUATION},\n gridSize,\n minOrMaxFb: maxFramebuffers[id],\n clearParams: {clearColor: [0, 0, 0, 0]},\n combineMaxMin\n });\n }\n }\n }\n }\n\n // render all aggregated grid-cells to generate Min, Max or MaxMin data texture\n _renderToMaxMinTexture(opts) {\n const {id, parameters, gridSize, minOrMaxFb, combineMaxMin, clearParams = {}} = opts;\n const {framebuffers} = this.state;\n const {allAggregationModel} = this;\n\n withGLParameters(\n this.device,\n {\n ...clearParams,\n framebuffer: minOrMaxFb,\n viewport: [0, 0, gridSize[0], gridSize[1]]\n },\n () => {\n clear(this.device, {color: true});\n\n // allAggregationModel.setParameters(parameters);\n allAggregationModel.setUniforms({gridSize, combineMaxMin});\n allAggregationModel.setBindings({uSampler: framebuffers[id].texture});\n allAggregationModel.draw();\n // TODO - we need to create a render pass for the aggregation\n // allAggregationModel.draw(renderPass);\n }\n );\n }\n\n // render all data points to aggregate weights\n _renderToWeightsTexture(opts) {\n const {id, parameters, moduleSettings, uniforms, gridSize, weights} = opts;\n const {framebuffers, equations, weightAttributes} = this.state;\n const {gridAggregationModel} = this;\n const {operation} = weights[id];\n\n const clearColor =\n operation === AGGREGATION_OPERATION.MIN\n ? [MAX_32_BIT_FLOAT, MAX_32_BIT_FLOAT, MAX_32_BIT_FLOAT, 0]\n : [0, 0, 0, 0];\n withGLParameters(\n this.device,\n {\n framebuffer: framebuffers[id],\n viewport: [0, 0, gridSize[0], gridSize[1]],\n clearColor\n },\n () => {\n clear(this.device, {color: true});\n\n const attributes = {weights: weightAttributes[id]};\n gridAggregationModel.draw({\n parameters: {...parameters, blendEquation: equations[id]},\n moduleSettings,\n uniforms,\n attributes\n });\n }\n );\n\n if (operation === AGGREGATION_OPERATION.MEAN) {\n const {meanTextures, textures} = this.state;\n const transformOptions = {\n _sourceTextures: {aggregationValues: meanTextures[id]}, // contains aggregated data\n _targetTexture: textures[id], // store mean values,\n elementCount: textures[id].width * textures[id].height\n };\n if (this.meanTransform) {\n this.meanTransform.update(transformOptions);\n } else {\n this.meanTransform = getMeanTransform(this.device, transformOptions);\n }\n this.meanTransform.run({\n parameters: {\n blend: false,\n depthTest: false\n }\n });\n\n // update framebuffer with mean results so readPixelsToBuffer returns mean values\n framebuffers[id].attach({[GL.COLOR_ATTACHMENT0]: textures[id]});\n }\n }\n\n _runAggregation(opts) {\n this._updateModels(opts);\n this._setupFramebuffers(opts);\n this._renderAggregateData(opts);\n const results = this._getAggregateData(opts);\n this.setState({results});\n return results;\n }\n\n // set up framebuffer for each weight\n /* eslint-disable complexity, max-depth, max-statements*/\n _setupFramebuffers(opts) {\n const {\n textures,\n framebuffers,\n maxMinFramebuffers,\n minFramebuffers,\n maxFramebuffers,\n meanTextures,\n equations\n } = this.state;\n const {weights} = opts;\n const {numCol, numRow} = opts;\n const framebufferSize = {width: numCol, height: numRow};\n for (const id in weights) {\n const {needMin, needMax, combineMaxMin, operation} = weights[id];\n textures[id] =\n weights[id].aggregationTexture ||\n textures[id] ||\n getFloatTexture(this.device, {id: `${id}-texture`, width: numCol, height: numRow});\n textures[id].resize(framebufferSize);\n let texture = textures[id];\n if (operation === AGGREGATION_OPERATION.MEAN) {\n // For MEAN, we first aggregatet into a temp texture\n meanTextures[id] =\n meanTextures[id] ||\n getFloatTexture(this.device, {id: `${id}-mean-texture`, width: numCol, height: numRow});\n meanTextures[id].resize(framebufferSize);\n texture = meanTextures[id];\n }\n if (framebuffers[id]) {\n framebuffers[id].attach({[GL.COLOR_ATTACHMENT0]: texture});\n } else {\n framebuffers[id] = getFramebuffer(this.device, {\n id: `${id}-fb`,\n width: numCol,\n height: numRow,\n texture\n });\n }\n framebuffers[id].resize(framebufferSize);\n equations[id] = EQUATION_MAP[operation] || EQUATION_MAP[AGGREGATION_OPERATION.SUM];\n // For min/max framebuffers will use default size 1X1\n if (needMin || needMax) {\n if (needMin && needMax && combineMaxMin) {\n if (!maxMinFramebuffers[id]) {\n texture = weights[id].maxMinTexture || this._getMinMaxTexture(`${id}-maxMinTexture`);\n maxMinFramebuffers[id] = getFramebuffer(this.device, {id: `${id}-maxMinFb`, texture});\n }\n } else {\n if (needMin) {\n if (!minFramebuffers[id]) {\n texture = weights[id].minTexture || this._getMinMaxTexture(`${id}-minTexture`);\n minFramebuffers[id] = getFramebuffer(this.device, {\n id: `${id}-minFb`,\n texture\n });\n }\n }\n if (needMax) {\n if (!maxFramebuffers[id]) {\n texture = weights[id].maxTexture || this._getMinMaxTexture(`${id}-maxTexture`);\n maxFramebuffers[id] = getFramebuffer(this.device, {\n id: `${id}-maxFb`,\n texture\n });\n }\n }\n }\n }\n }\n }\n /* eslint-enable complexity, max-depth, max-statements */\n\n _getMinMaxTexture(name) {\n const {resources} = this.state;\n if (!resources[name]) {\n resources[name] = getFloatTexture(this.device, {id: 'resourceName'});\n }\n return resources[name];\n }\n\n _setupModels({numCol = 0, numRow = 0} = {}) {\n const {shaderOptions} = this.state;\n this.gridAggregationModel?.destroy();\n this.gridAggregationModel = getAggregationModel(this.device, shaderOptions);\n if (!this.allAggregationModel) {\n const instanceCount = numCol * numRow;\n this.allAggregationModel = getAllAggregationModel(this.device, instanceCount);\n }\n }\n\n // set up buffers for all weights\n _setupWeightAttributes(opts) {\n const {weightAttributes} = this.state;\n const {weights} = opts;\n for (const id in weights) {\n weightAttributes[id] = opts.attributes[id];\n }\n }\n\n /** GPU Aggregation results are provided in Buffers, if new Buffer objects are created track them for later deletion. */\n /* eslint-disable max-depth */\n _trackGPUResultBuffers(results, weights) {\n const {resources} = this.state;\n for (const id in results) {\n if (results[id]) {\n for (const bufferName of BUFFER_NAMES) {\n if (results[id][bufferName] && weights[id][bufferName] !== results[id][bufferName]) {\n // No result buffer is provided in weights object, `readPixelsToBuffer` has created a new Buffer object\n // collect the new buffer for garabge collection\n const name = `gpu-result-${id}-${bufferName}`;\n if (resources[name]) {\n resources[name].delete();\n }\n resources[name] = results[id][bufferName];\n }\n }\n }\n }\n }\n /* eslint-enable max-depth */\n\n _updateModels(opts) {\n const {vertexCount, attributes, numCol, numRow} = opts;\n const {modelDirty} = this.state;\n\n if (modelDirty) {\n this._setupModels(opts);\n this.setState({modelDirty: false});\n }\n\n // this maps color/elevation to weight name.\n this._setupWeightAttributes(opts);\n\n this.gridAggregationModel.setVertexCount(vertexCount);\n this.gridAggregationModel.setAttributes(attributes);\n\n this.allAggregationModel.setInstanceCount(numCol * numRow);\n }\n}\n\n// HELPER METHODS\n\nfunction normalizeWeightParams(weights) {\n const result = {};\n for (const id in weights) {\n result[id] = {...DEFAULT_WEIGHT_PARAMS, ...weights[id]};\n }\n return result;\n}\n\nfunction deleteResources(resources) {\n resources = Array.isArray(resources) ? resources : [resources];\n resources.forEach(obj => {\n for (const name in obj) {\n obj[name].delete();\n }\n });\n}\n\nfunction getAggregationModel(device: Device, shaderOptions) {\n const shaders = mergeShaders(\n {\n vs: AGGREGATE_TO_GRID_VS,\n fs: AGGREGATE_TO_GRID_FS,\n modules: [fp64arithmetic, project32]\n },\n shaderOptions\n );\n\n return new Model(device, {\n id: 'Grid-Aggregation-Model',\n vertexCount: 1,\n drawMode: GL.POINTS,\n shaderAssembler: getShaderAssembler(),\n ...shaders\n });\n}\n\nfunction getAllAggregationModel(device: Device, instanceCount: number): Model {\n return new Model(device, {\n id: 'All-Aggregation-Model',\n vs: AGGREGATE_ALL_VS,\n fs: AGGREGATE_ALL_FS,\n modules: [fp64arithmetic],\n vertexCount: 1,\n topology: 'point-list',\n isInstanced: true,\n instanceCount,\n attributes: {\n // @ts-expect-error\n position: [0, 0]\n }\n });\n}\n\nfunction getMeanTransform(device: Device, opts) {\n return new TextureTransform(device, {\n vs: TRANSFORM_MEAN_VS,\n _targetTextureVarying: 'meanValues',\n ...opts\n });\n}\n"],"file":"gpu-grid-aggregator.js"}
|
|
@@ -1,155 +0,0 @@
|
|
|
1
|
-
# GPUGridAggregator Class (Advanced) (WebGL2)
|
|
2
|
-
|
|
3
|
-
`GPUGridAggregator` performs grid aggregation on GPU. Aggregation can be performed either in world space or in screen space.
|
|
4
|
-
|
|
5
|
-
# Usage (Aggregation in World space)
|
|
6
|
-
```
|
|
7
|
-
const aggregator = new GPUGridAggregator(device);
|
|
8
|
-
|
|
9
|
-
const results = aggregator.run({
|
|
10
|
-
attributes, // position and weight attributes
|
|
11
|
-
weights: {
|
|
12
|
-
weight1: {
|
|
13
|
-
operation: AGGREGATION_OPERATION.MEAN,
|
|
14
|
-
needMax: true,
|
|
15
|
-
}
|
|
16
|
-
},
|
|
17
|
-
cellSize: [50, 50],
|
|
18
|
-
width: 500,
|
|
19
|
-
height: 500
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
// results.weight1.aggregationBuffer contains, one aggregated value for each grid cell, which is equal to mean weight of all sample points that fall into that grid cell.
|
|
23
|
-
// results.weight1.maxBuffer contains max mean value of all grid cells.
|
|
24
|
-
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
# Usage (Aggregation in Screen space)
|
|
28
|
-
|
|
29
|
-
You can also perform aggregation in screen space by provide a viewport and set `projectPoints` to true. Aggregator will first project positions and then aggregate them in screen space.
|
|
30
|
-
|
|
31
|
-
```
|
|
32
|
-
const aggregator = new GPUGridAggregator(device);
|
|
33
|
-
|
|
34
|
-
const results = aggregator.run({
|
|
35
|
-
attributes, // position and weight attributes
|
|
36
|
-
weights: {
|
|
37
|
-
weight1: {
|
|
38
|
-
operation: AGGREGATION_OPERATION.MEAN,
|
|
39
|
-
needMax: true,
|
|
40
|
-
}
|
|
41
|
-
},
|
|
42
|
-
cellSize: [50, 50],
|
|
43
|
-
width: 500,
|
|
44
|
-
height: 500,
|
|
45
|
-
viewport,
|
|
46
|
-
projectPoints: true
|
|
47
|
-
});
|
|
48
|
-
|
|
49
|
-
// results.weight1.aggregationBuffer contains, one aggregated value for each grid cell, which is equal to mean weight of all sample points that fall into that grid cell.
|
|
50
|
-
// results.weight1.maxBuffer contains max mean value of all grid cells.
|
|
51
|
-
|
|
52
|
-
```
|
|
53
|
-
|
|
54
|
-
## Methods
|
|
55
|
-
|
|
56
|
-
### constructor
|
|
57
|
-
|
|
58
|
-
‘ScreenGridAggregator’ constructor takes following arguments and constructs an object.
|
|
59
|
-
|
|
60
|
-
* device (WebGLContext) : used for querying WebGL features and creating required webgl resources.
|
|
61
|
-
* opts (Object) : Optionally contains and ‘id’ and ‘sahderCache’ object for caching/re-using shaders.
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
### run
|
|
65
|
-
|
|
66
|
-
Performs aggregation either on CPU or GPU based on the provided options and browser’s WebGL capabilities.
|
|
67
|
-
|
|
68
|
-
```js
|
|
69
|
-
const results = gpuGridAggregator.run({
|
|
70
|
-
positions,
|
|
71
|
-
weights,
|
|
72
|
-
cellSize: [5, 5],
|
|
73
|
-
viewport,
|
|
74
|
-
changeFlags,
|
|
75
|
-
projectPoints: true,
|
|
76
|
-
translation,
|
|
77
|
-
scaling
|
|
78
|
-
});
|
|
79
|
-
```
|
|
80
|
-
|
|
81
|
-
Parameters:
|
|
82
|
-
* positions (Array) : Array of points in world space (lng, lat).
|
|
83
|
-
* weights (Object) : Object contains one or more weights. Key represents id and corresponding object represents the weight. Each weight object contains following values:
|
|
84
|
-
|
|
85
|
-
* `values` (Array, Float32Array or Buffer) : Contains weight values for all points, there should be 3 floats for each point, un-used values can be 0.
|
|
86
|
-
* `size` (Number, default: 1, minValue: 1, maxValue: 3) : Size of a single weight instance. Determines how many distinct weights exist in the array.
|
|
87
|
-
* `operation` (Enum {SUM, MEAN, MIN or MAX}, default: SUM) : Defines aggregation operation.
|
|
88
|
-
* `needMin` (Boolean, default: false) : when true additional aggregation steps are performed to calculate minimum of all aggregation values and total count, result object will contain minBuffer.
|
|
89
|
-
* `needMax` (Boolean, default: false) : when true additional aggregation steps are performed to calculate maximum of all aggregation values and total count, result object will contain maxBuffer.
|
|
90
|
-
* `combineMaxMin` (Boolean, default: false) : Applicable only when `needMin` and `needMax` are set. When true, both min and max values are calculated in single aggregation step using `blendEquationSeparate` WebGL API. But since Alpha channel can only contain one float, it will only provide minimum value for first weight in Alpha channel and RGB channels store maximum value up to 3 weights. Also when selected total count is not available. Result object will contain maxMinBuffer.
|
|
91
|
-
|
|
92
|
-
* cellSize: (Array) : Size of the cell, cellSize[0] is width and cellSize[1] is height.
|
|
93
|
-
* width: (Number, Optional) : Grid width in pixels, deduced from ‘viewport’ when not provided.
|
|
94
|
-
* height: (Number, Optional) : Grid height in pixels, deduced from ‘viewport’ when not provided.
|
|
95
|
-
* viewport: (Object, Viewport) : Contains size of viewport and also used to perform projection.
|
|
96
|
-
* changeFlags: (Object, Optional) : Object with following keyed values, that determine whether to re-create internal WebGL resources for performing aggregation compared to last run. If no value is provided, all flags are treated to be true.
|
|
97
|
-
* dataChanged (Bool) : should be set to true when data is changed.
|
|
98
|
-
* viewportChanged (Bool) : should be set to true when viewport is changed.
|
|
99
|
-
* cellSizeChagned (Bool) : should be set to true when cellSize is changed.
|
|
100
|
-
* countsBuffer: (Buffer, optional) : used to update aggregation data per grid, details in Output section.
|
|
101
|
-
* maxCountBuffer: (Buffer, optional) : used to update total aggregation data, details in Output section.
|
|
102
|
-
* projectPoints (Bool) : when true performs aggregation in screen space.
|
|
103
|
-
* translation (Array) : [xOffset, yOffset], used to translate input positions before aggregating them (for example, lng/lat can be moved to +ve range).
|
|
104
|
-
* scaling (Array) : [xScale, yScale, isScalingValid] : `xScale`, `yScale` define scaling to be applied before aggregating. Scaling is applied only when `isScalingValie` is > 0.
|
|
105
|
-
* createBufferObjects (Bool, options, default: true) : Only applicable when aggregation is performed on CPU. When set to false, aggregated data is not uploaded into Buffer objects. In a typical use case, Applications need data in `Buffer` objects to use them in next rendering cycle, hence by default its value is true, but if needed this step can be avoided by setting this flag to false.
|
|
106
|
-
|
|
107
|
-
NOTE: When doing screen space aggregation, i.e projectPoints is true, `translation` and `scaling` should be set to transformation required for camera space (NDC) to screen (pixel) space.
|
|
108
|
-
|
|
109
|
-
Returns:
|
|
110
|
-
* An object, where key represents `id` of the weight and value contains following aggregated data.
|
|
111
|
-
|
|
112
|
-
* `aggregationBuffer` (Buffer) : Aggregated values per grid cell, aggregation is performed as per specified `operation`. Size of the buffer is 4, with R, G and B channel corresponds to aggregated weights. When input `size` is < 3, G or B channels contain undefined values. Alpha channel contains count of points aggregated into this cell. (R: weight#1 G: weight#2 B: weight#3 A: count)
|
|
113
|
-
|
|
114
|
-
* `aggregationTexture` (Texture) : When aggregation is performed on GPU, contains above data as form of texture, useful for applications that want to consume the texture instead of buffer. This value is `null` when aggregation is performed on CPU.
|
|
115
|
-
|
|
116
|
-
* `minBuffer` (Buffer, optional) : Contains data for one pixel with R, G, B and A channels contain min value of all aggregated grid cells. When aggregation is performed on CPU, `minBuffer` is `null` but `minData` Array is returned with same data. This value is `null` when `needMin` is false. (R: weight#1 min value G: weight#2 min value B: weight#3 min value A: total count)
|
|
117
|
-
|
|
118
|
-
* `minTexture` (Texture2D, optional) : Texture2D object (1X1 size with RGBA_FLOAT_32 format) contains same data as `minBuffer`.
|
|
119
|
-
|
|
120
|
-
* `maxBuffer` (Buffer, optional) : Contains data for one pixel with R, G, B and A channels contain max value of all aggregated grid cells. When aggregation is performed on CPU, `maxBuffer` is `null` but `maxData` Array is returned with same data. This value is `null` when `needMax` is false. (R: weight#1 max value G: weight#2 max value B: weight#3 max value A: total count)
|
|
121
|
-
|
|
122
|
-
* `maxTexture` (Texture2D, optional) : Texture2D object (1X1 size with RGBA_FLOAT_32 format) contains same data as `maxBuffer`.
|
|
123
|
-
|
|
124
|
-
* `maxMinBuffer` (Buffer, optional) : Contains data for one pixel, with RGB channels contains max value of all aggregated grid cells and A channel contains minimum value of all aggregated grid cells. When `combineMaxMin` is `false` this value will be `null`. (R: weight#1 max value G: weight#2 max value B: weight#3 max value A: weight#1 min value)
|
|
125
|
-
|
|
126
|
-
* `maxMinTexture` (Texture2D, optional) : Texture2D object (1X1 size with RGBA_FLOAT_32 format) contains same data as `maxMinBuffer`.
|
|
127
|
-
|
|
128
|
-
NOTES:
|
|
129
|
-
* `minBuffer`, `maxBuffer` and `maxMinBuffer` are usually consumed by setting them as uniform buffer object or read by the CPU.
|
|
130
|
-
* Aggregation data per cell, is always in `Buffer` objects to provide common API irrespective of whether aggregation is performed on CPU or GPU.
|
|
131
|
-
* Min-max aggregation results is provided in form of `Texture2D` and `Buffer` objects whether aggregation is performed on CPU or GPU.
|
|
132
|
-
* When aggregation is performed on CPU, min-max aggregation results are also provided in form of Float32Arrays.
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
### getData
|
|
136
|
-
|
|
137
|
-
Reads aggregation results from GPU memory (Buffer) to CPU memory (Typed Arrays).
|
|
138
|
-
|
|
139
|
-
```js
|
|
140
|
-
const aggregationResults = gpuGridAggregator.getData('weightId');
|
|
141
|
-
```
|
|
142
|
-
|
|
143
|
-
Parameters:
|
|
144
|
-
* `weightId` (String) : `id` of the weight for which aggregation data is needed.
|
|
145
|
-
|
|
146
|
-
Returns:
|
|
147
|
-
An object with aggregation results in CPU memory (Typed Arrays). Returned object contains following values :
|
|
148
|
-
* `aggregationData` : Aggregated data per grid cell.
|
|
149
|
-
Following additional arrays exist if they were requested when aggregation is performed.
|
|
150
|
-
* `minData` : Min aggregation results.
|
|
151
|
-
* `maxData` : Max aggregation results.
|
|
152
|
-
* `maxMinData` : Combined max min aggregation results.
|
|
153
|
-
|
|
154
|
-
Note:
|
|
155
|
-
When aggregation is performed on GPU, `getData` performs Buffer read and can potentially an expensive operation due to CPU and GPU sync, in such cases data is also cached to avoid reading from GPU memory for subsequent calls.
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
export default `\
|
|
2
|
-
#version 300 es
|
|
3
|
-
#define SHADER_NAME gpu-aggregation-transform-mean-vs
|
|
4
|
-
in vec4 aggregationValues;
|
|
5
|
-
out vec4 meanValues;
|
|
6
|
-
|
|
7
|
-
void main()
|
|
8
|
-
{
|
|
9
|
-
// TODO: Use 64-bit division ?? not needed given this is aggregation ??
|
|
10
|
-
bool isCellValid = bool(aggregationValues.w > 0.);
|
|
11
|
-
// aggregationValues: XYZ contain aggregated values, W contains count
|
|
12
|
-
meanValues.xyz = isCellValid ? aggregationValues.xyz/aggregationValues.w : vec3(0, 0, 0);
|
|
13
|
-
meanValues.w = aggregationValues.w;
|
|
14
|
-
|
|
15
|
-
// Enforce default value for ANGLE issue (https://bugs.chromium.org/p/angleproject/issues/detail?id=3941)
|
|
16
|
-
gl_PointSize = 1.0;
|
|
17
|
-
}
|
|
18
|
-
`;
|
|
19
|
-
//# sourceMappingURL=transform-mean-vs.glsl.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/utils/gpu-grid-aggregation/transform-mean-vs.glsl.ts"],"names":[],"mappings":"AAoBA,eAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAjBA","sourcesContent":["// Copyright (c) 2015 - 2018 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\nexport default `\\\n#version 300 es\n#define SHADER_NAME gpu-aggregation-transform-mean-vs\nin vec4 aggregationValues;\nout vec4 meanValues;\n\nvoid main()\n{\n // TODO: Use 64-bit division ?? not needed given this is aggregation ??\n bool isCellValid = bool(aggregationValues.w > 0.);\n // aggregationValues: XYZ contain aggregated values, W contains count\n meanValues.xyz = isCellValid ? aggregationValues.xyz/aggregationValues.w : vec3(0, 0, 0);\n meanValues.w = aggregationValues.w;\n\n // Enforce default value for ANGLE issue (https://bugs.chromium.org/p/angleproject/issues/detail?id=3941)\n gl_PointSize = 1.0;\n}\n`;\n"],"file":"transform-mean-vs.glsl.js"}
|
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
import { log, COORDINATE_SYSTEM } from '@deck.gl/core';
|
|
2
|
-
const R_EARTH = 6378000;
|
|
3
|
-
|
|
4
|
-
function toFinite(n) {
|
|
5
|
-
return Number.isFinite(n) ? n : 0;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
export function getBoundingBox(attributes, vertexCount) {
|
|
9
|
-
const positions = attributes.positions.value;
|
|
10
|
-
let yMin = Infinity;
|
|
11
|
-
let yMax = -Infinity;
|
|
12
|
-
let xMin = Infinity;
|
|
13
|
-
let xMax = -Infinity;
|
|
14
|
-
let y;
|
|
15
|
-
let x;
|
|
16
|
-
|
|
17
|
-
for (let i = 0; i < vertexCount; i++) {
|
|
18
|
-
x = positions[i * 3];
|
|
19
|
-
y = positions[i * 3 + 1];
|
|
20
|
-
yMin = y < yMin ? y : yMin;
|
|
21
|
-
yMax = y > yMax ? y : yMax;
|
|
22
|
-
xMin = x < xMin ? x : xMin;
|
|
23
|
-
xMax = x > xMax ? x : xMax;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
const boundingBox = {
|
|
27
|
-
xMin: toFinite(xMin),
|
|
28
|
-
xMax: toFinite(xMax),
|
|
29
|
-
yMin: toFinite(yMin),
|
|
30
|
-
yMax: toFinite(yMax)
|
|
31
|
-
};
|
|
32
|
-
return boundingBox;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
function getTranslation(boundingBox, gridOffset, coordinateSystem, viewport) {
|
|
36
|
-
const {
|
|
37
|
-
width,
|
|
38
|
-
height
|
|
39
|
-
} = viewport;
|
|
40
|
-
const worldOrigin = coordinateSystem === COORDINATE_SYSTEM.CARTESIAN ? [-width / 2, -height / 2] : [-180, -90];
|
|
41
|
-
log.assert(coordinateSystem === COORDINATE_SYSTEM.CARTESIAN || coordinateSystem === COORDINATE_SYSTEM.LNGLAT || coordinateSystem === COORDINATE_SYSTEM.DEFAULT);
|
|
42
|
-
const {
|
|
43
|
-
xMin,
|
|
44
|
-
yMin
|
|
45
|
-
} = boundingBox;
|
|
46
|
-
return [-1 * (alignToCell(xMin - worldOrigin[0], gridOffset.xOffset) + worldOrigin[0]), -1 * (alignToCell(yMin - worldOrigin[1], gridOffset.yOffset) + worldOrigin[1])];
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
export function alignToCell(inValue, cellSize) {
|
|
50
|
-
const sign = inValue < 0 ? -1 : 1;
|
|
51
|
-
let value = sign < 0 ? Math.abs(inValue) + cellSize : Math.abs(inValue);
|
|
52
|
-
value = Math.floor(value / cellSize) * cellSize;
|
|
53
|
-
return value * sign;
|
|
54
|
-
}
|
|
55
|
-
export function getGridOffset(boundingBox, cellSize, convertToMeters = true) {
|
|
56
|
-
if (!convertToMeters) {
|
|
57
|
-
return {
|
|
58
|
-
xOffset: cellSize,
|
|
59
|
-
yOffset: cellSize
|
|
60
|
-
};
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
const {
|
|
64
|
-
yMin,
|
|
65
|
-
yMax
|
|
66
|
-
} = boundingBox;
|
|
67
|
-
const centerLat = (yMin + yMax) / 2;
|
|
68
|
-
return calculateGridLatLonOffset(cellSize, centerLat);
|
|
69
|
-
}
|
|
70
|
-
export function getGridParams(boundingBox, cellSize, viewport, coordinateSystem) {
|
|
71
|
-
const gridOffset = getGridOffset(boundingBox, cellSize, coordinateSystem !== COORDINATE_SYSTEM.CARTESIAN);
|
|
72
|
-
const translation = getTranslation(boundingBox, gridOffset, coordinateSystem, viewport);
|
|
73
|
-
const {
|
|
74
|
-
xMin,
|
|
75
|
-
yMin,
|
|
76
|
-
xMax,
|
|
77
|
-
yMax
|
|
78
|
-
} = boundingBox;
|
|
79
|
-
const width = xMax - xMin + gridOffset.xOffset;
|
|
80
|
-
const height = yMax - yMin + gridOffset.yOffset;
|
|
81
|
-
const numCol = Math.ceil(width / gridOffset.xOffset);
|
|
82
|
-
const numRow = Math.ceil(height / gridOffset.yOffset);
|
|
83
|
-
return {
|
|
84
|
-
gridOffset,
|
|
85
|
-
translation,
|
|
86
|
-
width,
|
|
87
|
-
height,
|
|
88
|
-
numCol,
|
|
89
|
-
numRow
|
|
90
|
-
};
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
function calculateGridLatLonOffset(cellSize, latitude) {
|
|
94
|
-
const yOffset = calculateLatOffset(cellSize);
|
|
95
|
-
const xOffset = calculateLonOffset(latitude, cellSize);
|
|
96
|
-
return {
|
|
97
|
-
yOffset,
|
|
98
|
-
xOffset
|
|
99
|
-
};
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
function calculateLatOffset(dy) {
|
|
103
|
-
return dy / R_EARTH * (180 / Math.PI);
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
function calculateLonOffset(lat, dx) {
|
|
107
|
-
return dx / R_EARTH * (180 / Math.PI) / Math.cos(lat * Math.PI / 180);
|
|
108
|
-
}
|
|
109
|
-
//# sourceMappingURL=grid-aggregation-utils.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/utils/grid-aggregation-utils.ts"],"names":["log","COORDINATE_SYSTEM","R_EARTH","toFinite","n","Number","isFinite","getBoundingBox","attributes","vertexCount","positions","value","yMin","Infinity","yMax","xMin","xMax","y","x","i","boundingBox","getTranslation","gridOffset","coordinateSystem","viewport","width","height","worldOrigin","CARTESIAN","assert","LNGLAT","DEFAULT","alignToCell","xOffset","yOffset","inValue","cellSize","sign","Math","abs","floor","getGridOffset","convertToMeters","centerLat","calculateGridLatLonOffset","getGridParams","translation","numCol","ceil","numRow","latitude","calculateLatOffset","calculateLonOffset","dy","PI","lat","dx","cos"],"mappings":"AAAA,SAAQA,GAAR,EAAaC,iBAAb,QAAqC,eAArC;AACA,MAAMC,OAAO,GAAG,OAAhB;;AAEA,SAASC,QAAT,CAAkBC,CAAlB,EAAqB;AACnB,SAAOC,MAAM,CAACC,QAAP,CAAgBF,CAAhB,IAAqBA,CAArB,GAAyB,CAAhC;AACD;;AAID,OAAO,SAASG,cAAT,CAAwBC,UAAxB,EAAoCC,WAApC,EAAiD;AAEtD,QAAMC,SAAS,GAAGF,UAAU,CAACE,SAAX,CAAqBC,KAAvC;AAEA,MAAIC,IAAI,GAAGC,QAAX;AACA,MAAIC,IAAI,GAAG,CAACD,QAAZ;AACA,MAAIE,IAAI,GAAGF,QAAX;AACA,MAAIG,IAAI,GAAG,CAACH,QAAZ;AACA,MAAII,CAAJ;AACA,MAAIC,CAAJ;;AAEA,OAAK,IAAIC,CAAC,GAAG,CAAb,EAAgBA,CAAC,GAAGV,WAApB,EAAiCU,CAAC,EAAlC,EAAsC;AACpCD,IAAAA,CAAC,GAA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AAI,CAACgB,EAA7B,CAAP;AACD;;AAUD,SAASF,kBAAT,CAA4BG,GAA5B,EAAiCC,EAAjC,EAAqC;AACnC,SAASA,EAAE,GAAGtD,OAAN,IAAkB,MAAMoC,IAAI,CAACgB,EAA7B,CAAD,GAAqChB,IAAI,CAACmB,GAAL,CAAUF,GAAG,GAAGjB,IAAI,CAACgB,EAAZ,GAAkB,GAA3B,CAA5C;AACD","sourcesContent":["import {log, COORDINATE_SYSTEM} from '@deck.gl/core';\nconst R_EARTH = 6378000;\n\nfunction toFinite(n) {\n return Number.isFinite(n) ? n : 0;\n}\n\n// Parse input data to build positions, wights and bounding box.\n/* eslint-disable-next-line max-statements */\nexport function getBoundingBox(attributes, vertexCount) {\n // TODO - value might not exist (e.g. attribute transition)\n const positions = attributes.positions.value;\n\n let yMin = Infinity;\n let yMax = -Infinity;\n let xMin = Infinity;\n let xMax = -Infinity;\n let y;\n let x;\n\n for (let i = 0; i < vertexCount; i++) {\n x = positions[i * 3];\n y = positions[i * 3 + 1];\n yMin = y < yMin ? y : yMin;\n yMax = y > yMax ? y : yMax;\n xMin = x < xMin ? x : xMin;\n xMax = x > xMax ? x : xMax;\n }\n\n const boundingBox = {\n xMin: toFinite(xMin),\n xMax: toFinite(xMax),\n yMin: toFinite(yMin),\n yMax: toFinite(yMax)\n };\n\n return boundingBox;\n}\n/* eslint-enable max-statements */\n\n// Returns XY translation for positions to peform aggregation in +ve sapce\nfunction getTranslation(boundingBox, gridOffset, coordinateSystem, viewport) {\n const {width, height} = viewport;\n\n // Origin to define grid\n // DEFAULT coordinate system is treated as LNGLAT\n const worldOrigin =\n coordinateSystem === COORDINATE_SYSTEM.CARTESIAN ? [-width / 2, -height / 2] : [-180, -90];\n\n // Other coordinate systems not supported/verified yet\n log.assert(\n coordinateSystem === COORDINATE_SYSTEM.CARTESIAN ||\n coordinateSystem === COORDINATE_SYSTEM.LNGLAT ||\n coordinateSystem === COORDINATE_SYSTEM.DEFAULT\n );\n\n const {xMin, yMin} = boundingBox;\n return [\n // Align origin to match grid cell boundaries in CPU and GPU aggregations\n -1 * (alignToCell(xMin - worldOrigin[0], gridOffset.xOffset) + worldOrigin[0]),\n -1 * (alignToCell(yMin - worldOrigin[1], gridOffset.yOffset) + worldOrigin[1])\n ];\n}\n\n// Aligns `inValue` to given `cellSize`\nexport function alignToCell(inValue, cellSize) {\n const sign = inValue < 0 ? -1 : 1;\n\n let value = sign < 0 ? Math.abs(inValue) + cellSize : Math.abs(inValue);\n\n value = Math.floor(value / cellSize) * cellSize;\n\n return value * sign;\n}\n\n/**\n * Based on geometric center of sample points, calculate cellSize in lng/lat (degree) space\n * @param {object} boundingBox - {xMin, yMin, xMax, yMax} contains bounding box of data\n * @param {number} cellSize - grid cell size in meters\n * @param {boolean, optional} converToDegrees - when true offsets are converted from meters to lng/lat (degree) space\n * @returns {xOffset, yOffset} - cellSize size\n */\n\nexport function getGridOffset(boundingBox, cellSize, convertToMeters = true) {\n if (!convertToMeters) {\n return {xOffset: cellSize, yOffset: cellSize};\n }\n\n const {yMin, yMax} = boundingBox;\n const centerLat = (yMin + yMax) / 2;\n\n return calculateGridLatLonOffset(cellSize, centerLat);\n}\n\nexport function getGridParams(boundingBox, cellSize, viewport, coordinateSystem) {\n const gridOffset = getGridOffset(\n boundingBox,\n cellSize,\n coordinateSystem !== COORDINATE_SYSTEM.CARTESIAN\n );\n\n const translation = getTranslation(boundingBox, gridOffset, coordinateSystem, viewport);\n\n const {xMin, yMin, xMax, yMax} = boundingBox;\n\n const width = xMax - xMin + gridOffset.xOffset;\n const height = yMax - yMin + gridOffset.yOffset;\n\n const numCol = Math.ceil(width / gridOffset.xOffset);\n const numRow = Math.ceil(height / gridOffset.yOffset);\n return {gridOffset, translation, width, height, numCol, numRow};\n}\n\n/**\n * calculate grid layer cell size in lat lon based on world unit size\n * and current latitude\n * @param {number} cellSize\n * @param {number} latitude\n * @returns {object} - lat delta and lon delta\n */\nfunction calculateGridLatLonOffset(cellSize, latitude) {\n const yOffset = calculateLatOffset(cellSize);\n const xOffset = calculateLonOffset(latitude, cellSize);\n return {yOffset, xOffset};\n}\n\n/**\n * with a given x-km change, calculate the increment of latitude\n * based on stackoverflow http://stackoverflow.com/questions/7477003\n * @param {number} dy - change in km\n * @return {number} - increment in latitude\n */\nfunction calculateLatOffset(dy) {\n return (dy / R_EARTH) * (180 / Math.PI);\n}\n\n/**\n * with a given x-km change, and current latitude\n * calculate the increment of longitude\n * based on stackoverflow http://stackoverflow.com/questions/7477003\n * @param {number} lat - latitude of current location (based on city)\n * @param {number} dx - change in km\n * @return {number} - increment in longitude\n */\nfunction calculateLonOffset(lat, dx) {\n return ((dx / R_EARTH) * (180 / Math.PI)) / Math.cos((lat * Math.PI) / 180);\n}\n"],"file":"grid-aggregation-utils.js"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export function filterProps(props, filterKeys) {
|
|
2
|
-
const filteredProps = {};
|
|
3
|
-
|
|
4
|
-
for (const key in props) {
|
|
5
|
-
if (!filterKeys.includes(key)) {
|
|
6
|
-
filteredProps[key] = props[key];
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
return filteredProps;
|
|
11
|
-
}
|
|
12
|
-
//# sourceMappingURL=prop-utils.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/utils/prop-utils.ts"],"names":["filterProps","props","filterKeys","filteredProps","key","includes"],"mappings":"AAoBA,OAAO,SAASA,WAAT,CAAqBC,KAArB,EAA4BC,UAA5B,EAAwC;AAC7C,QAAMC,aAAa,GAAG,EAAtB;;AACA,OAAK,MAAMC,GAAX,IAAkBH,KAAlB,EAAyB;AACvB,QAAI,CAACC,UAAU,CAACG,QAAX,CAAoBD,GAApB,CAAL,EAA+B;AAC7BD,MAAAA,aAAa,CAACC,GAAD,CAAb,GAAqBH,KAAK,CAACG,GAAD,CAA1B;AACD;AACF;;AACD,SAAOD,aAAP;AACD","sourcesContent":["// Copyright (c) 2015 - 2019 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\nexport function filterProps(props, filterKeys) {\n const filteredProps = {};\n for (const key in props) {\n if (!filterKeys.includes(key)) {\n filteredProps[key] = props[key];\n }\n }\n return filteredProps;\n}\n"],"file":"prop-utils.js"}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
const DEFAULT_PARAMETERS = {
|
|
2
|
-
minFilter: 'nearest',
|
|
3
|
-
magFilter: 'nearest'
|
|
4
|
-
};
|
|
5
|
-
export function getFloatTexture(device, opts) {
|
|
6
|
-
const {
|
|
7
|
-
width = 1,
|
|
8
|
-
height = 1,
|
|
9
|
-
data = null,
|
|
10
|
-
parameters = DEFAULT_PARAMETERS
|
|
11
|
-
} = opts;
|
|
12
|
-
const texture = device.createTexture({
|
|
13
|
-
data,
|
|
14
|
-
format: 'rgba32float',
|
|
15
|
-
mipmaps: false,
|
|
16
|
-
sampler: parameters,
|
|
17
|
-
width,
|
|
18
|
-
height
|
|
19
|
-
});
|
|
20
|
-
return texture;
|
|
21
|
-
}
|
|
22
|
-
export function getFramebuffer(device, opts) {
|
|
23
|
-
const {
|
|
24
|
-
id,
|
|
25
|
-
width = 1,
|
|
26
|
-
height = 1,
|
|
27
|
-
texture
|
|
28
|
-
} = opts;
|
|
29
|
-
const fb = device.createFramebuffer({
|
|
30
|
-
id,
|
|
31
|
-
width,
|
|
32
|
-
height,
|
|
33
|
-
colorAttachments: [texture]
|
|
34
|
-
});
|
|
35
|
-
return fb;
|
|
36
|
-
}
|
|
37
|
-
export function getFloatArray(array, size, fillValue = 0) {
|
|
38
|
-
if (!array || array.length < size) {
|
|
39
|
-
return new Float32Array(size).fill(fillValue);
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
return array;
|
|
43
|
-
}
|
|
44
|
-
//# sourceMappingURL=resource-utils.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/utils/resource-utils.ts"],"names":["DEFAULT_PARAMETERS","minFilter","magFilter","getFloatTexture","device","opts","width","height","data","parameters","texture","createTexture","format","mipmaps","sampler","getFramebuffer","id","fb","createFramebuffer","colorAttachments","getFloatArray","array","size","fillValue","length","Float32Array","fill"],"mappings":"AAEA,MAAMA,kBAAgC,GAAG;AACvCC,EAAAA,SAAS,EAAE,SAD4B;AAEvCC,EAAAA,SAAS,EAAE;AAF4B,CAAzC;AAeA,OAAO,SAASC,eAAT,CAAyBC,MAAzB,EAAyCC,IAAzC,EAAoE;AACzE,QAAM;AAACC,IAAAA,KAAK,GAAG,CAAT;AAAYC,IAAAA,MAAM,GAAG,CAArB;AAAwBC,IAAAA,IAAI,GAAG,IAA/B;AAAqCC,IAAAA,UAAU,GAAGT;AAAlD,MAAwEK,IAA9E;AACA,QAAMK,OAAO,GAAGN,MAAM,CAACO,aAAP,CAAqB;AACnCH,IAAAA,IADmC;AAEnCI,IAAAA,MAAM,EAAE,aAF2B;AAKnCC,IAAAA,OAAO,EAAE,KAL0B;AAMnCC,IAAAA,OAAO,EAAEL,UAN0B;AAQnCH,IAAAA,KARmC;AASnCC,IAAAA;AATmC,GAArB,CAAhB;AAaA,SAAOG,OAAP;AACD;AAED,OAAO,SAASK,cAAT,CAAwBX,MAAxB,EAAwCC,IAAxC,EAA8C;AACnD,QAAM;AAACW,IAAAA,EAAD;AAAKV,IAAAA,KAAK,GAAG,CAAb;AAAgBC,IAAAA,MAAM,GAAG,CAAzB;AAA4BG,IAAAA;AAA5B,MAAuCL,IAA7C;AACA,QAAMY,EAAE,GAAGb,MAAM,CAACc,iBAAP,CAAyB;AAClCF,IAAAA,EADkC;AAElCV,IAAAA,KAFkC;AAGlCC,IAAAA,MAHkC;AAIlCY,IAAAA,gBAAgB,EAAE,CAACT,OAAD;AAJgB,GAAzB,CAAX;AAOA,SAAOO,EAAP;AACD;AAED,OAAO,SAASG,aAAT,CAAuBC,KAAvB,EAA8BC,IAA9B,EAAoCC,SAAS,GAAG,CAAhD,EAAmD;AACxD,MAAI,CAACF,KAAD,IAAUA,KAAK,CAACG,MAAN,GAAeF,IAA7B,EAAmC;AACjC,WAAO,IAAIG,YAAJ,CAAiBH,IAAjB,EAAuBI,IAAvB,CAA4BH,SAA5B,CAAP;AACD;;AACD,SAAOF,KAAP;AACD","sourcesContent":["import {Device, SamplerProps} from '@luma.gl/core';\n\nconst DEFAULT_PARAMETERS: SamplerProps = {\n minFilter: 'nearest',\n magFilter: 'nearest'\n};\n\ntype FloatTextureOptions = {\n id: string;\n width?: number;\n height?: number;\n data?: any;\n unpackFlipY?: boolean;\n parameters?: SamplerProps;\n};\n\n// TODO - not working\nexport function getFloatTexture(device: Device, opts: FloatTextureOptions) {\n const {width = 1, height = 1, data = null, parameters = DEFAULT_PARAMETERS} = opts;\n const texture = device.createTexture({\n data,\n format: 'rgba32float', // device.info.type === 'webgl2' ? 'rgba32float' : GL.RGBA,\n // type: GL.FLOAT,\n // border: 0,\n mipmaps: false,\n sampler: parameters,\n // dataFormat: GL.RGBA,\n width,\n height\n // ts-expect-error\n // unpackFlipY\n });\n return texture;\n}\n\nexport function getFramebuffer(device: Device, opts) {\n const {id, width = 1, height = 1, texture} = opts;\n const fb = device.createFramebuffer({\n id,\n width,\n height,\n colorAttachments: [texture]\n });\n\n return fb;\n}\n\nexport function getFloatArray(array, size, fillValue = 0) {\n if (!array || array.length < size) {\n return new Float32Array(size).fill(fillValue);\n }\n return array;\n}\n"],"file":"resource-utils.js"}
|