@deck.gl/aggregation-layers 9.0.40 → 9.1.0-beta.3
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/common/aggregation-layer.d.ts +30 -0
- package/dist/common/aggregation-layer.d.ts.map +1 -0
- package/dist/common/aggregation-layer.js +70 -0
- package/dist/common/aggregation-layer.js.map +1 -0
- package/dist/common/aggregator/aggregator.d.ts +76 -0
- package/dist/common/aggregator/aggregator.d.ts.map +1 -0
- package/dist/common/aggregator/aggregator.js +5 -0
- package/dist/common/aggregator/aggregator.js.map +1 -0
- package/dist/common/aggregator/cpu-aggregator/aggregate.d.ts +27 -0
- package/dist/common/aggregator/cpu-aggregator/aggregate.d.ts.map +1 -0
- package/dist/common/aggregator/cpu-aggregator/aggregate.js +67 -0
- package/dist/common/aggregator/cpu-aggregator/aggregate.js.map +1 -0
- package/dist/common/aggregator/cpu-aggregator/cpu-aggregator.d.ts +70 -0
- package/dist/common/aggregator/cpu-aggregator/cpu-aggregator.d.ts.map +1 -0
- package/dist/common/aggregator/cpu-aggregator/cpu-aggregator.js +140 -0
- package/dist/common/aggregator/cpu-aggregator/cpu-aggregator.js.map +1 -0
- package/dist/common/aggregator/cpu-aggregator/sort-bins.d.ts +15 -0
- package/dist/common/aggregator/cpu-aggregator/sort-bins.d.ts.map +1 -0
- package/dist/common/aggregator/cpu-aggregator/sort-bins.js +44 -0
- package/dist/common/aggregator/cpu-aggregator/sort-bins.js.map +1 -0
- package/dist/common/aggregator/cpu-aggregator/vertex-accessor.d.ts +21 -0
- package/dist/common/aggregator/cpu-aggregator/vertex-accessor.d.ts.map +1 -0
- package/dist/common/aggregator/cpu-aggregator/vertex-accessor.js +56 -0
- package/dist/common/aggregator/cpu-aggregator/vertex-accessor.js.map +1 -0
- package/dist/common/aggregator/gpu-aggregator/aggregation-transform-uniforms.d.ts +18 -0
- package/dist/common/aggregator/gpu-aggregator/aggregation-transform-uniforms.d.ts.map +1 -0
- package/dist/common/aggregator/gpu-aggregator/aggregation-transform-uniforms.js +21 -0
- package/dist/common/aggregator/gpu-aggregator/aggregation-transform-uniforms.js.map +1 -0
- package/dist/common/aggregator/gpu-aggregator/bin-sorter-uniforms.d.ts +14 -0
- package/dist/common/aggregator/gpu-aggregator/bin-sorter-uniforms.d.ts.map +1 -0
- package/dist/common/aggregator/gpu-aggregator/bin-sorter-uniforms.js +18 -0
- package/dist/common/aggregator/gpu-aggregator/bin-sorter-uniforms.js.map +1 -0
- package/dist/common/aggregator/gpu-aggregator/utils.d.ts +6 -0
- package/dist/common/aggregator/gpu-aggregator/utils.d.ts.map +1 -0
- package/dist/common/aggregator/gpu-aggregator/utils.js +25 -0
- package/dist/common/aggregator/gpu-aggregator/utils.js.map +1 -0
- package/dist/common/aggregator/gpu-aggregator/webgl-aggregation-transform.d.ts +24 -0
- package/dist/common/aggregator/gpu-aggregator/webgl-aggregation-transform.d.ts.map +1 -0
- package/dist/common/aggregator/gpu-aggregator/webgl-aggregation-transform.js +216 -0
- package/dist/common/aggregator/gpu-aggregator/webgl-aggregation-transform.js.map +1 -0
- package/dist/common/aggregator/gpu-aggregator/webgl-aggregator.d.ts +81 -0
- package/dist/common/aggregator/gpu-aggregator/webgl-aggregator.d.ts.map +1 -0
- package/dist/common/aggregator/gpu-aggregator/webgl-aggregator.js +202 -0
- package/dist/common/aggregator/gpu-aggregator/webgl-aggregator.js.map +1 -0
- package/dist/common/aggregator/gpu-aggregator/webgl-bin-sorter.d.ts +38 -0
- package/dist/common/aggregator/gpu-aggregator/webgl-bin-sorter.d.ts.map +1 -0
- package/dist/common/aggregator/gpu-aggregator/webgl-bin-sorter.js +224 -0
- package/dist/common/aggregator/gpu-aggregator/webgl-bin-sorter.js.map +1 -0
- package/dist/common/aggregator/index.d.ts +6 -0
- package/dist/common/aggregator/index.d.ts.map +1 -0
- package/dist/common/aggregator/index.js +6 -0
- package/dist/common/aggregator/index.js.map +1 -0
- package/dist/common/types.d.ts +11 -0
- package/dist/common/types.d.ts.map +1 -0
- package/dist/common/types.js +5 -0
- package/dist/common/types.js.map +1 -0
- package/dist/common/utils/bounds-utils.d.ts +10 -0
- package/dist/common/utils/bounds-utils.d.ts.map +1 -0
- package/dist/common/utils/bounds-utils.js +21 -0
- package/dist/common/utils/bounds-utils.js.map +1 -0
- package/dist/common/utils/color-utils.d.ts +10 -0
- package/dist/common/utils/color-utils.d.ts.map +1 -0
- package/dist/common/utils/color-utils.js +66 -0
- package/dist/common/utils/color-utils.js.map +1 -0
- package/dist/common/utils/prop-utils.d.ts.map +1 -0
- package/dist/common/utils/prop-utils.js +13 -0
- package/dist/common/utils/prop-utils.js.map +1 -0
- package/dist/common/utils/scale-utils.d.ts +46 -0
- package/dist/common/utils/scale-utils.d.ts.map +1 -0
- package/dist/common/utils/scale-utils.js +181 -0
- package/dist/common/utils/scale-utils.js.map +1 -0
- package/dist/contour-layer/bin-options-uniforms.d.ts +13 -0
- package/dist/contour-layer/bin-options-uniforms.d.ts.map +1 -0
- package/dist/contour-layer/bin-options-uniforms.js +18 -0
- package/dist/contour-layer/bin-options-uniforms.js.map +1 -0
- package/dist/contour-layer/contour-layer.d.ts +42 -50
- package/dist/contour-layer/contour-layer.d.ts.map +1 -1
- package/dist/contour-layer/contour-layer.js +233 -192
- package/dist/contour-layer/contour-layer.js.map +1 -0
- package/dist/contour-layer/contour-utils.d.ts +36 -15
- package/dist/contour-layer/contour-utils.d.ts.map +1 -1
- package/dist/contour-layer/contour-utils.js +25 -29
- package/dist/contour-layer/contour-utils.js.map +1 -0
- package/dist/contour-layer/marching-squares-codes.d.ts.map +1 -1
- package/dist/contour-layer/marching-squares-codes.js +4 -0
- package/dist/contour-layer/marching-squares-codes.js.map +1 -0
- package/dist/contour-layer/marching-squares.d.ts +22 -6
- package/dist/contour-layer/marching-squares.d.ts.map +1 -1
- package/dist/contour-layer/marching-squares.js +72 -68
- package/dist/contour-layer/marching-squares.js.map +1 -0
- package/dist/contour-layer/value-reader.d.ts +10 -0
- package/dist/contour-layer/value-reader.d.ts.map +1 -0
- package/dist/contour-layer/value-reader.js +47 -0
- package/dist/contour-layer/value-reader.js.map +1 -0
- package/dist/dist.dev.js +4844 -4083
- package/dist/grid-layer/bin-options-uniforms.d.ts +13 -0
- package/dist/grid-layer/bin-options-uniforms.d.ts.map +1 -0
- package/dist/grid-layer/bin-options-uniforms.js +18 -0
- package/dist/grid-layer/bin-options-uniforms.js.map +1 -0
- package/dist/grid-layer/grid-cell-layer-vertex.glsl.d.ts +3 -0
- package/dist/grid-layer/grid-cell-layer-vertex.glsl.d.ts.map +1 -0
- package/dist/grid-layer/grid-cell-layer-vertex.glsl.js +52 -0
- package/dist/grid-layer/grid-cell-layer-vertex.glsl.js.map +1 -0
- package/dist/grid-layer/grid-cell-layer.d.ts +32 -0
- package/dist/grid-layer/grid-cell-layer.d.ts.map +1 -0
- package/dist/grid-layer/grid-cell-layer.js +94 -0
- package/dist/grid-layer/grid-cell-layer.js.map +1 -0
- package/dist/grid-layer/grid-layer-uniforms.d.ts +21 -0
- package/dist/grid-layer/grid-layer-uniforms.d.ts.map +1 -0
- package/dist/grid-layer/grid-layer-uniforms.js +24 -0
- package/dist/grid-layer/grid-layer-uniforms.js.map +1 -0
- package/dist/grid-layer/grid-layer.d.ts +176 -14
- package/dist/grid-layer/grid-layer.d.ts.map +1 -1
- package/dist/grid-layer/grid-layer.js +343 -46
- package/dist/grid-layer/grid-layer.js.map +1 -0
- package/dist/{aggregation-layer.d.ts → heatmap-layer/aggregation-layer.d.ts} +1 -0
- package/dist/heatmap-layer/aggregation-layer.d.ts.map +1 -0
- package/dist/{aggregation-layer.js → heatmap-layer/aggregation-layer.js} +7 -21
- package/dist/heatmap-layer/aggregation-layer.js.map +1 -0
- package/dist/heatmap-layer/heatmap-layer-uniforms.d.ts +30 -0
- package/dist/heatmap-layer/heatmap-layer-uniforms.d.ts.map +1 -0
- package/dist/heatmap-layer/heatmap-layer-uniforms.js +33 -0
- package/dist/heatmap-layer/heatmap-layer-uniforms.js.map +1 -0
- package/dist/heatmap-layer/heatmap-layer-utils.d.ts +1 -1
- package/dist/heatmap-layer/heatmap-layer-utils.d.ts.map +1 -1
- package/dist/heatmap-layer/heatmap-layer-utils.js +4 -0
- package/dist/heatmap-layer/heatmap-layer-utils.js.map +1 -0
- package/dist/heatmap-layer/heatmap-layer.d.ts +6 -4
- package/dist/heatmap-layer/heatmap-layer.d.ts.map +1 -1
- package/dist/heatmap-layer/heatmap-layer.js +44 -33
- package/dist/heatmap-layer/heatmap-layer.js.map +1 -0
- package/dist/heatmap-layer/max-fs.glsl.d.ts.map +1 -1
- package/dist/heatmap-layer/max-fs.glsl.js +4 -0
- package/dist/heatmap-layer/max-fs.glsl.js.map +1 -0
- package/dist/heatmap-layer/max-vs.glsl.d.ts +1 -1
- package/dist/heatmap-layer/max-vs.glsl.d.ts.map +1 -1
- package/dist/heatmap-layer/max-vs.glsl.js +7 -4
- package/dist/heatmap-layer/max-vs.glsl.js.map +1 -0
- package/dist/heatmap-layer/triangle-layer-fragment.glsl.d.ts +1 -1
- package/dist/heatmap-layer/triangle-layer-fragment.glsl.d.ts.map +1 -1
- package/dist/heatmap-layer/triangle-layer-fragment.glsl.js +6 -23
- package/dist/heatmap-layer/triangle-layer-fragment.glsl.js.map +1 -0
- package/dist/heatmap-layer/triangle-layer-uniforms.d.ts +22 -0
- package/dist/heatmap-layer/triangle-layer-uniforms.d.ts.map +1 -0
- package/dist/heatmap-layer/triangle-layer-uniforms.js +23 -0
- package/dist/heatmap-layer/triangle-layer-uniforms.js.map +1 -0
- package/dist/heatmap-layer/triangle-layer-vertex.glsl.d.ts +1 -1
- package/dist/heatmap-layer/triangle-layer-vertex.glsl.d.ts.map +1 -1
- package/dist/heatmap-layer/triangle-layer-vertex.glsl.js +11 -30
- package/dist/heatmap-layer/triangle-layer-vertex.glsl.js.map +1 -0
- package/dist/heatmap-layer/triangle-layer.d.ts +4 -10
- package/dist/heatmap-layer/triangle-layer.d.ts.map +1 -1
- package/dist/heatmap-layer/triangle-layer.js +18 -30
- package/dist/heatmap-layer/triangle-layer.js.map +1 -0
- package/dist/heatmap-layer/weights-fs.glsl.d.ts.map +1 -1
- package/dist/heatmap-layer/weights-fs.glsl.js +4 -0
- package/dist/heatmap-layer/weights-fs.glsl.js.map +1 -0
- package/dist/heatmap-layer/weights-vs.glsl.d.ts +1 -1
- package/dist/heatmap-layer/weights-vs.glsl.d.ts.map +1 -1
- package/dist/heatmap-layer/weights-vs.glsl.js +7 -7
- package/dist/heatmap-layer/weights-vs.glsl.js.map +1 -0
- package/dist/hexagon-layer/bin-options-uniforms.d.ts +14 -0
- package/dist/hexagon-layer/bin-options-uniforms.d.ts.map +1 -0
- package/dist/hexagon-layer/bin-options-uniforms.js +18 -0
- package/dist/hexagon-layer/bin-options-uniforms.js.map +1 -0
- package/dist/hexagon-layer/hexagon-cell-layer-vertex.glsl.d.ts +3 -0
- package/dist/hexagon-layer/hexagon-cell-layer-vertex.glsl.d.ts.map +1 -0
- package/dist/hexagon-layer/hexagon-cell-layer-vertex.glsl.js +56 -0
- package/dist/hexagon-layer/hexagon-cell-layer-vertex.glsl.js.map +1 -0
- package/dist/hexagon-layer/hexagon-cell-layer.d.ts +29 -0
- package/dist/hexagon-layer/hexagon-cell-layer.d.ts.map +1 -0
- package/dist/hexagon-layer/hexagon-cell-layer.js +95 -0
- package/dist/hexagon-layer/hexagon-cell-layer.js.map +1 -0
- package/dist/hexagon-layer/hexagon-layer-uniforms.d.ts +19 -0
- package/dist/hexagon-layer/hexagon-layer-uniforms.d.ts.map +1 -0
- package/dist/hexagon-layer/hexagon-layer-uniforms.js +22 -0
- package/dist/hexagon-layer/hexagon-layer-uniforms.js.map +1 -0
- package/dist/hexagon-layer/hexagon-layer.d.ts +84 -54
- package/dist/hexagon-layer/hexagon-layer.d.ts.map +1 -1
- package/dist/hexagon-layer/hexagon-layer.js +308 -123
- package/dist/hexagon-layer/hexagon-layer.js.map +1 -0
- package/dist/hexagon-layer/hexbin.d.ts +17 -0
- package/dist/hexagon-layer/hexbin.d.ts.map +1 -0
- package/dist/hexagon-layer/hexbin.js +70 -0
- package/dist/hexagon-layer/hexbin.js.map +1 -0
- package/dist/index.cjs +3026 -2947
- package/dist/index.cjs.map +4 -4
- package/dist/index.d.ts +7 -13
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -27
- package/dist/index.js.map +1 -0
- package/dist/screen-grid-layer/bin-options-uniforms.d.ts +11 -0
- package/dist/screen-grid-layer/bin-options-uniforms.d.ts.map +1 -0
- package/dist/screen-grid-layer/bin-options-uniforms.js +16 -0
- package/dist/screen-grid-layer/bin-options-uniforms.js.map +1 -0
- package/dist/screen-grid-layer/screen-grid-cell-layer.d.ts +11 -16
- package/dist/screen-grid-layer/screen-grid-cell-layer.d.ts.map +1 -1
- package/dist/screen-grid-layer/screen-grid-cell-layer.js +53 -134
- package/dist/screen-grid-layer/screen-grid-cell-layer.js.map +1 -0
- package/dist/screen-grid-layer/screen-grid-layer-fragment.glsl.d.ts +1 -1
- package/dist/screen-grid-layer/screen-grid-layer-fragment.glsl.d.ts.map +1 -1
- package/dist/screen-grid-layer/screen-grid-layer-fragment.glsl.js +5 -24
- package/dist/screen-grid-layer/screen-grid-layer-fragment.glsl.js.map +1 -0
- package/dist/screen-grid-layer/screen-grid-layer-uniforms.d.ts +17 -0
- package/dist/screen-grid-layer/screen-grid-layer-uniforms.d.ts.map +1 -0
- package/dist/screen-grid-layer/screen-grid-layer-uniforms.js +20 -0
- package/dist/screen-grid-layer/screen-grid-layer-uniforms.js.map +1 -0
- package/dist/screen-grid-layer/screen-grid-layer-vertex.glsl.d.ts +1 -1
- package/dist/screen-grid-layer/screen-grid-layer-vertex.glsl.d.ts.map +1 -1
- package/dist/screen-grid-layer/screen-grid-layer-vertex.glsl.js +22 -62
- package/dist/screen-grid-layer/screen-grid-layer-vertex.glsl.js.map +1 -0
- package/dist/screen-grid-layer/screen-grid-layer.d.ts +33 -40
- package/dist/screen-grid-layer/screen-grid-layer.d.ts.map +1 -1
- package/dist/screen-grid-layer/screen-grid-layer.js +158 -174
- package/dist/screen-grid-layer/screen-grid-layer.js.map +1 -0
- package/dist.min.js +401 -382
- package/package.json +10 -9
- package/src/common/aggregation-layer.ts +107 -0
- package/src/common/aggregator/aggregator.ts +88 -0
- package/src/common/aggregator/cpu-aggregator/aggregate.ts +101 -0
- package/src/common/aggregator/cpu-aggregator/cpu-aggregator.ts +203 -0
- package/src/common/aggregator/cpu-aggregator/sort-bins.ts +63 -0
- package/src/common/aggregator/cpu-aggregator/vertex-accessor.ts +86 -0
- package/src/common/aggregator/gpu-aggregator/aggregation-transform-uniforms.ts +33 -0
- package/src/common/aggregator/gpu-aggregator/bin-sorter-uniforms.ts +27 -0
- package/src/common/aggregator/gpu-aggregator/utils.ts +27 -0
- package/src/common/aggregator/gpu-aggregator/webgl-aggregation-transform.ts +247 -0
- package/src/common/aggregator/gpu-aggregator/webgl-aggregator.ts +274 -0
- package/src/common/aggregator/gpu-aggregator/webgl-bin-sorter.ts +258 -0
- package/src/common/aggregator/index.ts +10 -0
- package/src/{types.ts → common/types.ts} +10 -4
- package/src/common/utils/bounds-utils.ts +34 -0
- package/src/common/utils/color-utils.ts +86 -0
- package/src/common/utils/prop-utils.ts +13 -0
- package/src/common/utils/scale-utils.ts +236 -0
- package/src/contour-layer/bin-options-uniforms.ts +26 -0
- package/src/contour-layer/contour-layer.ts +300 -265
- package/src/contour-layer/contour-utils.ts +68 -39
- package/src/contour-layer/marching-squares-codes.ts +4 -0
- package/src/contour-layer/marching-squares.ts +93 -82
- package/src/contour-layer/value-reader.ts +65 -0
- package/src/grid-layer/bin-options-uniforms.ts +26 -0
- package/src/grid-layer/grid-cell-layer-vertex.glsl.ts +68 -0
- package/src/grid-layer/grid-cell-layer.ts +141 -0
- package/src/grid-layer/grid-layer-uniforms.ts +37 -0
- package/src/grid-layer/grid-layer.ts +614 -73
- package/src/{aggregation-layer.ts → heatmap-layer/aggregation-layer.ts} +6 -21
- package/src/heatmap-layer/heatmap-layer-uniforms.ts +50 -0
- package/src/heatmap-layer/heatmap-layer-utils.ts +9 -1
- package/src/heatmap-layer/heatmap-layer.ts +59 -36
- package/src/heatmap-layer/max-fs.glsl.ts +4 -0
- package/src/heatmap-layer/max-vs.glsl.ts +7 -4
- package/src/heatmap-layer/triangle-layer-fragment.glsl.ts +5 -23
- package/src/heatmap-layer/triangle-layer-uniforms.ts +37 -0
- package/src/heatmap-layer/triangle-layer-vertex.glsl.ts +10 -30
- package/src/heatmap-layer/triangle-layer.ts +26 -31
- package/src/heatmap-layer/weights-fs.glsl.ts +4 -0
- package/src/heatmap-layer/weights-vs.glsl.ts +7 -7
- package/src/hexagon-layer/bin-options-uniforms.ts +27 -0
- package/src/hexagon-layer/hexagon-cell-layer-vertex.glsl.ts +73 -0
- package/src/hexagon-layer/hexagon-cell-layer.ts +141 -0
- package/src/hexagon-layer/hexagon-layer-uniforms.ts +34 -0
- package/src/hexagon-layer/hexagon-layer.ts +454 -186
- package/src/hexagon-layer/hexbin.ts +79 -0
- package/src/index.ts +21 -34
- package/src/screen-grid-layer/bin-options-uniforms.ts +23 -0
- package/src/screen-grid-layer/screen-grid-cell-layer.ts +71 -156
- package/src/screen-grid-layer/screen-grid-layer-fragment.glsl.ts +4 -24
- package/src/screen-grid-layer/screen-grid-layer-uniforms.ts +31 -0
- package/src/screen-grid-layer/screen-grid-layer-vertex.glsl.ts +21 -64
- package/src/screen-grid-layer/screen-grid-layer.ts +194 -222
- package/dist/aggregation-layer.d.ts.map +0 -1
- package/dist/cpu-grid-layer/cpu-grid-layer.d.ts +0 -158
- package/dist/cpu-grid-layer/cpu-grid-layer.d.ts.map +0 -1
- package/dist/cpu-grid-layer/cpu-grid-layer.js +0 -130
- package/dist/cpu-grid-layer/grid-aggregator.d.ts +0 -35
- package/dist/cpu-grid-layer/grid-aggregator.d.ts.map +0 -1
- package/dist/cpu-grid-layer/grid-aggregator.js +0 -141
- package/dist/gpu-grid-layer/gpu-grid-cell-layer-fragment.glsl.d.ts +0 -3
- package/dist/gpu-grid-layer/gpu-grid-cell-layer-fragment.glsl.d.ts.map +0 -1
- package/dist/gpu-grid-layer/gpu-grid-cell-layer-fragment.glsl.js +0 -30
- package/dist/gpu-grid-layer/gpu-grid-cell-layer-vertex.glsl.d.ts +0 -3
- package/dist/gpu-grid-layer/gpu-grid-cell-layer-vertex.glsl.d.ts.map +0 -1
- package/dist/gpu-grid-layer/gpu-grid-cell-layer-vertex.glsl.js +0 -112
- package/dist/gpu-grid-layer/gpu-grid-cell-layer.d.ts +0 -48
- package/dist/gpu-grid-layer/gpu-grid-cell-layer.d.ts.map +0 -1
- package/dist/gpu-grid-layer/gpu-grid-cell-layer.js +0 -146
- package/dist/gpu-grid-layer/gpu-grid-layer.d.ts +0 -99
- package/dist/gpu-grid-layer/gpu-grid-layer.d.ts.map +0 -1
- package/dist/gpu-grid-layer/gpu-grid-layer.js +0 -289
- package/dist/grid-aggregation-layer.d.ts +0 -67
- package/dist/grid-aggregation-layer.d.ts.map +0 -1
- package/dist/grid-aggregation-layer.js +0 -173
- package/dist/hexagon-layer/hexagon-aggregator.d.ts +0 -27
- package/dist/hexagon-layer/hexagon-aggregator.d.ts.map +0 -1
- package/dist/hexagon-layer/hexagon-aggregator.js +0 -112
- package/dist/types.d.ts +0 -12
- package/dist/types.d.ts.map +0 -1
- package/dist/types.js +0 -1
- package/dist/utils/aggregation-operation-utils.d.ts +0 -19
- package/dist/utils/aggregation-operation-utils.d.ts.map +0 -1
- package/dist/utils/aggregation-operation-utils.js +0 -94
- package/dist/utils/bin-sorter.d.ts +0 -52
- package/dist/utils/bin-sorter.d.ts.map +0 -1
- package/dist/utils/bin-sorter.js +0 -167
- package/dist/utils/color-utils.d.ts +0 -3
- package/dist/utils/color-utils.d.ts.map +0 -1
- package/dist/utils/color-utils.js +0 -53
- package/dist/utils/cpu-aggregator.d.ts +0 -169
- package/dist/utils/cpu-aggregator.d.ts.map +0 -1
- package/dist/utils/cpu-aggregator.js +0 -421
- package/dist/utils/gpu-grid-aggregation/aggregate-all-fs.glsl.d.ts +0 -3
- package/dist/utils/gpu-grid-aggregation/aggregate-all-fs.glsl.d.ts.map +0 -1
- package/dist/utils/gpu-grid-aggregation/aggregate-all-fs.glsl.js +0 -36
- package/dist/utils/gpu-grid-aggregation/aggregate-all-vs.glsl.d.ts +0 -3
- package/dist/utils/gpu-grid-aggregation/aggregate-all-vs.glsl.d.ts.map +0 -1
- package/dist/utils/gpu-grid-aggregation/aggregate-all-vs.glsl.js +0 -42
- package/dist/utils/gpu-grid-aggregation/aggregate-to-grid-fs.glsl.d.ts +0 -3
- package/dist/utils/gpu-grid-aggregation/aggregate-to-grid-fs.glsl.d.ts.map +0 -1
- package/dist/utils/gpu-grid-aggregation/aggregate-to-grid-fs.glsl.js +0 -30
- package/dist/utils/gpu-grid-aggregation/aggregate-to-grid-vs.glsl.d.ts +0 -3
- package/dist/utils/gpu-grid-aggregation/aggregate-to-grid-vs.glsl.d.ts.map +0 -1
- package/dist/utils/gpu-grid-aggregation/aggregate-to-grid-vs.glsl.js +0 -61
- package/dist/utils/gpu-grid-aggregation/gpu-grid-aggregator-constants.d.ts +0 -38
- package/dist/utils/gpu-grid-aggregation/gpu-grid-aggregator-constants.d.ts.map +0 -1
- package/dist/utils/gpu-grid-aggregation/gpu-grid-aggregator-constants.js +0 -41
- package/dist/utils/gpu-grid-aggregation/gpu-grid-aggregator-utils.d.ts +0 -1
- package/dist/utils/gpu-grid-aggregation/gpu-grid-aggregator-utils.d.ts.map +0 -1
- package/dist/utils/gpu-grid-aggregation/gpu-grid-aggregator-utils.js +0 -1
- package/dist/utils/gpu-grid-aggregation/gpu-grid-aggregator.d.ts +0 -76
- package/dist/utils/gpu-grid-aggregation/gpu-grid-aggregator.d.ts.map +0 -1
- package/dist/utils/gpu-grid-aggregation/gpu-grid-aggregator.js +0 -555
- package/dist/utils/gpu-grid-aggregation/transform-mean-vs.glsl.d.ts +0 -3
- package/dist/utils/gpu-grid-aggregation/transform-mean-vs.glsl.d.ts.map +0 -1
- package/dist/utils/gpu-grid-aggregation/transform-mean-vs.glsl.js +0 -32
- package/dist/utils/grid-aggregation-utils.d.ts +0 -30
- package/dist/utils/grid-aggregation-utils.d.ts.map +0 -1
- package/dist/utils/grid-aggregation-utils.js +0 -114
- package/dist/utils/prop-utils.d.ts.map +0 -1
- package/dist/utils/prop-utils.js +0 -28
- package/dist/utils/resource-utils.d.ts +0 -14
- package/dist/utils/resource-utils.d.ts.map +0 -1
- package/dist/utils/resource-utils.js +0 -38
- package/dist/utils/scale-utils.d.ts +0 -15
- package/dist/utils/scale-utils.d.ts.map +0 -1
- package/dist/utils/scale-utils.js +0 -184
- package/src/cpu-grid-layer/cpu-grid-layer.ts +0 -329
- package/src/cpu-grid-layer/grid-aggregator.ts +0 -184
- package/src/gpu-grid-layer/gpu-grid-cell-layer-fragment.glsl.ts +0 -35
- package/src/gpu-grid-layer/gpu-grid-cell-layer-vertex.glsl.ts +0 -143
- package/src/gpu-grid-layer/gpu-grid-cell-layer.ts +0 -201
- package/src/gpu-grid-layer/gpu-grid-layer.ts +0 -455
- package/src/grid-aggregation-layer.ts +0 -243
- package/src/hexagon-layer/hexagon-aggregator.ts +0 -127
- package/src/utils/aggregation-operation-utils.ts +0 -118
- package/src/utils/bin-sorter.ts +0 -218
- package/src/utils/color-utils.ts +0 -57
- package/src/utils/cpu-aggregator.ts +0 -503
- package/src/utils/gpu-grid-aggregation/aggregate-all-fs.glsl.ts +0 -40
- package/src/utils/gpu-grid-aggregation/aggregate-all-vs.glsl.ts +0 -54
- package/src/utils/gpu-grid-aggregation/aggregate-to-grid-fs.glsl.ts +0 -35
- package/src/utils/gpu-grid-aggregation/aggregate-to-grid-vs.glsl.ts +0 -79
- package/src/utils/gpu-grid-aggregation/gpu-grid-aggregator-constants.ts +0 -46
- package/src/utils/gpu-grid-aggregation/gpu-grid-aggregator-utils.ts +0 -0
- package/src/utils/gpu-grid-aggregation/gpu-grid-aggregator.md +0 -155
- package/src/utils/gpu-grid-aggregation/gpu-grid-aggregator.ts +0 -690
- package/src/utils/gpu-grid-aggregation/transform-mean-vs.glsl.ts +0 -38
- package/src/utils/grid-aggregation-utils.ts +0 -147
- package/src/utils/prop-utils.ts +0 -29
- package/src/utils/resource-utils.ts +0 -53
- package/src/utils/scale-utils.js +0 -219
- /package/dist/{utils → common/utils}/prop-utils.d.ts +0 -0
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
// deck.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// Copyright (c) vis.gl contributors
|
|
4
|
+
export const defaultColorRange = [
|
|
5
|
+
[255, 255, 178],
|
|
6
|
+
[254, 217, 118],
|
|
7
|
+
[254, 178, 76],
|
|
8
|
+
[253, 141, 60],
|
|
9
|
+
[240, 59, 32],
|
|
10
|
+
[189, 0, 38]
|
|
11
|
+
];
|
|
12
|
+
// Converts a colorRange array to a flat array with 4 components per color
|
|
13
|
+
export function colorRangeToFlatArray(colorRange, normalize = false, ArrayType = Float32Array) {
|
|
14
|
+
let flatArray;
|
|
15
|
+
if (Number.isFinite(colorRange[0])) {
|
|
16
|
+
// its already a flat array.
|
|
17
|
+
flatArray = new ArrayType(colorRange);
|
|
18
|
+
}
|
|
19
|
+
else {
|
|
20
|
+
// flatten it
|
|
21
|
+
flatArray = new ArrayType(colorRange.length * 4);
|
|
22
|
+
let index = 0;
|
|
23
|
+
for (let i = 0; i < colorRange.length; i++) {
|
|
24
|
+
const color = colorRange[i];
|
|
25
|
+
flatArray[index++] = color[0];
|
|
26
|
+
flatArray[index++] = color[1];
|
|
27
|
+
flatArray[index++] = color[2];
|
|
28
|
+
flatArray[index++] = Number.isFinite(color[3]) ? color[3] : 255;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
if (normalize) {
|
|
32
|
+
for (let i = 0; i < flatArray.length; i++) {
|
|
33
|
+
flatArray[i] /= 255;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
return flatArray;
|
|
37
|
+
}
|
|
38
|
+
export const COLOR_RANGE_FILTER = {
|
|
39
|
+
linear: 'linear',
|
|
40
|
+
quantile: 'nearest',
|
|
41
|
+
quantize: 'nearest',
|
|
42
|
+
ordinal: 'nearest'
|
|
43
|
+
};
|
|
44
|
+
export function updateColorRangeTexture(texture, type) {
|
|
45
|
+
texture.setSampler({
|
|
46
|
+
minFilter: COLOR_RANGE_FILTER[type],
|
|
47
|
+
magFilter: COLOR_RANGE_FILTER[type]
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
export function createColorRangeTexture(device, colorRange, type = 'linear') {
|
|
51
|
+
const colors = colorRangeToFlatArray(colorRange, false, Uint8Array);
|
|
52
|
+
return device.createTexture({
|
|
53
|
+
format: 'rgba8unorm',
|
|
54
|
+
mipmaps: false,
|
|
55
|
+
sampler: {
|
|
56
|
+
minFilter: COLOR_RANGE_FILTER[type],
|
|
57
|
+
magFilter: COLOR_RANGE_FILTER[type],
|
|
58
|
+
addressModeU: 'clamp-to-edge',
|
|
59
|
+
addressModeV: 'clamp-to-edge'
|
|
60
|
+
},
|
|
61
|
+
data: colors,
|
|
62
|
+
width: colors.length / 4,
|
|
63
|
+
height: 1
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
//# sourceMappingURL=color-utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"color-utils.js","sourceRoot":"","sources":["../../../src/common/utils/color-utils.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,oCAAoC;AAOpC,MAAM,CAAC,MAAM,iBAAiB,GAAY;IACxC,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC;IACf,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC;IACf,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,CAAC;IACd,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,CAAC;IACd,CAAC,GAAG,EAAE,EAAE,EAAE,EA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AAG,CAAC;QACtB,CAAC;IACH,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,MAAM,CAAC,MAAM,kBAAkB,GAA4C;IACzE,MAAM,EAAE,QAAQ;IAChB,QAAQ,EAAE,SAAS;IACnB,QAAQ,EAAE,SAAS;IACnB,OAAO,EAAE,SAAS;CACV,CAAC;AAEX,MAAM,UAAU,uBAAuB,CAAC,OAAgB,EAAE,IAAe;IACvE,OAAO,CAAC,UAAU,CAAC;QACjB,SAAS,EAAE,kBAAkB,CAAC,IAAI,CAAC;QACnC,SAAS,EAAE,kBAAkB,CAAC,IAAI,CAAC;KACpC,CAAC,CAAC;AACL,CAAC;AAED,MAAM,UAAU,uBAAuB,CACrC,MAAc,EACd,UAAkC,EAClC,OAAkB,QAAQ;IAE1B,MAAM,MAAM,GAAG,qBAAqB,CAAC,UAAU,EAAE,KAAK,EAAE,UAAU,CAAC,CAAC;IAEpE,OAAO,MAAM,CAAC,aAAa,CAAC;QAC1B,MAAM,EAAE,YAAY;QACpB,OAAO,EAAE,KAAK;QACd,OAAO,EAAE;YACP,SAAS,EAAE,kBAAkB,CAAC,IAAI,CAAC;YACnC,SAAS,EAAE,kBAAkB,CAAC,IAAI,CAAC;YACnC,YAAY,EAAE,eAAe;YAC7B,YAAY,EAAE,eAAe;SAC9B;QACD,IAAI,EAAE,MAAM;QACZ,KAAK,EAAE,MAAM,CAAC,MAAM,GAAG,CAAC;QACxB,MAAM,EAAE,CAAC;KACV,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prop-utils.d.ts","sourceRoot":"","sources":["../../../src/common/utils/prop-utils.ts"],"names":[],"mappings":"AAIA,wBAAgB,WAAW,CAAC,KAAK,KAAA,EAAE,UAAU,KAAA,MAQ5C"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// deck.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// Copyright (c) vis.gl contributors
|
|
4
|
+
export function filterProps(props, filterKeys) {
|
|
5
|
+
const filteredProps = {};
|
|
6
|
+
for (const key in props) {
|
|
7
|
+
if (!filterKeys.includes(key)) {
|
|
8
|
+
filteredProps[key] = props[key];
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
return filteredProps;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=prop-utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prop-utils.js","sourceRoot":"","sources":["../../../src/common/utils/prop-utils.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,oCAAoC;AAEpC,MAAM,UAAU,WAAW,CAAC,KAAK,EAAE,UAAU;IAC3C,MAAM,aAAa,GAAG,EAAE,CAAC;IACzB,KAAK,MAAM,GAAG,IAAI,KAAK,EAAE,CAAC;QACxB,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;YAC9B,aAAa,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC;QAClC,CAAC;IACH,CAAC;IACD,OAAO,aAAa,CAAC;AACvB,CAAC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { BinaryAttribute } from '@deck.gl/core';
|
|
2
|
+
import type { ScaleType } from "../types.js";
|
|
3
|
+
type ScaleProps = {
|
|
4
|
+
scaleType: ScaleType;
|
|
5
|
+
/** Trim the lower end of the domain by this percentile. Set to `0` to disable. */
|
|
6
|
+
lowerPercentile: number;
|
|
7
|
+
/** Trim the upper end of the domain by this percentile. Set to `100` to disable. */
|
|
8
|
+
upperPercentile: number;
|
|
9
|
+
};
|
|
10
|
+
/** Applies a scale to BinaryAttribute */
|
|
11
|
+
export declare class AttributeWithScale {
|
|
12
|
+
/** Input values accessor. Has either a `value` (CPU aggregation) or a `buffer` (GPU aggregation) */
|
|
13
|
+
private readonly input;
|
|
14
|
+
private readonly inputLength;
|
|
15
|
+
private props;
|
|
16
|
+
private _percentile?;
|
|
17
|
+
private _ordinal?;
|
|
18
|
+
/** Output values accessor */
|
|
19
|
+
attribute: BinaryAttribute;
|
|
20
|
+
/** [min, max] of attribute values, or null if unknown */
|
|
21
|
+
domain: [number, number] | null;
|
|
22
|
+
/** Valid domain if lower/upper percentile are defined */
|
|
23
|
+
cutoff: [number, number] | null;
|
|
24
|
+
constructor(input: BinaryAttribute, inputLength: number);
|
|
25
|
+
private getScalePercentile;
|
|
26
|
+
private getScaleOrdinal;
|
|
27
|
+
/** Returns the [lowerCutoff, upperCutoff] of scaled values, or null if not applicable */
|
|
28
|
+
private getCutoff;
|
|
29
|
+
update(props: ScaleProps): this;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Transform an array of values to ordinal indices
|
|
33
|
+
*/
|
|
34
|
+
export declare function applyScaleOrdinal(values: Float32Array): {
|
|
35
|
+
attribute: BinaryAttribute;
|
|
36
|
+
domain: number[];
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* Transform an array of values to percentiles
|
|
40
|
+
*/
|
|
41
|
+
export declare function applyScaleQuantile(values: Float32Array, rangeLength?: number): {
|
|
42
|
+
attribute: BinaryAttribute;
|
|
43
|
+
domain: number[];
|
|
44
|
+
};
|
|
45
|
+
export {};
|
|
46
|
+
//# sourceMappingURL=scale-utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scale-utils.d.ts","sourceRoot":"","sources":["../../../src/common/utils/scale-utils.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,eAAe,EAAC,MAAM,eAAe,CAAC;AACnD,OAAO,KAAK,EAAC,SAAS,EAAC,oBAAiB;AAExC,KAAK,UAAU,GAAG;IAChB,SAAS,EAAE,SAAS,CAAC;IACrB,kFAAkF;IAClF,eAAe,EAAE,MAAM,CAAC;IACxB,oFAAoF;IACpF,eAAe,EAAE,MAAM,CAAC;CACzB,CAAC;AAEF,yCAAyC;AACzC,qBAAa,kBAAkB;IAC7B,oGAAoG;IACpG,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAkB;IACxC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAS;IAErC,OAAO,CAAC,KAAK,CAIX;IAGF,OAAO,CAAC,WAAW,CAAC,CAAiD;IACrE,OAAO,CAAC,QAAQ,CAAC,CAAiD;IAElE,6BAA6B;IAC7B,SAAS,EAAE,eAAe,CAAC;IAC3B,yDAAyD;IACzD,MAAM,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,CAAQ;IACvC,yDAAyD;IACzD,MAAM,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,CAAQ;gBAE3B,KAAK,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM;IAOvD,OAAO,CAAC,kBAAkB;IAQ1B,OAAO,CAAC,eAAe;IAQvB,yFAAyF;IACzF,OAAO,CAAC,SAAS;IA4BjB,MAAM,CAAC,KAAK,EAAE,UAAU;CAiCzB;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,YAAY,GAAG;IACvD,SAAS,EAAE,eAAe,CAAC;IAC3B,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB,CAqBA;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,YAAY,EACpB,WAAW,SAAM,GAChB;IACD,SAAS,EAAE,eAAe,CAAC;IAC3B,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB,CAgBA"}
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
// deck.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// Copyright (c) vis.gl contributors
|
|
4
|
+
/** Applies a scale to BinaryAttribute */
|
|
5
|
+
export class AttributeWithScale {
|
|
6
|
+
constructor(input, inputLength) {
|
|
7
|
+
this.props = {
|
|
8
|
+
scaleType: 'linear',
|
|
9
|
+
lowerPercentile: 0,
|
|
10
|
+
upperPercentile: 100
|
|
11
|
+
};
|
|
12
|
+
/** [min, max] of attribute values, or null if unknown */
|
|
13
|
+
this.domain = null;
|
|
14
|
+
/** Valid domain if lower/upper percentile are defined */
|
|
15
|
+
this.cutoff = null;
|
|
16
|
+
this.input = input;
|
|
17
|
+
this.inputLength = inputLength;
|
|
18
|
+
// No processing is needed with the default scale
|
|
19
|
+
this.attribute = input;
|
|
20
|
+
}
|
|
21
|
+
getScalePercentile() {
|
|
22
|
+
if (!this._percentile) {
|
|
23
|
+
const value = getAttributeValue(this.input, this.inputLength);
|
|
24
|
+
this._percentile = applyScaleQuantile(value);
|
|
25
|
+
}
|
|
26
|
+
return this._percentile;
|
|
27
|
+
}
|
|
28
|
+
getScaleOrdinal() {
|
|
29
|
+
if (!this._ordinal) {
|
|
30
|
+
const value = getAttributeValue(this.input, this.inputLength);
|
|
31
|
+
this._ordinal = applyScaleOrdinal(value);
|
|
32
|
+
}
|
|
33
|
+
return this._ordinal;
|
|
34
|
+
}
|
|
35
|
+
/** Returns the [lowerCutoff, upperCutoff] of scaled values, or null if not applicable */
|
|
36
|
+
getCutoff({ scaleType, lowerPercentile, upperPercentile }) {
|
|
37
|
+
if (scaleType === 'quantile') {
|
|
38
|
+
return [lowerPercentile, upperPercentile - 1];
|
|
39
|
+
}
|
|
40
|
+
if (lowerPercentile > 0 || upperPercentile < 100) {
|
|
41
|
+
const { domain: thresholds } = this.getScalePercentile();
|
|
42
|
+
let lowValue = thresholds[Math.floor(lowerPercentile) - 1] ?? -Infinity;
|
|
43
|
+
let highValue = thresholds[Math.floor(upperPercentile) - 1] ?? Infinity;
|
|
44
|
+
if (scaleType === 'ordinal') {
|
|
45
|
+
const { domain: sortedUniqueValues } = this.getScaleOrdinal();
|
|
46
|
+
lowValue = sortedUniqueValues.findIndex(x => x >= lowValue);
|
|
47
|
+
highValue = sortedUniqueValues.findIndex(x => x > highValue) - 1;
|
|
48
|
+
if (highValue === -2) {
|
|
49
|
+
highValue = sortedUniqueValues.length - 1;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
return [lowValue, highValue];
|
|
53
|
+
}
|
|
54
|
+
return null;
|
|
55
|
+
}
|
|
56
|
+
update(props) {
|
|
57
|
+
const oldProps = this.props;
|
|
58
|
+
if (props.scaleType !== oldProps.scaleType) {
|
|
59
|
+
switch (props.scaleType) {
|
|
60
|
+
case 'quantile': {
|
|
61
|
+
const { attribute } = this.getScalePercentile();
|
|
62
|
+
this.attribute = attribute;
|
|
63
|
+
this.domain = [0, 99];
|
|
64
|
+
break;
|
|
65
|
+
}
|
|
66
|
+
case 'ordinal': {
|
|
67
|
+
const { attribute, domain } = this.getScaleOrdinal();
|
|
68
|
+
this.attribute = attribute;
|
|
69
|
+
this.domain = [0, domain.length - 1];
|
|
70
|
+
break;
|
|
71
|
+
}
|
|
72
|
+
default:
|
|
73
|
+
this.attribute = this.input;
|
|
74
|
+
this.domain = null;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
if (props.scaleType !== oldProps.scaleType ||
|
|
78
|
+
props.lowerPercentile !== oldProps.lowerPercentile ||
|
|
79
|
+
props.upperPercentile !== oldProps.upperPercentile) {
|
|
80
|
+
this.cutoff = this.getCutoff(props);
|
|
81
|
+
}
|
|
82
|
+
this.props = props;
|
|
83
|
+
return this;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Transform an array of values to ordinal indices
|
|
88
|
+
*/
|
|
89
|
+
export function applyScaleOrdinal(values) {
|
|
90
|
+
const uniqueValues = new Set();
|
|
91
|
+
for (const x of values) {
|
|
92
|
+
if (Number.isFinite(x)) {
|
|
93
|
+
uniqueValues.add(x);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
const sortedUniqueValues = Array.from(uniqueValues).sort();
|
|
97
|
+
const domainMap = new Map();
|
|
98
|
+
for (let i = 0; i < sortedUniqueValues.length; i++) {
|
|
99
|
+
domainMap.set(sortedUniqueValues[i], i);
|
|
100
|
+
}
|
|
101
|
+
return {
|
|
102
|
+
attribute: {
|
|
103
|
+
value: values.map(x => (Number.isFinite(x) ? domainMap.get(x) : NaN)),
|
|
104
|
+
type: 'float32',
|
|
105
|
+
size: 1
|
|
106
|
+
},
|
|
107
|
+
domain: sortedUniqueValues
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Transform an array of values to percentiles
|
|
112
|
+
*/
|
|
113
|
+
export function applyScaleQuantile(values, rangeLength = 100) {
|
|
114
|
+
const sortedValues = Array.from(values).filter(Number.isFinite).sort(ascending);
|
|
115
|
+
let i = 0;
|
|
116
|
+
const n = Math.max(1, rangeLength);
|
|
117
|
+
const thresholds = new Array(n - 1);
|
|
118
|
+
while (++i < n) {
|
|
119
|
+
thresholds[i - 1] = threshold(sortedValues, i / n);
|
|
120
|
+
}
|
|
121
|
+
return {
|
|
122
|
+
attribute: {
|
|
123
|
+
value: values.map(x => (Number.isFinite(x) ? bisectRight(thresholds, x) : NaN)),
|
|
124
|
+
type: 'float32',
|
|
125
|
+
size: 1
|
|
126
|
+
},
|
|
127
|
+
domain: thresholds
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
function getAttributeValue(attribute, length) {
|
|
131
|
+
const elementStride = (attribute.stride ?? 4) / 4;
|
|
132
|
+
const elementOffset = (attribute.offset ?? 0) / 4;
|
|
133
|
+
let value = attribute.value;
|
|
134
|
+
if (!value) {
|
|
135
|
+
const bytes = attribute.buffer?.readSyncWebGL(0, elementStride * 4 * length);
|
|
136
|
+
if (bytes) {
|
|
137
|
+
value = new Float32Array(bytes.buffer);
|
|
138
|
+
attribute.value = value;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
if (elementStride === 1) {
|
|
142
|
+
return value.subarray(0, length);
|
|
143
|
+
}
|
|
144
|
+
const result = new Float32Array(length);
|
|
145
|
+
for (let i = 0; i < length; i++) {
|
|
146
|
+
result[i] = value[i * elementStride + elementOffset];
|
|
147
|
+
}
|
|
148
|
+
return result;
|
|
149
|
+
}
|
|
150
|
+
function ascending(a, b) {
|
|
151
|
+
return a - b;
|
|
152
|
+
}
|
|
153
|
+
function threshold(domain, fraction) {
|
|
154
|
+
const domainLength = domain.length;
|
|
155
|
+
if (fraction <= 0 || domainLength < 2) {
|
|
156
|
+
return domain[0];
|
|
157
|
+
}
|
|
158
|
+
if (fraction >= 1) {
|
|
159
|
+
return domain[domainLength - 1];
|
|
160
|
+
}
|
|
161
|
+
const domainFraction = (domainLength - 1) * fraction;
|
|
162
|
+
const lowIndex = Math.floor(domainFraction);
|
|
163
|
+
const low = domain[lowIndex];
|
|
164
|
+
const high = domain[lowIndex + 1];
|
|
165
|
+
return low + (high - low) * (domainFraction - lowIndex);
|
|
166
|
+
}
|
|
167
|
+
function bisectRight(a, x) {
|
|
168
|
+
let lo = 0;
|
|
169
|
+
let hi = a.length;
|
|
170
|
+
while (lo < hi) {
|
|
171
|
+
const mid = (lo + hi) >>> 1;
|
|
172
|
+
if (a[mid] > x) {
|
|
173
|
+
hi = mid;
|
|
174
|
+
}
|
|
175
|
+
else {
|
|
176
|
+
lo = mid + 1;
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
return lo;
|
|
180
|
+
}
|
|
181
|
+
//# sourceMappingURL=scale-utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scale-utils.js","sourceRoot":"","sources":["../../../src/common/utils/scale-utils.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,oCAAoC;AAapC,yCAAyC;AACzC,MAAM,OAAO,kBAAkB;IAsB7B,YAAY,KAAsB,EAAE,WAAmB;QAjB/C,UAAK,GAAe;YAC1B,SAAS,EAAE,QAAQ;YACnB,eAAe,EAAE,CAAC;YAClB,eAAe,EAAE,GAAG;SACrB,CAAC;QAQF,yDAAyD;QACzD,WAAM,GAA4B,IAAI,CAAC;QACvC,yDAAyD;QACzD,WAAM,GAA4B,IAAI,CAAC;QAGrC,IAAI,CAAC,KAAK,G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AAY,GAAG,CAAC,CAAC,CAAC;IAClC,CAAC;IAED,MAAM,cAAc,GAAG,CAAC,YAAY,GAAG,CAAC,CAAC,GAAG,QAAQ,CAAC;IACrD,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC;IAC5C,MAAM,GAAG,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC;IAC7B,MAAM,IAAI,GAAG,MAAM,CAAC,QAAQ,GAAG,CAAC,CAAC,CAAC;IAClC,OAAO,GAAG,GAAG,CAAC,IAAI,GAAG,GAAG,CAAC,GAAG,CAAC,cAAc,GAAG,QAAQ,CAAC,CAAC;AAC1D,CAAC;AAED,SAAS,WAAW,CAAC,CAAW,EAAE,CAAS;IACzC,IAAI,EAAE,GAAG,CAAC,CAAC;IACX,IAAI,EAAE,GAAG,CAAC,CAAC,MAAM,CAAC;IAClB,OAAO,EAAE,GAAG,EAAE,EAAE,CAAC;QACf,MAAM,GAAG,GAAG,CAAC,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,CAAC;QAC5B,IAAI,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC;YACf,EAAE,GAAG,GAAG,CAAC;QACX,CAAC;aAAM,CAAC;YACN,EAAE,GAAG,GAAG,GAAG,CAAC,CAAC;QACf,CAAC;IACH,CAAC;IACD,OAAO,EAAE,CAAC;AACZ,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export type BinOptions = {
|
|
2
|
+
cellOriginCommon: [number, number];
|
|
3
|
+
cellSizeCommon: [number, number];
|
|
4
|
+
};
|
|
5
|
+
export declare const binOptionsUniforms: {
|
|
6
|
+
readonly name: "binOptions";
|
|
7
|
+
readonly vs: "uniform binOptionsUniforms {\n vec2 cellOriginCommon;\n vec2 cellSizeCommon;\n} binOptions;\n";
|
|
8
|
+
readonly uniformTypes: {
|
|
9
|
+
readonly cellOriginCommon: "vec2<f32>";
|
|
10
|
+
readonly cellSizeCommon: "vec2<f32>";
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=bin-options-uniforms.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bin-options-uniforms.d.ts","sourceRoot":"","sources":["../../src/contour-layer/bin-options-uniforms.ts"],"names":[],"mappings":"AAaA,MAAM,MAAM,UAAU,GAAG;IACvB,gBAAgB,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACnC,cAAc,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAClC,CAAC;AAEF,eAAO,MAAM,kBAAkB;;;;;;;CAOc,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// deck.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// Copyright (c) vis.gl contributors
|
|
4
|
+
const uniformBlock = /* glsl */ `\
|
|
5
|
+
uniform binOptionsUniforms {
|
|
6
|
+
vec2 cellOriginCommon;
|
|
7
|
+
vec2 cellSizeCommon;
|
|
8
|
+
} binOptions;
|
|
9
|
+
`;
|
|
10
|
+
export const binOptionsUniforms = {
|
|
11
|
+
name: 'binOptions',
|
|
12
|
+
vs: uniformBlock,
|
|
13
|
+
uniformTypes: {
|
|
14
|
+
cellOriginCommon: 'vec2<f32>',
|
|
15
|
+
cellSizeCommon: 'vec2<f32>'
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=bin-options-uniforms.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bin-options-uniforms.js","sourceRoot":"","sources":["../../src/contour-layer/bin-options-uniforms.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,oCAAoC;AAIpC,MAAM,YAAY,GAAG,UAAU,CAAC;;;;;CAK/B,CAAC;AAOF,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,IAAI,EAAE,YAAY;IAClB,EAAE,EAAE,YAAY;IAChB,YAAY,EAAE;QACZ,gBAAgB,EAAE,WAAW;QAC7B,cAAc,EAAE,WAAW;KAC5B;CAC0C,CAAC"}
|
|
@@ -1,48 +1,38 @@
|
|
|
1
|
-
import { Accessor,
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { Accessor, GetPickingInfoParams, LayersList, PickingInfo, Position, Viewport, UpdateParameters, DefaultProps } from '@deck.gl/core';
|
|
2
|
+
import { WebGLAggregator, CPUAggregator, AggregationOperation } from "../common/aggregator/index.js";
|
|
3
|
+
import AggregationLayer from "../common/aggregation-layer.js";
|
|
4
|
+
import { AggregationLayerProps } from "../common/aggregation-layer.js";
|
|
5
|
+
import { Contour, ContourLine, ContourPolygon } from "./contour-utils.js";
|
|
6
|
+
import { BinOptions } from "./bin-options-uniforms.js";
|
|
7
|
+
/** All properties supported by GridLayer. */
|
|
8
|
+
export type ContourLayerProps<DataT = unknown> = _ContourLayerProps<DataT> & AggregationLayerProps<DataT>;
|
|
9
|
+
/** Properties added by GridLayer. */
|
|
10
|
+
type _ContourLayerProps<DataT> = {
|
|
7
11
|
/**
|
|
8
12
|
* Size of each cell in meters.
|
|
9
13
|
* @default 1000
|
|
10
14
|
*/
|
|
11
15
|
cellSize?: number;
|
|
16
|
+
/**
|
|
17
|
+
* The grid origin
|
|
18
|
+
* @default [0, 0]
|
|
19
|
+
*/
|
|
20
|
+
gridOrigin?: [number, number];
|
|
12
21
|
/**
|
|
13
22
|
* When set to true, aggregation is performed on GPU, provided other conditions are met.
|
|
14
|
-
* @default
|
|
23
|
+
* @default false
|
|
15
24
|
*/
|
|
16
25
|
gpuAggregation?: boolean;
|
|
17
26
|
/**
|
|
18
27
|
* Defines the type of aggregation operation, valid values are 'SUM', 'MEAN', 'MIN' and 'MAX'.
|
|
19
28
|
* @default 'SUM'
|
|
20
29
|
*/
|
|
21
|
-
aggregation?:
|
|
30
|
+
aggregation?: AggregationOperation;
|
|
22
31
|
/**
|
|
23
32
|
* Definition of contours to be drawn.
|
|
24
33
|
* @default [{threshold: 1}]
|
|
25
34
|
*/
|
|
26
|
-
contours
|
|
27
|
-
/**
|
|
28
|
-
* Isolines: `threshold` value must be a single `Number`, Isolines are generated based on this threshold value.
|
|
29
|
-
*
|
|
30
|
-
* Isobands: `threshold` value must be an Array of two `Number`s. Isobands are generated using `[threshold[0], threshold[1])` as threshold range, i.e area that has values `>= threshold[0]` and `< threshold[1]` are rendered with corresponding color. NOTE: `threshold[0]` is inclusive and `threshold[1]` is not inclusive.
|
|
31
|
-
*/
|
|
32
|
-
threshold: number | number[];
|
|
33
|
-
/**
|
|
34
|
-
* RGBA color array to be used to render the contour.
|
|
35
|
-
* @default [255, 255, 255, 255]
|
|
36
|
-
*/
|
|
37
|
-
color?: Color;
|
|
38
|
-
/**
|
|
39
|
-
* Applicable for `Isoline`s only, width of the Isoline in pixels.
|
|
40
|
-
* @default 1
|
|
41
|
-
*/
|
|
42
|
-
strokeWidth?: number;
|
|
43
|
-
/** Defines z order of the contour. */
|
|
44
|
-
zIndex?: number;
|
|
45
|
-
}[];
|
|
35
|
+
contours?: Contour[];
|
|
46
36
|
/**
|
|
47
37
|
* A very small z offset that is added for each vertex of a contour (Isoline or Isoband).
|
|
48
38
|
* @default 0.005
|
|
@@ -52,38 +42,40 @@ export type _ContourLayerProps<DataT> = {
|
|
|
52
42
|
* Method called to retrieve the position of each object.
|
|
53
43
|
* @default object => object.position
|
|
54
44
|
*/
|
|
55
|
-
getPosition?:
|
|
45
|
+
getPosition?: Accessor<DataT, Position>;
|
|
56
46
|
/**
|
|
57
47
|
* The weight of each object.
|
|
58
48
|
* @default 1
|
|
59
49
|
*/
|
|
60
50
|
getWeight?: Accessor<DataT, number>;
|
|
61
51
|
};
|
|
62
|
-
|
|
63
|
-
|
|
52
|
+
export type ContourLayerPickingInfo = PickingInfo<{
|
|
53
|
+
contour: Contour;
|
|
54
|
+
}>;
|
|
55
|
+
/** Aggregate data into a grid-based heatmap. The color and height of a cell are determined based on the objects it contains. */
|
|
56
|
+
export default class GridLayer<DataT = any, ExtraPropsT extends {} = {}> extends AggregationLayer<DataT, ExtraPropsT & Required<_ContourLayerProps<DataT>>> {
|
|
64
57
|
static layerName: string;
|
|
65
58
|
static defaultProps: DefaultProps<ContourLayerProps<unknown>>;
|
|
66
|
-
state:
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
contour: any;
|
|
72
|
-
}[];
|
|
73
|
-
contourPolygons: {
|
|
74
|
-
vertices: number[][];
|
|
75
|
-
contour: any;
|
|
76
|
-
}[];
|
|
59
|
+
state: AggregationLayer<DataT>['state'] & BinOptions & {
|
|
60
|
+
aggregatedValueReader?: (x: number, y: number) => number;
|
|
61
|
+
contourData?: {
|
|
62
|
+
lines: ContourLine[];
|
|
63
|
+
polygons: ContourPolygon[];
|
|
77
64
|
};
|
|
78
|
-
|
|
65
|
+
binIdRange: [number, number][];
|
|
66
|
+
aggregatorViewport: Viewport;
|
|
79
67
|
};
|
|
68
|
+
getAggregatorType(): string;
|
|
69
|
+
createAggregator(type: string): WebGLAggregator | CPUAggregator;
|
|
80
70
|
initializeState(): void;
|
|
81
|
-
updateState(
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
private
|
|
85
|
-
private
|
|
86
|
-
|
|
87
|
-
|
|
71
|
+
updateState(params: UpdateParameters<this>): boolean;
|
|
72
|
+
private _updateBinOptions;
|
|
73
|
+
draw(opts: any): void;
|
|
74
|
+
private _onAggregationUpdate;
|
|
75
|
+
private _getContours;
|
|
76
|
+
onAttributeChange(id: string): void;
|
|
77
|
+
renderLayers(): LayersList | null;
|
|
78
|
+
getPickingInfo(params: GetPickingInfoParams): ContourLayerPickingInfo;
|
|
88
79
|
}
|
|
80
|
+
export {};
|
|
89
81
|
//# sourceMappingURL=contour-layer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contour-layer.d.ts","sourceRoot":"","sources":["../../src/contour-layer/contour-layer.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"contour-layer.d.ts","sourceRoot":"","sources":["../../src/contour-layer/contour-layer.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,QAAQ,EAER,oBAAoB,EAEpB,UAAU,EACV,WAAW,EACX,QAAQ,EACR,QAAQ,EAER,gBAAgB,EAChB,YAAY,EACb,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAC,eAAe,EAAE,aAAa,EAAE,oBAAoB,EAAC,sCAAmC;AAChG,OAAO,gBAAgB,uCAAoC;AAC3D,OAAO,EAAC,qBAAqB,EAAC,uCAAoC;AAClE,OAAO,EAAmB,OAAO,EAAE,WAAW,EAAE,cAAc,EAAC,2BAAwB;AAIvF,OAAO,EAAC,UAAU,EAAqB,kCAA+B;AAyBtE,6CAA6C;AAC7C,MAAM,MAAM,iBAAiB,CAAC,KAAK,GAAG,OAAO,IAAI,kBAAkB,CAAC,KAAK,CAAC,GACxE,qBAAqB,CAAC,KAAK,CAAC,CAAC;AAE/B,qCAAqC;AACrC,KAAK,kBAAkB,CAAC,KAAK,IAAI;IAC/B;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;;OAGG;IACH,UAAU,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAE9B;;;OAGG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IAEzB;;;OAGG;IACH,WAAW,CAAC,EAAE,oBAAoB,CAAC;IAEnC;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,EAAE,CAAC;IAErB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;;OAGG;IACH,WAAW,CAAC,EAAE,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;IAExC;;;OAGG;IACH,SAAS,CAAC,EAAE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;CACrC,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAA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