@deck.gl/aggregation-layers 9.0.0-beta.1 → 9.0.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/aggregation-layer.js +153 -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/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 +1187 -10528
- 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/dist/gpu-grid-layer/gpu-grid-cell-layer.js +145 -0
- package/dist/gpu-grid-layer/gpu-grid-layer.js +288 -0
- package/dist/grid-aggregation-layer.js +172 -0
- package/dist/grid-layer/grid-layer.js +63 -0
- package/{typed → dist}/heatmap-layer/heatmap-layer-utils.d.ts +0 -9
- package/dist/heatmap-layer/heatmap-layer-utils.d.ts.map +1 -0
- package/dist/heatmap-layer/heatmap-layer-utils.js +63 -0
- package/{typed → dist}/heatmap-layer/heatmap-layer.d.ts +4 -4
- 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/heatmap-layer/max-vs.glsl.d.ts +3 -0
- package/{typed → dist}/heatmap-layer/max-vs.glsl.d.ts.map +1 -1
- package/dist/heatmap-layer/max-vs.glsl.js +19 -0
- package/dist/heatmap-layer/triangle-layer-fragment.glsl.d.ts +3 -0
- package/dist/heatmap-layer/triangle-layer-fragment.glsl.js +61 -0
- package/dist/heatmap-layer/triangle-layer-vertex.glsl.js +52 -0
- package/{typed → dist}/heatmap-layer/triangle-layer.d.ts +10 -2
- package/dist/heatmap-layer/triangle-layer.d.ts.map +1 -0
- package/dist/heatmap-layer/triangle-layer.js +59 -0
- package/dist/{esm/heatmap-layer → heatmap-layer}/weights-fs.glsl.js +0 -1
- package/dist/heatmap-layer/weights-vs.glsl.d.ts +3 -0
- package/{typed → dist}/heatmap-layer/weights-vs.glsl.d.ts.map +1 -1
- package/dist/{esm/heatmap-layer → heatmap-layer}/weights-vs.glsl.js +4 -3
- package/dist/hexagon-layer/hexagon-aggregator.js +112 -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.js +32 -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/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 +74 -178
- package/package.json +18 -11
- package/src/heatmap-layer/heatmap-layer-utils.ts +0 -23
- package/src/heatmap-layer/heatmap-layer.ts +87 -105
- package/src/heatmap-layer/max-vs.glsl.ts +11 -5
- package/src/heatmap-layer/triangle-layer-fragment.glsl.ts +2 -2
- package/src/heatmap-layer/triangle-layer.ts +17 -23
- package/src/heatmap-layer/weights-vs.glsl.ts +4 -2
- package/src/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 -122
- package/dist/es5/heatmap-layer/heatmap-layer-utils.js.map +0 -1
- package/dist/es5/heatmap-layer/heatmap-layer.js +0 -672
- package/dist/es5/heatmap-layer/heatmap-layer.js.map +0 -1
- package/dist/es5/heatmap-layer/max-fs.glsl.js +0 -9
- package/dist/es5/heatmap-layer/max-fs.glsl.js.map +0 -1
- package/dist/es5/heatmap-layer/max-vs.glsl.js +0 -9
- package/dist/es5/heatmap-layer/max-vs.glsl.js.map +0 -1
- package/dist/es5/heatmap-layer/triangle-layer-fragment.glsl.js +0 -9
- package/dist/es5/heatmap-layer/triangle-layer-fragment.glsl.js.map +0 -1
- package/dist/es5/heatmap-layer/triangle-layer-vertex.glsl.js +0 -9
- package/dist/es5/heatmap-layer/triangle-layer-vertex.glsl.js.map +0 -1
- package/dist/es5/heatmap-layer/triangle-layer.js +0 -122
- package/dist/es5/heatmap-layer/triangle-layer.js.map +0 -1
- package/dist/es5/heatmap-layer/weights-fs.glsl.js +0 -9
- package/dist/es5/heatmap-layer/weights-fs.glsl.js.map +0 -1
- package/dist/es5/heatmap-layer/weights-vs.glsl.js +0 -9
- package/dist/es5/heatmap-layer/weights-vs.glsl.js.map +0 -1
- package/dist/es5/hexagon-layer/hexagon-aggregator.js +0 -118
- package/dist/es5/hexagon-layer/hexagon-aggregator.js.map +0 -1
- package/dist/es5/hexagon-layer/hexagon-layer.js +0 -289
- package/dist/es5/hexagon-layer/hexagon-layer.js.map +0 -1
- package/dist/es5/index.js +0 -104
- package/dist/es5/index.js.map +0 -1
- package/dist/es5/screen-grid-layer/screen-grid-cell-layer.js +0 -244
- package/dist/es5/screen-grid-layer/screen-grid-cell-layer.js.map +0 -1
- package/dist/es5/screen-grid-layer/screen-grid-layer-fragment.glsl.js +0 -9
- package/dist/es5/screen-grid-layer/screen-grid-layer-fragment.glsl.js.map +0 -1
- package/dist/es5/screen-grid-layer/screen-grid-layer-vertex.glsl.js +0 -9
- package/dist/es5/screen-grid-layer/screen-grid-layer-vertex.glsl.js.map +0 -1
- package/dist/es5/screen-grid-layer/screen-grid-layer.js +0 -317
- package/dist/es5/screen-grid-layer/screen-grid-layer.js.map +0 -1
- package/dist/es5/types.js +0 -2
- package/dist/es5/types.js.map +0 -1
- package/dist/es5/utils/aggregation-operation-utils.js +0 -123
- package/dist/es5/utils/aggregation-operation-utils.js.map +0 -1
- package/dist/es5/utils/bin-sorter.js +0 -248
- package/dist/es5/utils/bin-sorter.js.map +0 -1
- package/dist/es5/utils/color-utils.js +0 -39
- package/dist/es5/utils/color-utils.js.map +0 -1
- package/dist/es5/utils/cpu-aggregator.js +0 -496
- package/dist/es5/utils/cpu-aggregator.js.map +0 -1
- package/dist/es5/utils/gpu-grid-aggregation/aggregate-all-fs.glsl.js +0 -9
- package/dist/es5/utils/gpu-grid-aggregation/aggregate-all-fs.glsl.js.map +0 -1
- package/dist/es5/utils/gpu-grid-aggregation/aggregate-all-vs.glsl.js +0 -9
- package/dist/es5/utils/gpu-grid-aggregation/aggregate-all-vs.glsl.js.map +0 -1
- package/dist/es5/utils/gpu-grid-aggregation/aggregate-to-grid-fs.glsl.js +0 -9
- package/dist/es5/utils/gpu-grid-aggregation/aggregate-to-grid-fs.glsl.js.map +0 -1
- package/dist/es5/utils/gpu-grid-aggregation/aggregate-to-grid-vs.glsl.js +0 -9
- package/dist/es5/utils/gpu-grid-aggregation/aggregate-to-grid-vs.glsl.js.map +0 -1
- package/dist/es5/utils/gpu-grid-aggregation/gpu-grid-aggregator-constants.js +0 -63
- package/dist/es5/utils/gpu-grid-aggregation/gpu-grid-aggregator-constants.js.map +0 -1
- package/dist/es5/utils/gpu-grid-aggregation/gpu-grid-aggregator-utils.js +0 -2
- package/dist/es5/utils/gpu-grid-aggregation/gpu-grid-aggregator-utils.js.map +0 -1
- package/dist/es5/utils/gpu-grid-aggregation/gpu-grid-aggregator.js +0 -732
- package/dist/es5/utils/gpu-grid-aggregation/gpu-grid-aggregator.js.map +0 -1
- package/dist/es5/utils/gpu-grid-aggregation/gpu-grid-aggregator.md +0 -155
- package/dist/es5/utils/gpu-grid-aggregation/transform-mean-vs.glsl.js +0 -9
- package/dist/es5/utils/gpu-grid-aggregation/transform-mean-vs.glsl.js.map +0 -1
- package/dist/es5/utils/grid-aggregation-utils.js +0 -118
- package/dist/es5/utils/grid-aggregation-utils.js.map +0 -1
- package/dist/es5/utils/prop-utils.js +0 -19
- package/dist/es5/utils/prop-utils.js.map +0 -1
- package/dist/es5/utils/resource-utils.js +0 -59
- package/dist/es5/utils/resource-utils.js.map +0 -1
- package/dist/es5/utils/scale-utils.js +0 -254
- package/dist/es5/utils/scale-utils.js.map +0 -1
- package/dist/esm/aggregation-layer.js +0 -156
- package/dist/esm/aggregation-layer.js.map +0 -1
- package/dist/esm/contour-layer/contour-layer.js +0 -316
- package/dist/esm/contour-layer/contour-layer.js.map +0 -1
- package/dist/esm/contour-layer/contour-utils.js +0 -81
- package/dist/esm/contour-layer/contour-utils.js.map +0 -1
- package/dist/esm/contour-layer/marching-squares-codes.js +0 -219
- package/dist/esm/contour-layer/marching-squares-codes.js.map +0 -1
- package/dist/esm/contour-layer/marching-squares.js +0 -151
- package/dist/esm/contour-layer/marching-squares.js.map +0 -1
- package/dist/esm/cpu-grid-layer/cpu-grid-layer.js +0 -186
- package/dist/esm/cpu-grid-layer/cpu-grid-layer.js.map +0 -1
- package/dist/esm/cpu-grid-layer/grid-aggregator.js +0 -142
- package/dist/esm/cpu-grid-layer/grid-aggregator.js.map +0 -1
- package/dist/esm/gpu-grid-layer/gpu-grid-cell-layer-fragment.glsl.js +0 -16
- package/dist/esm/gpu-grid-layer/gpu-grid-cell-layer-fragment.glsl.js.map +0 -1
- package/dist/esm/gpu-grid-layer/gpu-grid-cell-layer-vertex.glsl.js.map +0 -1
- package/dist/esm/gpu-grid-layer/gpu-grid-cell-layer.js +0 -196
- package/dist/esm/gpu-grid-layer/gpu-grid-cell-layer.js.map +0 -1
- package/dist/esm/gpu-grid-layer/gpu-grid-layer.js +0 -399
- package/dist/esm/gpu-grid-layer/gpu-grid-layer.js.map +0 -1
- package/dist/esm/grid-aggregation-layer.js +0 -240
- package/dist/esm/grid-aggregation-layer.js.map +0 -1
- package/dist/esm/grid-layer/grid-layer.js +0 -80
- package/dist/esm/grid-layer/grid-layer.js.map +0 -1
- package/dist/esm/heatmap-layer/heatmap-layer-utils.js +0 -68
- package/dist/esm/heatmap-layer/heatmap-layer-utils.js.map +0 -1
- package/dist/esm/heatmap-layer/heatmap-layer.js +0 -626
- package/dist/esm/heatmap-layer/heatmap-layer.js.map +0 -1
- package/dist/esm/heatmap-layer/max-fs.glsl.js.map +0 -1
- package/dist/esm/heatmap-layer/max-vs.glsl.js +0 -14
- package/dist/esm/heatmap-layer/max-vs.glsl.js.map +0 -1
- package/dist/esm/heatmap-layer/triangle-layer-fragment.glsl.js +0 -43
- package/dist/esm/heatmap-layer/triangle-layer-fragment.glsl.js.map +0 -1
- package/dist/esm/heatmap-layer/triangle-layer-vertex.glsl.js +0 -33
- package/dist/esm/heatmap-layer/triangle-layer-vertex.glsl.js.map +0 -1
- package/dist/esm/heatmap-layer/triangle-layer.js +0 -80
- package/dist/esm/heatmap-layer/triangle-layer.js.map +0 -1
- package/dist/esm/heatmap-layer/weights-fs.glsl.js.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/heatmap-layer/heatmap-layer-utils.d.ts.map +0 -1
- package/typed/heatmap-layer/heatmap-layer.d.ts.map +0 -1
- package/typed/heatmap-layer/max-vs.glsl.d.ts +0 -3
- package/typed/heatmap-layer/triangle-layer-fragment.glsl.d.ts +0 -3
- package/typed/heatmap-layer/triangle-layer.d.ts.map +0 -1
- package/typed/heatmap-layer/weights-vs.glsl.d.ts +0 -3
- /package/{typed → dist}/aggregation-layer.d.ts +0 -0
- /package/{typed → dist}/aggregation-layer.d.ts.map +0 -0
- /package/{typed → dist}/contour-layer/contour-layer.d.ts +0 -0
- /package/{typed → dist}/contour-layer/contour-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/cpu-grid-layer.d.ts +0 -0
- /package/{typed → dist}/cpu-grid-layer/cpu-grid-layer.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}/gpu-grid-layer/gpu-grid-cell-layer.d.ts +0 -0
- /package/{typed → dist}/gpu-grid-layer/gpu-grid-cell-layer.d.ts.map +0 -0
- /package/{typed → dist}/gpu-grid-layer/gpu-grid-layer.d.ts +0 -0
- /package/{typed → dist}/gpu-grid-layer/gpu-grid-layer.d.ts.map +0 -0
- /package/{typed → dist}/grid-aggregation-layer.d.ts +0 -0
- /package/{typed → dist}/grid-aggregation-layer.d.ts.map +0 -0
- /package/{typed → dist}/grid-layer/grid-layer.d.ts +0 -0
- /package/{typed → dist}/grid-layer/grid-layer.d.ts.map +0 -0
- /package/{typed → dist}/heatmap-layer/max-fs.glsl.d.ts +0 -0
- /package/{typed → dist}/heatmap-layer/max-fs.glsl.d.ts.map +0 -0
- /package/{typed → dist}/heatmap-layer/triangle-layer-fragment.glsl.d.ts.map +0 -0
- /package/{typed → dist}/heatmap-layer/triangle-layer-vertex.glsl.d.ts +0 -0
- /package/{typed → dist}/heatmap-layer/triangle-layer-vertex.glsl.d.ts.map +0 -0
- /package/{typed → dist}/heatmap-layer/weights-fs.glsl.d.ts +0 -0
- /package/{typed → dist}/heatmap-layer/weights-fs.glsl.d.ts.map +0 -0
- /package/{typed → dist}/hexagon-layer/hexagon-aggregator.d.ts +0 -0
- /package/{typed → dist}/hexagon-layer/hexagon-aggregator.d.ts.map +0 -0
- /package/{typed → dist}/hexagon-layer/hexagon-layer.d.ts +0 -0
- /package/{typed → dist}/hexagon-layer/hexagon-layer.d.ts.map +0 -0
- /package/{typed → dist}/index.d.ts +0 -0
- /package/{typed → dist}/index.d.ts.map +0 -0
- /package/{typed → dist}/screen-grid-layer/screen-grid-cell-layer.d.ts +0 -0
- /package/{typed → dist}/screen-grid-layer/screen-grid-cell-layer.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}/screen-grid-layer/screen-grid-layer.d.ts +0 -0
- /package/{typed → dist}/screen-grid-layer/screen-grid-layer.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
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export default `\
|
|
2
|
+
#version 300 es
|
|
3
|
+
uniform sampler2D inTexture;
|
|
4
|
+
uniform float textureSize;
|
|
5
|
+
out vec4 outTexture;
|
|
6
|
+
|
|
7
|
+
void main()
|
|
8
|
+
{
|
|
9
|
+
// Sample every pixel in texture
|
|
10
|
+
int yIndex = gl_VertexID / int(textureSize);
|
|
11
|
+
int xIndex = gl_VertexID - (yIndex * int(textureSize));
|
|
12
|
+
vec2 uv = (0.5 + vec2(float(xIndex), float(yIndex))) / textureSize;
|
|
13
|
+
outTexture = texture(inTexture, uv);
|
|
14
|
+
|
|
15
|
+
gl_Position = vec4(0.0, 0.0, 0.0, 1.0);
|
|
16
|
+
// Enforce default value for ANGLE issue (https://bugs.chromium.org/p/angleproject/issues/detail?id=3941)
|
|
17
|
+
gl_PointSize = 1.0;
|
|
18
|
+
}
|
|
19
|
+
`;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
declare const _default: "#version 300 es\n#define SHADER_NAME triangle-layer-fragment-shader\n\nprecision highp float;\n\nuniform float opacity;\nuniform sampler2D weightsTexture;\nuniform sampler2D colorTexture;\nuniform float aggregationMode;\n\nin vec2 vTexCoords;\nin float vIntensityMin;\nin float vIntensityMax;\n\nout vec4 fragColor;\n\nvec4 getLinearColor(float value) {\n float factor = clamp(value * vIntensityMax, 0., 1.);\n vec4 color = texture(colorTexture, vec2(factor, 0.5));\n color.a *= min(value * vIntensityMin, 1.0);\n return color;\n}\n\nvoid main(void) {\n vec4 weights = texture(weightsTexture, vTexCoords);\n float weight = weights.r;\n\n if (aggregationMode > 0.5) {\n weight /= max(1.0, weights.a);\n }\n\n // discard pixels with 0 weight.\n if (weight <= 0.) {\n discard;\n }\n\n vec4 linearColor = getLinearColor(weight);\n linearColor.a *= opacity;\n fragColor = linearColor;\n}\n";
|
|
2
|
+
export default _default;
|
|
3
|
+
//# sourceMappingURL=triangle-layer-fragment.glsl.d.ts.map
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
// Copyright (c) 2015 - 2017 Uber Technologies, Inc.
|
|
2
|
+
//
|
|
3
|
+
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
4
|
+
// of this software and associated documentation files (the "Software"), to deal
|
|
5
|
+
// in the Software without restriction, including without limitation the rights
|
|
6
|
+
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
7
|
+
// copies of the Software, and to permit persons to whom the Software is
|
|
8
|
+
// furnished to do so, subject to the following conditions:
|
|
9
|
+
//
|
|
10
|
+
// The above copyright notice and this permission notice shall be included in
|
|
11
|
+
// all copies or substantial portions of the Software.
|
|
12
|
+
//
|
|
13
|
+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
14
|
+
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
15
|
+
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
16
|
+
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
17
|
+
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
18
|
+
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
19
|
+
// THE SOFTWARE.
|
|
20
|
+
export default `\
|
|
21
|
+
#version 300 es
|
|
22
|
+
#define SHADER_NAME triangle-layer-fragment-shader
|
|
23
|
+
|
|
24
|
+
precision highp float;
|
|
25
|
+
|
|
26
|
+
uniform float opacity;
|
|
27
|
+
uniform sampler2D weightsTexture;
|
|
28
|
+
uniform sampler2D colorTexture;
|
|
29
|
+
uniform float aggregationMode;
|
|
30
|
+
|
|
31
|
+
in vec2 vTexCoords;
|
|
32
|
+
in float vIntensityMin;
|
|
33
|
+
in float vIntensityMax;
|
|
34
|
+
|
|
35
|
+
out vec4 fragColor;
|
|
36
|
+
|
|
37
|
+
vec4 getLinearColor(float value) {
|
|
38
|
+
float factor = clamp(value * vIntensityMax, 0., 1.);
|
|
39
|
+
vec4 color = texture(colorTexture, vec2(factor, 0.5));
|
|
40
|
+
color.a *= min(value * vIntensityMin, 1.0);
|
|
41
|
+
return color;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
void main(void) {
|
|
45
|
+
vec4 weights = texture(weightsTexture, vTexCoords);
|
|
46
|
+
float weight = weights.r;
|
|
47
|
+
|
|
48
|
+
if (aggregationMode > 0.5) {
|
|
49
|
+
weight /= max(1.0, weights.a);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
// discard pixels with 0 weight.
|
|
53
|
+
if (weight <= 0.) {
|
|
54
|
+
discard;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
vec4 linearColor = getLinearColor(weight);
|
|
58
|
+
linearColor.a *= opacity;
|
|
59
|
+
fragColor = linearColor;
|
|
60
|
+
}
|
|
61
|
+
`;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
// Copyright (c) 2015 - 2017 Uber Technologies, Inc.
|
|
2
|
+
//
|
|
3
|
+
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
4
|
+
// of this software and associated documentation files (the "Software"), to deal
|
|
5
|
+
// in the Software without restriction, including without limitation the rights
|
|
6
|
+
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
7
|
+
// copies of the Software, and to permit persons to whom the Software is
|
|
8
|
+
// furnished to do so, subject to the following conditions:
|
|
9
|
+
//
|
|
10
|
+
// The above copyright notice and this permission notice shall be included in
|
|
11
|
+
// all copies or substantial portions of the Software.
|
|
12
|
+
//
|
|
13
|
+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
14
|
+
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
15
|
+
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
16
|
+
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
17
|
+
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
18
|
+
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
19
|
+
// THE SOFTWARE.
|
|
20
|
+
// Inspired by screen-grid-layer vertex shader in deck.gl
|
|
21
|
+
export default `\
|
|
22
|
+
#version 300 es
|
|
23
|
+
#define SHADER_NAME heatp-map-layer-vertex-shader
|
|
24
|
+
|
|
25
|
+
uniform sampler2D maxTexture;
|
|
26
|
+
uniform float intensity;
|
|
27
|
+
uniform vec2 colorDomain;
|
|
28
|
+
uniform float threshold;
|
|
29
|
+
uniform float aggregationMode;
|
|
30
|
+
|
|
31
|
+
in vec3 positions;
|
|
32
|
+
in vec2 texCoords;
|
|
33
|
+
|
|
34
|
+
out vec2 vTexCoords;
|
|
35
|
+
out float vIntensityMin;
|
|
36
|
+
out float vIntensityMax;
|
|
37
|
+
|
|
38
|
+
void main(void) {
|
|
39
|
+
gl_Position = project_position_to_clipspace(positions, vec3(0.0), vec3(0.0));
|
|
40
|
+
vTexCoords = texCoords;
|
|
41
|
+
vec4 maxTexture = texture(maxTexture, vec2(0.5));
|
|
42
|
+
float maxValue = aggregationMode < 0.5 ? maxTexture.r : maxTexture.g;
|
|
43
|
+
float minValue = maxValue * threshold;
|
|
44
|
+
if (colorDomain[1] > 0.) {
|
|
45
|
+
// if user specified custom domain use it.
|
|
46
|
+
maxValue = colorDomain[1];
|
|
47
|
+
minValue = colorDomain[0];
|
|
48
|
+
}
|
|
49
|
+
vIntensityMax = intensity / maxValue;
|
|
50
|
+
vIntensityMin = intensity / minValue;
|
|
51
|
+
}
|
|
52
|
+
`;
|
|
@@ -1,7 +1,13 @@
|
|
|
1
|
-
import type { Device, Texture } from '@luma.gl/core';
|
|
1
|
+
import type { Buffer, Device, Texture } from '@luma.gl/core';
|
|
2
2
|
import { Model } from '@luma.gl/engine';
|
|
3
3
|
import { Layer, LayerContext } from '@deck.gl/core';
|
|
4
4
|
type _TriangleLayerProps = {
|
|
5
|
+
data: {
|
|
6
|
+
attributes: {
|
|
7
|
+
positions: Buffer;
|
|
8
|
+
texCoords: Buffer;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
5
11
|
colorDomain: number[];
|
|
6
12
|
aggregationMode: string;
|
|
7
13
|
threshold: number;
|
|
@@ -9,12 +15,14 @@ type _TriangleLayerProps = {
|
|
|
9
15
|
vertexCount: number;
|
|
10
16
|
colorTexture: Texture;
|
|
11
17
|
maxTexture: Texture;
|
|
12
|
-
|
|
18
|
+
weightsTexture: Texture;
|
|
13
19
|
};
|
|
14
20
|
export default class TriangleLayer extends Layer<_TriangleLayerProps> {
|
|
15
21
|
static layerName: string;
|
|
16
22
|
state: {
|
|
17
23
|
model: Model;
|
|
24
|
+
positions: Buffer;
|
|
25
|
+
texCoords: Buffer;
|
|
18
26
|
};
|
|
19
27
|
getShaders(): {
|
|
20
28
|
vs: string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"triangle-layer.d.ts","sourceRoot":"","sources":["../../src/heatmap-layer/triangle-layer.ts"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAC,MAAM,eAAe,CAAC;AAC3D,OAAO,EAAC,KAAK,EAAC,MAAM,iBAAiB,CAAC;AACtC,OAAO,EAAC,KAAK,EAAE,YAAY,EAAY,MAAM,eAAe,CAAC;AAI7D,KAAK,mBAAmB,GAAG;IACzB,IAAI,EAAE;QAAC,UAAU,EAAE;YAAC,SAAS,EAAE,MAAM,CAAC;YAAC,SAAS,EAAE,MAAM,CAAA;SAAC,CAAA;KAAC,CAAC;IAC3D,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,eAAe,EAAE,MAAM,CAAC;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,OAAO,CAAC;IACtB,UAAU,EAAE,OAAO,CAAC;IACpB,cAAc,EAAE,OAAO,CAAC;CACzB,CAAC;AAEF,MAAM,CAAC,OAAO,OAAO,aAAc,SAAQ,KAAK,CAAC,mBAAmB,CAAC;IACnE,MAAM,CAAC,SAAS,SAAmB;IAEnC,KAAK,EAAG;QACN,KAAK,EAAE,KAAK,CAAC;QACb,SAAS,EAAE,MAAM,CAAC;QAClB,SAAS,EAAE,MAAM,CAAC;KACnB,CAAC;IAEF,UAAU;;;;;IAIV,eAAe,CAAC,EAAC,MAAM,EAAC,EAAE,YAAY,GAAG,IAAI;IAI7C,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,KAAK;IAiBhC,IAAI,CAAC,EAAC,QAAQ,EAAC;;KAAA,GAAG,IAAI;CAYvB"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
// Copyright (c) 2015 - 2019 Uber Technologies, Inc.
|
|
2
|
+
//
|
|
3
|
+
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
4
|
+
// of this software and associated documentation files (the "Software"), to deal
|
|
5
|
+
// in the Software without restriction, including without limitation the rights
|
|
6
|
+
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
7
|
+
// copies of the Software, and to permit persons to whom the Software is
|
|
8
|
+
// furnished to do so, subject to the following conditions:
|
|
9
|
+
//
|
|
10
|
+
// The above copyright notice and this permission notice shall be included in
|
|
11
|
+
// all copies or substantial portions of the Software.
|
|
12
|
+
//
|
|
13
|
+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
14
|
+
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
15
|
+
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
16
|
+
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
17
|
+
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
18
|
+
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
19
|
+
// THE SOFTWARE.
|
|
20
|
+
import { Model } from '@luma.gl/engine';
|
|
21
|
+
import { Layer, project32 } from '@deck.gl/core';
|
|
22
|
+
import vs from "./triangle-layer-vertex.glsl.js";
|
|
23
|
+
import fs from "./triangle-layer-fragment.glsl.js";
|
|
24
|
+
export default class TriangleLayer extends Layer {
|
|
25
|
+
static { this.layerName = 'TriangleLayer'; }
|
|
26
|
+
getShaders() {
|
|
27
|
+
return { vs, fs, modules: [project32] };
|
|
28
|
+
}
|
|
29
|
+
initializeState({ device }) {
|
|
30
|
+
this.setState({ model: this._getModel(device) });
|
|
31
|
+
}
|
|
32
|
+
_getModel(device) {
|
|
33
|
+
const { vertexCount, data, weightsTexture, maxTexture, colorTexture } = this.props;
|
|
34
|
+
return new Model(device, {
|
|
35
|
+
...this.getShaders(),
|
|
36
|
+
id: this.props.id,
|
|
37
|
+
bindings: { weightsTexture, maxTexture, colorTexture },
|
|
38
|
+
attributes: data.attributes,
|
|
39
|
+
bufferLayout: [
|
|
40
|
+
{ name: 'positions', format: 'float32x3' },
|
|
41
|
+
{ name: 'texCoords', format: 'float32x2' }
|
|
42
|
+
],
|
|
43
|
+
topology: 'triangle-fan-webgl',
|
|
44
|
+
vertexCount
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
draw({ uniforms }) {
|
|
48
|
+
const { model } = this.state;
|
|
49
|
+
const { intensity, threshold, aggregationMode, colorDomain } = this.props;
|
|
50
|
+
model.setUniforms({
|
|
51
|
+
...uniforms,
|
|
52
|
+
intensity,
|
|
53
|
+
threshold,
|
|
54
|
+
aggregationMode,
|
|
55
|
+
colorDomain
|
|
56
|
+
});
|
|
57
|
+
model.draw(this.context.renderPass);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
declare const _default: "#version 300 es\nin vec3 positions;\nin vec3 positions64Low;\nin float weights;\nout vec4 weightsTexture;\nuniform float radiusPixels;\nuniform float textureWidth;\nuniform vec4 commonBounds;\nuniform float weightsScale;\n\nvoid main()\n{\n weightsTexture = vec4(weights * weightsScale, 0., 0., 1.);\n\n float radiusTexels = project_pixel_size(radiusPixels) * textureWidth / (commonBounds.z - commonBounds.x);\n gl_PointSize = radiusTexels * 2.;\n\n vec3 commonPosition = project_position(positions, positions64Low);\n\n // // map xy from commonBounds to [-1, 1]\n gl_Position.xy = (commonPosition.xy - commonBounds.xy) / (commonBounds.zw - commonBounds.xy) ;\n gl_Position.xy = (gl_Position.xy * 2.) - (1.);\n gl_Position.w = 1.0;\n}\n";
|
|
2
|
+
export default _default;
|
|
3
|
+
//# sourceMappingURL=weights-vs.glsl.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"weights-vs.glsl.d.ts","sourceRoot":"","sources":["../../src/heatmap-layer/weights-vs.glsl.ts"],"names":[],"mappings":";AAAA,
|
|
1
|
+
{"version":3,"file":"weights-vs.glsl.d.ts","sourceRoot":"","sources":["../../src/heatmap-layer/weights-vs.glsl.ts"],"names":[],"mappings":";AAAA,wBAyBE"}
|
|
@@ -8,18 +8,19 @@ uniform float radiusPixels;
|
|
|
8
8
|
uniform float textureWidth;
|
|
9
9
|
uniform vec4 commonBounds;
|
|
10
10
|
uniform float weightsScale;
|
|
11
|
+
|
|
11
12
|
void main()
|
|
12
13
|
{
|
|
13
14
|
weightsTexture = vec4(weights * weightsScale, 0., 0., 1.);
|
|
14
15
|
|
|
15
|
-
float radiusTexels
|
|
16
|
+
float radiusTexels = project_pixel_size(radiusPixels) * textureWidth / (commonBounds.z - commonBounds.x);
|
|
16
17
|
gl_PointSize = radiusTexels * 2.;
|
|
17
18
|
|
|
18
19
|
vec3 commonPosition = project_position(positions, positions64Low);
|
|
19
20
|
|
|
20
|
-
// map xy from commonBounds to [-1, 1]
|
|
21
|
+
// // map xy from commonBounds to [-1, 1]
|
|
21
22
|
gl_Position.xy = (commonPosition.xy - commonBounds.xy) / (commonBounds.zw - commonBounds.xy) ;
|
|
22
23
|
gl_Position.xy = (gl_Position.xy * 2.) - (1.);
|
|
24
|
+
gl_Position.w = 1.0;
|
|
23
25
|
}
|
|
24
26
|
`;
|
|
25
|
-
//# sourceMappingURL=weights-vs.glsl.js.map
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
// Copyright (c) 2015 - 2017 Uber Technologies, Inc.
|
|
2
|
+
//
|
|
3
|
+
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
4
|
+
// of this software and associated documentation files (the "Software"), to deal
|
|
5
|
+
// in the Software without restriction, including without limitation the rights
|
|
6
|
+
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
7
|
+
// copies of the Software, and to permit persons to whom the Software is
|
|
8
|
+
// furnished to do so, subject to the following conditions:
|
|
9
|
+
//
|
|
10
|
+
// The above copyright notice and this permission notice shall be included in
|
|
11
|
+
// all copies or substantial portions of the Software.
|
|
12
|
+
//
|
|
13
|
+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
14
|
+
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
15
|
+
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
16
|
+
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
17
|
+
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
18
|
+
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
19
|
+
// THE SOFTWARE.
|
|
20
|
+
import { hexbin } from 'd3-hexbin';
|
|
21
|
+
import { createIterable, log } from '@deck.gl/core';
|
|
22
|
+
/**
|
|
23
|
+
* Use d3-hexbin to performs hexagonal binning from geo points to hexagons
|
|
24
|
+
* @param {Iterable} data - array of points
|
|
25
|
+
* @param {Number} radius - hexagon radius in meter
|
|
26
|
+
* @param {function} getPosition - get points lon lat
|
|
27
|
+
* @param {Object} viewport - current viewport object
|
|
28
|
+
|
|
29
|
+
* @return {Object} - hexagons and countRange
|
|
30
|
+
*/
|
|
31
|
+
export function pointToHexbin(props, aggregationParams) {
|
|
32
|
+
const { data, radius } = props;
|
|
33
|
+
const { viewport, attributes } = aggregationParams;
|
|
34
|
+
// get hexagon radius in mercator world unit
|
|
35
|
+
const centerLngLat = data.length ? getPointsCenter(data, aggregationParams) : null;
|
|
36
|
+
const radiusCommon = getRadiusInCommon(radius, viewport, centerLngLat);
|
|
37
|
+
// add world space coordinates to points
|
|
38
|
+
const screenPoints = [];
|
|
39
|
+
const { iterable, objectInfo } = createIterable(data);
|
|
40
|
+
const positions = attributes.positions.value;
|
|
41
|
+
const { size } = attributes.positions.getAccessor();
|
|
42
|
+
for (const object of iterable) {
|
|
43
|
+
objectInfo.index++;
|
|
44
|
+
const posIndex = objectInfo.index * size;
|
|
45
|
+
const position = [positions[posIndex], positions[posIndex + 1]];
|
|
46
|
+
const arrayIsFinite = Number.isFinite(position[0]) && Number.isFinite(position[1]);
|
|
47
|
+
if (arrayIsFinite) {
|
|
48
|
+
screenPoints.push({
|
|
49
|
+
screenCoord: viewport.projectFlat(position),
|
|
50
|
+
source: object,
|
|
51
|
+
index: objectInfo.index
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
else {
|
|
55
|
+
log.warn('HexagonLayer: invalid position')();
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
const newHexbin = hexbin()
|
|
59
|
+
.radius(radiusCommon)
|
|
60
|
+
.x(d => d.screenCoord[0])
|
|
61
|
+
.y(d => d.screenCoord[1]);
|
|
62
|
+
const hexagonBins = newHexbin(screenPoints);
|
|
63
|
+
return {
|
|
64
|
+
hexagons: hexagonBins.map((hex, index) => ({
|
|
65
|
+
position: viewport.unprojectFlat([hex.x, hex.y]),
|
|
66
|
+
points: hex,
|
|
67
|
+
index
|
|
68
|
+
})),
|
|
69
|
+
radiusCommon
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Get the bounding box of all data points
|
|
74
|
+
*/
|
|
75
|
+
export function getPointsCenter(data, aggregationParams) {
|
|
76
|
+
const { attributes } = aggregationParams;
|
|
77
|
+
const positions = attributes.positions.value;
|
|
78
|
+
const { size } = attributes.positions.getAccessor();
|
|
79
|
+
let minX = Infinity;
|
|
80
|
+
let minY = Infinity;
|
|
81
|
+
let maxX = -Infinity;
|
|
82
|
+
let maxY = -Infinity;
|
|
83
|
+
let i;
|
|
84
|
+
for (i = 0; i < size * data.length; i += size) {
|
|
85
|
+
const x = positions[i];
|
|
86
|
+
const y = positions[i + 1];
|
|
87
|
+
const arrayIsFinite = Number.isFinite(x) && Number.isFinite(y);
|
|
88
|
+
if (arrayIsFinite) {
|
|
89
|
+
minX = Math.min(x, minX);
|
|
90
|
+
maxX = Math.max(x, maxX);
|
|
91
|
+
minY = Math.min(y, minY);
|
|
92
|
+
maxY = Math.max(y, maxY);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
// return center
|
|
96
|
+
return [minX, minY, maxX, maxY].every(Number.isFinite)
|
|
97
|
+
? [(minX + maxX) / 2, (minY + maxY) / 2]
|
|
98
|
+
: null;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Get radius in mercator world space coordinates from meter
|
|
102
|
+
* @param {Number} radius - in meter
|
|
103
|
+
* @param {Object} viewport - current viewport object
|
|
104
|
+
* @param {Array<Number>} center - data center
|
|
105
|
+
|
|
106
|
+
* @return {Number} radius in mercator world spcae coordinates
|
|
107
|
+
*/
|
|
108
|
+
export function getRadiusInCommon(radius, viewport, center) {
|
|
109
|
+
const { unitsPerMeter } = viewport.getDistanceScales(center);
|
|
110
|
+
// x, y distance should be the same
|
|
111
|
+
return radius * unitsPerMeter[0];
|
|
112
|
+
}
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
// Copyright (c) 2015 - 2017 Uber Technologies, Inc.
|
|
2
|
+
//
|
|
3
|
+
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
4
|
+
// of this software and associated documentation files (the "Software"), to deal
|
|
5
|
+
// in the Software without restriction, including without limitation the rights
|
|
6
|
+
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
7
|
+
// copies of the Software, and to permit persons to whom the Software is
|
|
8
|
+
// furnished to do so, subject to the following conditions:
|
|
9
|
+
//
|
|
10
|
+
// The above copyright notice and this permission notice shall be included in
|
|
11
|
+
// all copies or substantial portions of the Software.
|
|
12
|
+
//
|
|
13
|
+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
14
|
+
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
15
|
+
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
16
|
+
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
17
|
+
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
18
|
+
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
19
|
+
// THE SOFTWARE.
|
|
20
|
+
import { log } from '@deck.gl/core';
|
|
21
|
+
import { ColumnLayer } from '@deck.gl/layers';
|
|
22
|
+
import { GL } from '@luma.gl/constants';
|
|
23
|
+
import { defaultColorRange } from "../utils/color-utils.js";
|
|
24
|
+
import { pointToHexbin } from "./hexagon-aggregator.js";
|
|
25
|
+
import CPUAggregator from "../utils/cpu-aggregator.js";
|
|
26
|
+
import AggregationLayer from "../aggregation-layer.js";
|
|
27
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
28
|
+
function nop() { }
|
|
29
|
+
const defaultProps = {
|
|
30
|
+
// color
|
|
31
|
+
colorDomain: null,
|
|
32
|
+
colorRange: defaultColorRange,
|
|
33
|
+
getColorValue: { type: 'accessor', value: null }, // default value is calcuated from `getColorWeight` and `colorAggregation`
|
|
34
|
+
getColorWeight: { type: 'accessor', value: 1 },
|
|
35
|
+
colorAggregation: 'SUM',
|
|
36
|
+
lowerPercentile: { type: 'number', value: 0, min: 0, max: 100 },
|
|
37
|
+
upperPercentile: { type: 'number', value: 100, min: 0, max: 100 },
|
|
38
|
+
colorScaleType: 'quantize',
|
|
39
|
+
onSetColorDomain: nop,
|
|
40
|
+
// elevation
|
|
41
|
+
elevationDomain: null,
|
|
42
|
+
elevationRange: [0, 1000],
|
|
43
|
+
getElevationValue: { type: 'accessor', value: null }, // default value is calcuated from `getElevationWeight` and `elevationAggregation`
|
|
44
|
+
getElevationWeight: { type: 'accessor', value: 1 },
|
|
45
|
+
elevationAggregation: 'SUM',
|
|
46
|
+
elevationLowerPercentile: { type: 'number', value: 0, min: 0, max: 100 },
|
|
47
|
+
elevationUpperPercentile: { type: 'number', value: 100, min: 0, max: 100 },
|
|
48
|
+
elevationScale: { type: 'number', min: 0, value: 1 },
|
|
49
|
+
elevationScaleType: 'linear',
|
|
50
|
+
onSetElevationDomain: nop,
|
|
51
|
+
radius: { type: 'number', value: 1000, min: 1 },
|
|
52
|
+
coverage: { type: 'number', min: 0, max: 1, value: 1 },
|
|
53
|
+
extruded: false,
|
|
54
|
+
hexagonAggregator: pointToHexbin,
|
|
55
|
+
getPosition: { type: 'accessor', value: (x) => x.position },
|
|
56
|
+
// Optional material for 'lighting' shader module
|
|
57
|
+
material: true,
|
|
58
|
+
// data filter
|
|
59
|
+
_filterData: { type: 'function', value: null, optional: true }
|
|
60
|
+
};
|
|
61
|
+
/** Aggregates data into a hexagon-based heatmap. The color and height of a hexagon are determined based on the objects it contains. */
|
|
62
|
+
export default class HexagonLayer extends AggregationLayer {
|
|
63
|
+
static { this.layerName = 'HexagonLayer'; }
|
|
64
|
+
static { this.defaultProps = defaultProps; }
|
|
65
|
+
initializeState() {
|
|
66
|
+
const cpuAggregator = new CPUAggregator({
|
|
67
|
+
getAggregator: props => props.hexagonAggregator,
|
|
68
|
+
getCellSize: props => props.radius
|
|
69
|
+
});
|
|
70
|
+
this.state = {
|
|
71
|
+
cpuAggregator,
|
|
72
|
+
aggregatorState: cpuAggregator.state,
|
|
73
|
+
vertices: null
|
|
74
|
+
};
|
|
75
|
+
const attributeManager = this.getAttributeManager();
|
|
76
|
+
attributeManager.add({
|
|
77
|
+
positions: { size: 3, type: GL.DOUBLE, accessor: 'getPosition' }
|
|
78
|
+
});
|
|
79
|
+
// color and elevation attributes can't be added as attributes
|
|
80
|
+
// they are calculated using 'getValue' accessor that takes an array of pints.
|
|
81
|
+
}
|
|
82
|
+
updateState(opts) {
|
|
83
|
+
super.updateState(opts);
|
|
84
|
+
if (opts.changeFlags.propsOrDataChanged) {
|
|
85
|
+
const aggregatorState = this.state.cpuAggregator.updateState(opts, {
|
|
86
|
+
viewport: this.context.viewport,
|
|
87
|
+
attributes: this.getAttributes()
|
|
88
|
+
});
|
|
89
|
+
if (this.state.aggregatorState.layerData !== aggregatorState.layerData) {
|
|
90
|
+
// if user provided custom aggregator and returns hexagonVertices,
|
|
91
|
+
// Need to recalculate radius and angle based on vertices
|
|
92
|
+
// @ts-expect-error
|
|
93
|
+
const { hexagonVertices } = aggregatorState.layerData || {};
|
|
94
|
+
this.setState({
|
|
95
|
+
vertices: hexagonVertices && this.convertLatLngToMeterOffset(hexagonVertices)
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
this.setState({
|
|
99
|
+
// make a copy of the internal state of cpuAggregator for testing
|
|
100
|
+
aggregatorState
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
convertLatLngToMeterOffset(hexagonVertices) {
|
|
105
|
+
const { viewport } = this.context;
|
|
106
|
+
if (Array.isArray(hexagonVertices) && hexagonVertices.length === 6) {
|
|
107
|
+
// get centroid of hexagons
|
|
108
|
+
const vertex0 = hexagonVertices[0];
|
|
109
|
+
const vertex3 = hexagonVertices[3];
|
|
110
|
+
const centroid = [(vertex0[0] + vertex3[0]) / 2, (vertex0[1] + vertex3[1]) / 2];
|
|
111
|
+
const centroidFlat = viewport.projectFlat(centroid);
|
|
112
|
+
const { metersPerUnit } = viewport.getDistanceScales(centroid);
|
|
113
|
+
// offset all points by centroid to meter offset
|
|
114
|
+
const vertices = hexagonVertices.map(vt => {
|
|
115
|
+
const vtFlat = viewport.projectFlat(vt);
|
|
116
|
+
return [
|
|
117
|
+
(vtFlat[0] - centroidFlat[0]) * metersPerUnit[0],
|
|
118
|
+
(vtFlat[1] - centroidFlat[1]) * metersPerUnit[1]
|
|
119
|
+
];
|
|
120
|
+
});
|
|
121
|
+
return vertices;
|
|
122
|
+
}
|
|
123
|
+
log.error('HexagonLayer: hexagonVertices needs to be an array of 6 points')();
|
|
124
|
+
return null;
|
|
125
|
+
}
|
|
126
|
+
getPickingInfo({ info }) {
|
|
127
|
+
return this.state.cpuAggregator.getPickingInfo({ info });
|
|
128
|
+
}
|
|
129
|
+
// create a method for testing
|
|
130
|
+
_onGetSublayerColor(cell) {
|
|
131
|
+
return this.state.cpuAggregator.getAccessor('fillColor')(cell);
|
|
132
|
+
}
|
|
133
|
+
// create a method for testing
|
|
134
|
+
_onGetSublayerElevation(cell) {
|
|
135
|
+
return this.state.cpuAggregator.getAccessor('elevation')(cell);
|
|
136
|
+
}
|
|
137
|
+
_getSublayerUpdateTriggers() {
|
|
138
|
+
return this.state.cpuAggregator.getUpdateTriggers(this.props);
|
|
139
|
+
}
|
|
140
|
+
renderLayers() {
|
|
141
|
+
const { elevationScale, extruded, coverage, material, transitions } = this.props;
|
|
142
|
+
const { aggregatorState, vertices } = this.state;
|
|
143
|
+
const SubLayerClass = this.getSubLayerClass('hexagon-cell', ColumnLayer);
|
|
144
|
+
const updateTriggers = this._getSublayerUpdateTriggers();
|
|
145
|
+
const geometry = vertices
|
|
146
|
+
? { vertices, radius: 1 }
|
|
147
|
+
: {
|
|
148
|
+
// default geometry
|
|
149
|
+
// @ts-expect-error TODO - undefined property?
|
|
150
|
+
radius: aggregatorState.layerData.radiusCommon || 1,
|
|
151
|
+
radiusUnits: 'common',
|
|
152
|
+
angle: 90
|
|
153
|
+
};
|
|
154
|
+
return new SubLayerClass({
|
|
155
|
+
...geometry,
|
|
156
|
+
diskResolution: 6,
|
|
157
|
+
elevationScale,
|
|
158
|
+
extruded,
|
|
159
|
+
coverage,
|
|
160
|
+
material,
|
|
161
|
+
getFillColor: this._onGetSublayerColor.bind(this),
|
|
162
|
+
getElevation: this._onGetSublayerElevation.bind(this),
|
|
163
|
+
transitions: transitions && {
|
|
164
|
+
getFillColor: transitions.getColorValue || transitions.getColorWeight,
|
|
165
|
+
getElevation: transitions.getElevationValue || transitions.getElevationWeight
|
|
166
|
+
}
|
|
167
|
+
}, this.getSubLayerProps({
|
|
168
|
+
id: 'hexagon-cell',
|
|
169
|
+
updateTriggers
|
|
170
|
+
}), {
|
|
171
|
+
data: aggregatorState.layerData.data
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
}
|