@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/gpu-grid-layer/gpu-grid-cell-layer-fragment.glsl.ts"],"names":[],"mappings":"AAoBA,eAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAdA","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\nexport default `\\\n#version 300 es\n#define SHADER_NAME gpu-grid-cell-layer-fragment-shader\n\nprecision highp float;\n\nin vec4 vColor;\n\nout vec4 fragColor;\n\nvoid main(void) {\n fragColor = vColor;\n fragColor = picking_filterColor(fragColor);\n}\n`;\n"],"file":"gpu-grid-cell-layer-fragment.glsl.js"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/gpu-grid-layer/gpu-grid-cell-layer-vertex.glsl.ts"],"names":[],"mappings":"AAsBA,eAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAxHA","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\n// Inspired by screen-grid-layer vertex shader in deck.gl\n\nexport default `\\\n#version 300 es\n#define SHADER_NAME gpu-grid-cell-layer-vertex-shader\n#define RANGE_COUNT 6\n\nin vec3 positions;\nin vec3 normals;\n\nin vec4 colors;\nin vec4 elevations;\nin vec3 instancePickingColors;\n\n// Custom uniforms\nuniform vec2 offset;\nuniform bool extruded;\nuniform float cellSize;\nuniform float coverage;\nuniform float opacity;\nuniform float elevationScale;\n\nuniform ivec2 gridSize;\nuniform vec2 gridOrigin;\nuniform vec2 gridOriginLow;\nuniform vec2 gridOffset;\nuniform vec2 gridOffsetLow;\nuniform vec4 colorRange[RANGE_COUNT];\nuniform vec2 elevationRange;\n\n// Domain uniforms\nuniform vec2 colorDomain;\nuniform bool colorDomainValid;\nuniform vec2 elevationDomain;\nuniform bool elevationDomainValid;\n\nlayout(std140) uniform;\nuniform ColorData\n{\n vec4 maxMinCount;\n} colorData;\nuniform ElevationData\n{\n vec4 maxMinCount;\n} elevationData;\n\n#define EPSILON 0.00001\n\n// Result\nout vec4 vColor;\n\nvec4 quantizeScale(vec2 domain, vec4 range[RANGE_COUNT], float value) {\n vec4 outColor = vec4(0., 0., 0., 0.);\n if (value >= (domain.x - EPSILON) && value <= (domain.y + EPSILON)) {\n float domainRange = domain.y - domain.x;\n if (domainRange <= 0.) {\n outColor = colorRange[0];\n } else {\n float rangeCount = float(RANGE_COUNT);\n float rangeStep = domainRange / rangeCount;\n float idx = floor((value - domain.x) / rangeStep);\n idx = clamp(idx, 0., rangeCount - 1.);\n int intIdx = int(idx);\n outColor = colorRange[intIdx];\n }\n }\n return outColor;\n}\n\nfloat linearScale(vec2 domain, vec2 range, float value) {\n if (value >= (domain.x - EPSILON) && value <= (domain.y + EPSILON)) {\n return ((value - domain.x) / (domain.y - domain.x)) * (range.y - range.x) + range.x;\n }\n return -1.;\n}\n\nvoid main(void) {\n vec2 clrDomain = colorDomainValid ? colorDomain : vec2(colorData.maxMinCount.a, colorData.maxMinCount.r);\n vec4 color = quantizeScale(clrDomain, colorRange, colors.r);\n\n float elevation = 0.0;\n\n if (extruded) {\n vec2 elvDomain = elevationDomainValid ? elevationDomain : vec2(elevationData.maxMinCount.a, elevationData.maxMinCount.r);\n elevation = linearScale(elvDomain, elevationRange, elevations.r);\n elevation = elevation * (positions.z + 1.0) / 2.0 * elevationScale;\n }\n\n // if aggregated color or elevation is 0 do not render\n float shouldRender = float(color.r > 0.0 && elevations.r >= 0.0);\n float dotRadius = cellSize / 2. * coverage * shouldRender;\n\n int yIndex = (gl_InstanceID / gridSize[0]);\n int xIndex = gl_InstanceID - (yIndex * gridSize[0]);\n\n vec2 instancePositionXFP64 = mul_fp64(vec2(gridOffset[0], gridOffsetLow[0]), vec2(float(xIndex), 0.));\n instancePositionXFP64 = sum_fp64(instancePositionXFP64, vec2(gridOrigin[0], gridOriginLow[0]));\n vec2 instancePositionYFP64 = mul_fp64(vec2(gridOffset[1], gridOffsetLow[1]), vec2(float(yIndex), 0.));\n instancePositionYFP64 = sum_fp64(instancePositionYFP64, vec2(gridOrigin[1], gridOriginLow[1]));\n\n vec3 centroidPosition = vec3(instancePositionXFP64[0], instancePositionYFP64[0], elevation);\n vec3 centroidPosition64Low = vec3(instancePositionXFP64[1], instancePositionYFP64[1], 0.0);\n geometry.worldPosition = centroidPosition;\n vec3 pos = vec3(project_size(positions.xy + offset) * dotRadius, 0.);\n\n // Set color to be rendered to picking fbo (also used to check for selection highlight).\n picking_setPickingColor(instancePickingColors);\n\n gl_Position = project_position_to_clipspace(centroidPosition, centroidPosition64Low, pos, geometry.position);\n\n // Light calculations\n // Worldspace is the linear space after Mercator projection\n\n vec3 normals_commonspace = project_normal(normals);\n\n if (extruded) {\n vec3 lightColor = lighting_getLightColor(color.rgb, project_uCameraPosition, geometry.position.xyz, normals_commonspace);\n vColor = vec4(lightColor, color.a * opacity) / 255.;\n } else {\n vColor = vec4(color.rgb, color.a * opacity) / 255.;\n }\n}\n`;\n"],"file":"gpu-grid-cell-layer-vertex.glsl.js"}
|
|
@@ -1,196 +0,0 @@
|
|
|
1
|
-
import { Layer, fp64LowPart, project32, gouraudLighting, picking } from '@deck.gl/core';
|
|
2
|
-
import { CubeGeometry } from '@luma.gl/engine';
|
|
3
|
-
import { fp64arithmetic } from '@luma.gl/shadertools';
|
|
4
|
-
import { Model } from '@luma.gl/engine';
|
|
5
|
-
import { GL } from '@luma.gl/constants';
|
|
6
|
-
import { defaultColorRange, colorRangeToFlatArray } from '../utils/color-utils';
|
|
7
|
-
import vs from './gpu-grid-cell-layer-vertex.glsl';
|
|
8
|
-
import fs from './gpu-grid-cell-layer-fragment.glsl';
|
|
9
|
-
const COLOR_DATA_UBO_INDEX = 0;
|
|
10
|
-
const ELEVATION_DATA_UBO_INDEX = 1;
|
|
11
|
-
const defaultProps = {
|
|
12
|
-
colorDomain: null,
|
|
13
|
-
colorRange: defaultColorRange,
|
|
14
|
-
elevationDomain: null,
|
|
15
|
-
elevationRange: [0, 1000],
|
|
16
|
-
elevationScale: {
|
|
17
|
-
type: 'number',
|
|
18
|
-
min: 0,
|
|
19
|
-
value: 1
|
|
20
|
-
},
|
|
21
|
-
gridSize: {
|
|
22
|
-
type: 'array',
|
|
23
|
-
value: [1, 1]
|
|
24
|
-
},
|
|
25
|
-
gridOrigin: {
|
|
26
|
-
type: 'array',
|
|
27
|
-
value: [0, 0]
|
|
28
|
-
},
|
|
29
|
-
gridOffset: {
|
|
30
|
-
type: 'array',
|
|
31
|
-
value: [0, 0]
|
|
32
|
-
},
|
|
33
|
-
cellSize: {
|
|
34
|
-
type: 'number',
|
|
35
|
-
min: 0,
|
|
36
|
-
max: 1000,
|
|
37
|
-
value: 1000
|
|
38
|
-
},
|
|
39
|
-
offset: {
|
|
40
|
-
type: 'array',
|
|
41
|
-
value: [1, 1]
|
|
42
|
-
},
|
|
43
|
-
coverage: {
|
|
44
|
-
type: 'number',
|
|
45
|
-
min: 0,
|
|
46
|
-
max: 1,
|
|
47
|
-
value: 1
|
|
48
|
-
},
|
|
49
|
-
extruded: true,
|
|
50
|
-
material: true
|
|
51
|
-
};
|
|
52
|
-
export default class GPUGridCellLayer extends Layer {
|
|
53
|
-
constructor(...args) {
|
|
54
|
-
super(...args);
|
|
55
|
-
this.state = void 0;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
getShaders() {
|
|
59
|
-
return super.getShaders({
|
|
60
|
-
vs,
|
|
61
|
-
fs,
|
|
62
|
-
modules: [project32, gouraudLighting, picking, fp64arithmetic]
|
|
63
|
-
});
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
initializeState() {
|
|
67
|
-
const attributeManager = this.getAttributeManager();
|
|
68
|
-
attributeManager.addInstanced({
|
|
69
|
-
colors: {
|
|
70
|
-
size: 4,
|
|
71
|
-
noAlloc: true
|
|
72
|
-
},
|
|
73
|
-
elevations: {
|
|
74
|
-
size: 4,
|
|
75
|
-
noAlloc: true
|
|
76
|
-
}
|
|
77
|
-
});
|
|
78
|
-
|
|
79
|
-
const model = this._getModel();
|
|
80
|
-
|
|
81
|
-
this._setupUniformBuffer(model);
|
|
82
|
-
|
|
83
|
-
this.setState({
|
|
84
|
-
model
|
|
85
|
-
});
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
_getModel() {
|
|
89
|
-
return new Model(this.context.device, { ...this.getShaders(),
|
|
90
|
-
id: this.props.id,
|
|
91
|
-
geometry: new CubeGeometry(),
|
|
92
|
-
isInstanced: true
|
|
93
|
-
});
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
draw({
|
|
97
|
-
uniforms
|
|
98
|
-
}) {
|
|
99
|
-
const {
|
|
100
|
-
cellSize,
|
|
101
|
-
offset,
|
|
102
|
-
extruded,
|
|
103
|
-
elevationScale,
|
|
104
|
-
coverage,
|
|
105
|
-
gridSize,
|
|
106
|
-
gridOrigin,
|
|
107
|
-
gridOffset,
|
|
108
|
-
elevationRange,
|
|
109
|
-
colorMaxMinBuffer,
|
|
110
|
-
elevationMaxMinBuffer
|
|
111
|
-
} = this.props;
|
|
112
|
-
const model = this.state.model;
|
|
113
|
-
const gridOriginLow = [fp64LowPart(gridOrigin[0]), fp64LowPart(gridOrigin[1])];
|
|
114
|
-
const gridOffsetLow = [fp64LowPart(gridOffset[0]), fp64LowPart(gridOffset[1])];
|
|
115
|
-
const domainUniforms = this.getDomainUniforms();
|
|
116
|
-
const colorRange = colorRangeToFlatArray(this.props.colorRange);
|
|
117
|
-
this.bindUniformBuffers(colorMaxMinBuffer, elevationMaxMinBuffer);
|
|
118
|
-
model.setUniforms(uniforms);
|
|
119
|
-
model.setUniforms(domainUniforms);
|
|
120
|
-
model.setUniforms({
|
|
121
|
-
cellSize,
|
|
122
|
-
offset,
|
|
123
|
-
extruded,
|
|
124
|
-
elevationScale,
|
|
125
|
-
coverage,
|
|
126
|
-
gridSize,
|
|
127
|
-
gridOrigin,
|
|
128
|
-
gridOriginLow,
|
|
129
|
-
gridOffset,
|
|
130
|
-
gridOffsetLow,
|
|
131
|
-
colorRange,
|
|
132
|
-
elevationRange
|
|
133
|
-
});
|
|
134
|
-
model.draw(this.context.renderPass);
|
|
135
|
-
this.unbindUniformBuffers(colorMaxMinBuffer, elevationMaxMinBuffer);
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
bindUniformBuffers(colorMaxMinBuffer, elevationMaxMinBuffer) {
|
|
139
|
-
colorMaxMinBuffer.bind({
|
|
140
|
-
target: 35345,
|
|
141
|
-
index: COLOR_DATA_UBO_INDEX
|
|
142
|
-
});
|
|
143
|
-
elevationMaxMinBuffer.bind({
|
|
144
|
-
target: 35345,
|
|
145
|
-
index: ELEVATION_DATA_UBO_INDEX
|
|
146
|
-
});
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
unbindUniformBuffers(colorMaxMinBuffer, elevationMaxMinBuffer) {
|
|
150
|
-
colorMaxMinBuffer.unbind({
|
|
151
|
-
target: 35345,
|
|
152
|
-
index: COLOR_DATA_UBO_INDEX
|
|
153
|
-
});
|
|
154
|
-
elevationMaxMinBuffer.unbind({
|
|
155
|
-
target: 35345,
|
|
156
|
-
index: ELEVATION_DATA_UBO_INDEX
|
|
157
|
-
});
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
getDomainUniforms() {
|
|
161
|
-
const {
|
|
162
|
-
colorDomain,
|
|
163
|
-
elevationDomain
|
|
164
|
-
} = this.props;
|
|
165
|
-
const domainUniforms = {};
|
|
166
|
-
|
|
167
|
-
if (colorDomain !== null) {
|
|
168
|
-
domainUniforms.colorDomainValid = true;
|
|
169
|
-
domainUniforms.colorDomain = colorDomain;
|
|
170
|
-
} else {
|
|
171
|
-
domainUniforms.colorDomainValid = false;
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
if (elevationDomain !== null) {
|
|
175
|
-
domainUniforms.elevationDomainValid = true;
|
|
176
|
-
domainUniforms.elevationDomain = elevationDomain;
|
|
177
|
-
} else {
|
|
178
|
-
domainUniforms.elevationDomainValid = false;
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
return domainUniforms;
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
_setupUniformBuffer(model) {
|
|
185
|
-
const programHandle = model.pipeline.handle;
|
|
186
|
-
const gl = this.context.gl;
|
|
187
|
-
const colorIndex = gl.getUniformBlockIndex(programHandle, 'ColorData');
|
|
188
|
-
const elevationIndex = gl.getUniformBlockIndex(programHandle, 'ElevationData');
|
|
189
|
-
gl.uniformBlockBinding(programHandle, colorIndex, COLOR_DATA_UBO_INDEX);
|
|
190
|
-
gl.uniformBlockBinding(programHandle, elevationIndex, ELEVATION_DATA_UBO_INDEX);
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
}
|
|
194
|
-
GPUGridCellLayer.layerName = 'GPUGridCellLayer';
|
|
195
|
-
GPUGridCellLayer.defaultProps = defaultProps;
|
|
196
|
-
//# sourceMappingURL=gpu-grid-cell-layer.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/gpu-grid-layer/gpu-grid-cell-layer.ts"],"names":["Layer","fp64LowPart","project32","gouraudLighting","picking","CubeGeometry","fp64arithmetic","Model","GL","defaultColorRange","colorRangeToFlatArray","vs","fs","COLOR_DATA_UBO_INDEX","ELEVATION_DATA_UBO_INDEX","defaultProps","colorDomain","colorRange","elevationDomain","elevationRange","elevationScale","type","min","value","gridSize","gridOrigin","gridOffset","cellSize","max","offset","coverage","extruded","material","GPUGridCellLayer","state","getShaders","modules","initializeState","attributeManager","getAttributeManager","addInstanced","colors","size","noAlloc","elevations","model","_getModel","_setupUniformBuffer","setState","context","device","id","props","geometry","isInstanced","draw","uniforms","colorMaxMinBuffer","elevationMaxMinBuffer","gridOriginLow","gridOffsetLow","domainUniforms","getDomainUniforms","bindUniformBuffers","setUniforms","renderPass","unbindUniformBuffers","bind","target","index","unbind","colorDomainValid","elevationDomainValid","programHandle","pipeline","handle","gl","colorIndex","getUniformBlockIndex","elevationIndex","uniformBlockBinding","layerName"],"mappings":"AAoBA,SACEA,KADF,EAEEC,WAFF,EAGEC,SAHF,EAIEC,eAJF,EAKEC,OALF,QAQO,eARP;AASA,SAAQC,YAAR,QAA2B,iBAA3B;AACA,SAAQC,cAAR,QAA6B,sBAA7B;AACA,SAAQC,KAAR,QAAoB,iBAApB;AAEA,SAAQC,EAAR,QAAiB,oBAAjB;AACA,SAAQC,iBAAR,EAA2BC,qBAA3B,QAAuD,sBAAvD;AAEA,OAAOC,EAAP,MAAe,mCAAf;AACA,OAAOC,EAAP,MAAe,qCAAf;AAEA,MAAMC,oBAAoB,GAAG,CAA7B;AACA,MAAMC,wBAAwB,GAAG,CAAjC;AAEA,MAAMC,YAA+D,GAAG;AAEtEC,EAAAA,WAAW,EAAE,IAFyD;AAGtEC,EAAAA,UAAU,EAAER,iBAH0D;AAMtES,EAAAA,eAAe,EAAE,IANqD;AAOtEC,EAAAA,cAAc,EAAE,CAAC,CAAD,EAAI,IAAJ,CAPsD;AAQtEC,EAAAA,cAAc,EAAE;AAACC,IAAAA,IAAI,EAAE,QAAP;AAAiBC,IAAAA,GAAG,EAAE,CAAtB;AAAyBC,IAAAA,KAAK,EAAE;AAAhC,GARsD;AAWtEC,EAAAA,QAAQ,EAAE;AAAC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I,mBAAH,CAAuBP,aAAvB,EAAsCM,cAAtC,EAAsDjE,wBAAtD;AACD;;AAxHyE;AAAvDmB,gB,CACZgD,S,GAAY,kB;AADAhD,gB,CAEZlB,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 {\n Layer,\n fp64LowPart,\n project32,\n gouraudLighting,\n picking,\n LayerProps,\n DefaultProps\n} from '@deck.gl/core';\nimport {CubeGeometry} from '@luma.gl/engine';\nimport {fp64arithmetic} from '@luma.gl/shadertools';\nimport {Model} from '@luma.gl/engine';\nimport {Buffer} from '@luma.gl/core';\nimport {GL} from '@luma.gl/constants';\nimport {defaultColorRange, colorRangeToFlatArray} from '../utils/color-utils';\nimport type {_GPUGridLayerProps} from './gpu-grid-layer';\nimport vs from './gpu-grid-cell-layer-vertex.glsl';\nimport fs from './gpu-grid-cell-layer-fragment.glsl';\n\nconst COLOR_DATA_UBO_INDEX = 0;\nconst ELEVATION_DATA_UBO_INDEX = 1;\n\nconst defaultProps: DefaultProps<_GPUGridCellLayerProps & LayerProps> = {\n // color\n colorDomain: null,\n colorRange: defaultColorRange,\n\n // elevation\n elevationDomain: null,\n elevationRange: [0, 1000],\n elevationScale: {type: 'number', min: 0, value: 1},\n\n // grid\n gridSize: {type: 'array', value: [1, 1]},\n gridOrigin: {type: 'array', value: [0, 0]},\n gridOffset: {type: 'array', value: [0, 0]},\n\n cellSize: {type: 'number', min: 0, max: 1000, value: 1000},\n offset: {type: 'array', value: [1, 1]},\n coverage: {type: 'number', min: 0, max: 1, value: 1},\n extruded: true,\n\n material: true // Use lighting module defaults\n};\n\ntype _GPUGridCellLayerProps = _GPUGridLayerProps<any> & {\n cellSize: number;\n offset: number[];\n coverage: number;\n extruded: boolean;\n elevationScale: number;\n elevationRange: [number, number];\n gridSize: number[];\n gridOrigin: number[];\n gridOffset: number[];\n colorMaxMinBuffer: Buffer;\n elevationMaxMinBuffer: Buffer;\n};\n\nexport default class GPUGridCellLayer extends Layer<_GPUGridCellLayerProps> {\n static layerName = 'GPUGridCellLayer';\n static defaultProps = defaultProps;\n\n state!: {\n model?: Model;\n };\n\n getShaders() {\n return super.getShaders({\n vs,\n fs,\n modules: [project32, gouraudLighting, picking, fp64arithmetic]\n });\n }\n\n initializeState(): void {\n const attributeManager = this.getAttributeManager()!;\n attributeManager.addInstanced({\n colors: {\n size: 4,\n noAlloc: true\n },\n elevations: {\n size: 4,\n noAlloc: true\n }\n });\n const model = this._getModel();\n this._setupUniformBuffer(model);\n this.setState({model});\n }\n\n _getModel(): Model {\n return new Model(this.context.device, {\n ...this.getShaders(),\n id: this.props.id,\n geometry: new CubeGeometry(),\n isInstanced: true\n });\n }\n\n draw({uniforms}) {\n const {\n cellSize,\n offset,\n extruded,\n elevationScale,\n coverage,\n gridSize,\n gridOrigin,\n gridOffset,\n elevationRange,\n colorMaxMinBuffer,\n elevationMaxMinBuffer\n } = this.props;\n const model = this.state.model!;\n\n const gridOriginLow = [fp64LowPart(gridOrigin[0]), fp64LowPart(gridOrigin[1])];\n const gridOffsetLow = [fp64LowPart(gridOffset[0]), fp64LowPart(gridOffset[1])];\n const domainUniforms = this.getDomainUniforms();\n const colorRange = colorRangeToFlatArray(this.props.colorRange);\n this.bindUniformBuffers(colorMaxMinBuffer, elevationMaxMinBuffer);\n model.setUniforms(uniforms);\n model.setUniforms(domainUniforms);\n model.setUniforms({\n cellSize,\n offset,\n extruded,\n elevationScale,\n coverage,\n gridSize,\n gridOrigin,\n gridOriginLow,\n gridOffset,\n gridOffsetLow,\n colorRange,\n elevationRange\n });\n model.draw(this.context.renderPass);\n this.unbindUniformBuffers(colorMaxMinBuffer, elevationMaxMinBuffer);\n }\n\n bindUniformBuffers(colorMaxMinBuffer, elevationMaxMinBuffer) {\n colorMaxMinBuffer.bind({target: GL.UNIFORM_BUFFER, index: COLOR_DATA_UBO_INDEX});\n elevationMaxMinBuffer.bind({target: GL.UNIFORM_BUFFER, index: ELEVATION_DATA_UBO_INDEX});\n }\n\n unbindUniformBuffers(colorMaxMinBuffer, elevationMaxMinBuffer) {\n colorMaxMinBuffer.unbind({target: GL.UNIFORM_BUFFER, index: COLOR_DATA_UBO_INDEX});\n elevationMaxMinBuffer.unbind({target: GL.UNIFORM_BUFFER, index: ELEVATION_DATA_UBO_INDEX});\n }\n\n getDomainUniforms() {\n const {colorDomain, elevationDomain} = this.props;\n const domainUniforms: Record<string, any> = {};\n if (colorDomain !== null) {\n domainUniforms.colorDomainValid = true;\n domainUniforms.colorDomain = colorDomain;\n } else {\n domainUniforms.colorDomainValid = false;\n }\n if (elevationDomain !== null) {\n domainUniforms.elevationDomainValid = true;\n domainUniforms.elevationDomain = elevationDomain;\n } else {\n domainUniforms.elevationDomainValid = false;\n }\n return domainUniforms;\n }\n\n private _setupUniformBuffer(model: Model): void {\n // @ts-expect-error TODO v9 This code is not portable to WebGPU\n const programHandle = model.pipeline.handle;\n\n const gl = this.context.gl as WebGL2RenderingContext;\n const colorIndex = gl.getUniformBlockIndex(programHandle, 'ColorData');\n const elevationIndex = gl.getUniformBlockIndex(programHandle, 'ElevationData');\n gl.uniformBlockBinding(programHandle, colorIndex, COLOR_DATA_UBO_INDEX);\n gl.uniformBlockBinding(programHandle, elevationIndex, ELEVATION_DATA_UBO_INDEX);\n }\n}\n"],"file":"gpu-grid-cell-layer.js"}
|
|
@@ -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
|