@deck.gl/aggregation-layers 8.8.0-beta.3 → 8.8.0
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/dist.dev.js +271 -261
- package/dist/es5/contour-layer/contour-layer.js.map +1 -1
- package/dist/es5/cpu-grid-layer/cpu-grid-layer.js.map +1 -1
- package/dist/es5/gpu-grid-layer/gpu-grid-layer.js.map +1 -1
- package/dist/es5/grid-layer/grid-layer.js.map +1 -1
- package/dist/es5/heatmap-layer/heatmap-layer.js +17 -12
- package/dist/es5/heatmap-layer/heatmap-layer.js.map +1 -1
- package/dist/es5/hexagon-layer/hexagon-layer.js.map +1 -1
- package/dist/es5/screen-grid-layer/screen-grid-layer.js.map +1 -1
- package/dist/esm/contour-layer/contour-layer.js.map +1 -1
- package/dist/esm/cpu-grid-layer/cpu-grid-layer.js.map +1 -1
- package/dist/esm/gpu-grid-layer/gpu-grid-layer.js.map +1 -1
- package/dist/esm/grid-layer/grid-layer.js.map +1 -1
- package/dist/esm/heatmap-layer/heatmap-layer.js +16 -12
- package/dist/esm/heatmap-layer/heatmap-layer.js.map +1 -1
- package/dist/esm/hexagon-layer/hexagon-layer.js.map +1 -1
- package/dist/esm/screen-grid-layer/screen-grid-layer.js.map +1 -1
- package/dist.min.js +1 -1
- package/package.json +2 -2
- package/src/contour-layer/contour-layer.ts +2 -0
- package/src/cpu-grid-layer/cpu-grid-layer.ts +1 -0
- package/src/gpu-grid-layer/gpu-grid-layer.ts +1 -3
- package/src/grid-layer/grid-layer.ts +1 -0
- package/src/heatmap-layer/heatmap-layer.ts +24 -12
- package/src/hexagon-layer/hexagon-layer.ts +1 -0
- package/src/screen-grid-layer/screen-grid-layer.ts +1 -0
- package/typed/aggregation-layer.js +151 -0
- package/typed/contour-layer/contour-layer.d.ts +1 -0
- package/typed/contour-layer/contour-layer.d.ts.map +1 -1
- package/typed/contour-layer/contour-layer.js +234 -0
- package/typed/contour-layer/contour-utils.js +64 -0
- package/typed/contour-layer/marching-squares-codes.js +337 -0
- package/typed/contour-layer/marching-squares.js +147 -0
- package/typed/cpu-grid-layer/cpu-grid-layer.d.ts +1 -0
- package/typed/cpu-grid-layer/cpu-grid-layer.d.ts.map +1 -1
- package/typed/cpu-grid-layer/cpu-grid-layer.js +129 -0
- package/typed/cpu-grid-layer/grid-aggregator.js +141 -0
- package/typed/gpu-grid-layer/gpu-grid-cell-layer-fragment.glsl.js +34 -0
- package/typed/gpu-grid-layer/gpu-grid-cell-layer-vertex.glsl.js +141 -0
- package/typed/gpu-grid-layer/gpu-grid-cell-layer.js +143 -0
- package/typed/gpu-grid-layer/gpu-grid-layer.d.ts +1 -3
- package/typed/gpu-grid-layer/gpu-grid-layer.d.ts.map +1 -1
- package/typed/gpu-grid-layer/gpu-grid-layer.js +289 -0
- package/typed/grid-aggregation-layer.js +172 -0
- package/typed/grid-layer/grid-layer.d.ts +1 -0
- package/typed/grid-layer/grid-layer.d.ts.map +1 -1
- package/typed/grid-layer/grid-layer.js +60 -0
- package/typed/heatmap-layer/heatmap-layer-utils.js +78 -0
- package/typed/heatmap-layer/heatmap-layer.d.ts +1 -0
- package/typed/heatmap-layer/heatmap-layer.d.ts.map +1 -1
- package/typed/heatmap-layer/heatmap-layer.js +478 -0
- package/typed/heatmap-layer/max-fs.glsl.js +7 -0
- package/typed/heatmap-layer/max-vs.glsl.js +12 -0
- package/typed/heatmap-layer/triangle-layer-fragment.glsl.js +58 -0
- package/typed/heatmap-layer/triangle-layer-vertex.glsl.js +51 -0
- package/typed/heatmap-layer/triangle-layer.js +67 -0
- package/typed/heatmap-layer/weights-fs.glsl.js +19 -0
- package/typed/heatmap-layer/weights-vs.glsl.js +23 -0
- package/typed/hexagon-layer/hexagon-aggregator.js +112 -0
- package/typed/hexagon-layer/hexagon-layer.d.ts +1 -0
- package/typed/hexagon-layer/hexagon-layer.d.ts.map +1 -1
- package/typed/hexagon-layer/hexagon-layer.js +171 -0
- package/typed/index.js +33 -0
- package/typed/screen-grid-layer/screen-grid-cell-layer.js +159 -0
- package/typed/screen-grid-layer/screen-grid-layer-fragment.glsl.js +37 -0
- package/typed/screen-grid-layer/screen-grid-layer-vertex.glsl.js +83 -0
- package/typed/screen-grid-layer/screen-grid-layer.d.ts +1 -0
- package/typed/screen-grid-layer/screen-grid-layer.d.ts.map +1 -1
- package/typed/screen-grid-layer/screen-grid-layer.js +216 -0
- package/typed/types.js +1 -0
- package/typed/utils/aggregation-operation-utils.js +94 -0
- package/typed/utils/bin-sorter.js +167 -0
- package/typed/utils/color-utils.js +53 -0
- package/typed/utils/cpu-aggregator.js +417 -0
- package/typed/utils/gpu-grid-aggregation/aggregate-all-fs.glsl.js +39 -0
- package/typed/utils/gpu-grid-aggregation/aggregate-all-vs.glsl.js +53 -0
- package/typed/utils/gpu-grid-aggregation/aggregate-to-grid-fs.glsl.js +31 -0
- package/typed/utils/gpu-grid-aggregation/aggregate-to-grid-vs.glsl.js +77 -0
- package/typed/utils/gpu-grid-aggregation/gpu-grid-aggregator-constants.js +41 -0
- package/typed/utils/gpu-grid-aggregation/gpu-grid-aggregator-utils.js +1 -0
- package/typed/utils/gpu-grid-aggregation/gpu-grid-aggregator.js +562 -0
- package/typed/utils/gpu-grid-aggregation/transform-mean-vs.glsl.js +36 -0
- package/typed/utils/grid-aggregation-utils.js +114 -0
- package/typed/utils/prop-utils.js +28 -0
- package/typed/utils/resource-utils.js +40 -0
- package/typed/utils/scale-utils.js +184 -0
- package/dist/es5/aggregation-layer.md +0 -54
- package/dist/es5/grid-aggregation-layer.md +0 -46
- package/dist/esm/aggregation-layer.md +0 -54
- package/dist/esm/grid-aggregation-layer.md +0 -46
- package/src/aggregation-layer.md +0 -54
- package/src/grid-aggregation-layer.md +0 -46
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
# GridAggregationLayer
|
|
2
|
-
|
|
3
|
-
This layer performs some common tasks required to perform aggregation to grid cells, especially it takes care of deciding CPU vs GPU aggregation, allocating resources for GPU aggregation and uploading results.
|
|
4
|
-
|
|
5
|
-
This in an abstract layer, subclassed form `AggregationLayer`, `GPUGridLayer`, `ScreenGridLayer` and `ContourLayer` are subclassed from this layer.
|
|
6
|
-
|
|
7
|
-
## updateState()
|
|
8
|
-
|
|
9
|
-
During `updateState()`, it calls `updateAggregationState()` which sub classes must implement. During this method, sub classes must set following aggregation flags and aggregation params.
|
|
10
|
-
|
|
11
|
-
### Aggregation Flags
|
|
12
|
-
|
|
13
|
-
* `gpuAggregation`: When `true` aggregation happens on GPU, otherwise on CPU.
|
|
14
|
-
* `aggregationDataDirty` : When `true` data is re-aggregated.
|
|
15
|
-
* `aggregationWeightsDirty` : This flag is applicable only for CPU aggregation. When `true`, bin's aggregated values are re computed.
|
|
16
|
-
|
|
17
|
-
## Aggregation Parameters
|
|
18
|
-
|
|
19
|
-
* `gridOffset` : Grid's cell size in the format {xOffset, yOffset}.
|
|
20
|
-
* `projectPoints` : Should be `true` when doing screen space aggregation, when `false` it implies world space aggregation.
|
|
21
|
-
* `attributes` : Layer's current set of attributes which provide position and weights to CPU/GPU aggregators.
|
|
22
|
-
* `viewport` : current viewport object.
|
|
23
|
-
* `posOffset` : Offset to be added to object's position before aggregating.
|
|
24
|
-
* `boundingBox` : Bounding box of the input data.
|
|
25
|
-
Following are applicable for GPU aggregation only:
|
|
26
|
-
* `translation` : [xTranslation, yTranslation], position translation to be applied on positions.
|
|
27
|
-
* `scaling` : [xScale, yScale, flag], scaling to be applied on positions. When scaling not needed `flag` should be set to `0`.
|
|
28
|
-
* `vertexCount` : Number of objects to be aggregated.
|
|
29
|
-
* `moduleSettings` : Object with set of fields required for applying shader modules.
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
## updateResults()
|
|
33
|
-
|
|
34
|
-
When aggregation performed on CPU, aggregation result is in JS Array objects. Subclasses can override this method to consume aggregation data. This method is called with an object with following fields:
|
|
35
|
-
* `aggregationData` (*Float32Array*) - Array containing aggregation data per grid cell. Four elements per grid cell in the format `[value, 0, 0, count]`, where `value` is the aggregated weight value, up to 3 different weights. `count` is the number of objects aggregated to the grid cell.
|
|
36
|
-
* `maxMinData` (*Float32Array*) - Array with four values in format, `[maxValue, 0, 0, minValue]`, where `maxValue` is max of all aggregated cells.
|
|
37
|
-
* `maxData` (*Float32Array*) - Array with four values in format, `[maxValue, 0, 0, count]`, where `maxValue` is max of all aggregated cells and `count` is total number aggregated objects.
|
|
38
|
-
* `minData` (*Float32Array*) - Array with four values in format, `[minValue, 0, 0, count]`, where `minValue` is min of all aggregated cells and `count` is total number aggregated objects.
|
|
39
|
-
|
|
40
|
-
NOTE: The goal is to match format of CPU aggregation results to that of GPU aggregation, so consumers of this data (Sublayers) don't have to change.
|
|
41
|
-
|
|
42
|
-
## allocateResources()
|
|
43
|
-
|
|
44
|
-
Called with following arguments to allocated resources required to hold aggregation results.
|
|
45
|
-
* `numRow` (*Number*) - Number of rows in the grid.
|
|
46
|
-
* `numCol` (*Number*) - Number of columns in the grid.
|