@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.
Files changed (372) hide show
  1. package/dist/common/aggregation-layer.d.ts +30 -0
  2. package/dist/common/aggregation-layer.d.ts.map +1 -0
  3. package/dist/common/aggregation-layer.js +70 -0
  4. package/dist/common/aggregation-layer.js.map +1 -0
  5. package/dist/common/aggregator/aggregator.d.ts +76 -0
  6. package/dist/common/aggregator/aggregator.d.ts.map +1 -0
  7. package/dist/common/aggregator/aggregator.js +5 -0
  8. package/dist/common/aggregator/aggregator.js.map +1 -0
  9. package/dist/common/aggregator/cpu-aggregator/aggregate.d.ts +27 -0
  10. package/dist/common/aggregator/cpu-aggregator/aggregate.d.ts.map +1 -0
  11. package/dist/common/aggregator/cpu-aggregator/aggregate.js +67 -0
  12. package/dist/common/aggregator/cpu-aggregator/aggregate.js.map +1 -0
  13. package/dist/common/aggregator/cpu-aggregator/cpu-aggregator.d.ts +70 -0
  14. package/dist/common/aggregator/cpu-aggregator/cpu-aggregator.d.ts.map +1 -0
  15. package/dist/common/aggregator/cpu-aggregator/cpu-aggregator.js +140 -0
  16. package/dist/common/aggregator/cpu-aggregator/cpu-aggregator.js.map +1 -0
  17. package/dist/common/aggregator/cpu-aggregator/sort-bins.d.ts +15 -0
  18. package/dist/common/aggregator/cpu-aggregator/sort-bins.d.ts.map +1 -0
  19. package/dist/common/aggregator/cpu-aggregator/sort-bins.js +44 -0
  20. package/dist/common/aggregator/cpu-aggregator/sort-bins.js.map +1 -0
  21. package/dist/common/aggregator/cpu-aggregator/vertex-accessor.d.ts +21 -0
  22. package/dist/common/aggregator/cpu-aggregator/vertex-accessor.d.ts.map +1 -0
  23. package/dist/common/aggregator/cpu-aggregator/vertex-accessor.js +56 -0
  24. package/dist/common/aggregator/cpu-aggregator/vertex-accessor.js.map +1 -0
  25. package/dist/common/aggregator/gpu-aggregator/aggregation-transform-uniforms.d.ts +18 -0
  26. package/dist/common/aggregator/gpu-aggregator/aggregation-transform-uniforms.d.ts.map +1 -0
  27. package/dist/common/aggregator/gpu-aggregator/aggregation-transform-uniforms.js +21 -0
  28. package/dist/common/aggregator/gpu-aggregator/aggregation-transform-uniforms.js.map +1 -0
  29. package/dist/common/aggregator/gpu-aggregator/bin-sorter-uniforms.d.ts +14 -0
  30. package/dist/common/aggregator/gpu-aggregator/bin-sorter-uniforms.d.ts.map +1 -0
  31. package/dist/common/aggregator/gpu-aggregator/bin-sorter-uniforms.js +18 -0
  32. package/dist/common/aggregator/gpu-aggregator/bin-sorter-uniforms.js.map +1 -0
  33. package/dist/common/aggregator/gpu-aggregator/utils.d.ts +6 -0
  34. package/dist/common/aggregator/gpu-aggregator/utils.d.ts.map +1 -0
  35. package/dist/common/aggregator/gpu-aggregator/utils.js +25 -0
  36. package/dist/common/aggregator/gpu-aggregator/utils.js.map +1 -0
  37. package/dist/common/aggregator/gpu-aggregator/webgl-aggregation-transform.d.ts +24 -0
  38. package/dist/common/aggregator/gpu-aggregator/webgl-aggregation-transform.d.ts.map +1 -0
  39. package/dist/common/aggregator/gpu-aggregator/webgl-aggregation-transform.js +216 -0
  40. package/dist/common/aggregator/gpu-aggregator/webgl-aggregation-transform.js.map +1 -0
  41. package/dist/common/aggregator/gpu-aggregator/webgl-aggregator.d.ts +81 -0
  42. package/dist/common/aggregator/gpu-aggregator/webgl-aggregator.d.ts.map +1 -0
  43. package/dist/common/aggregator/gpu-aggregator/webgl-aggregator.js +202 -0
  44. package/dist/common/aggregator/gpu-aggregator/webgl-aggregator.js.map +1 -0
  45. package/dist/common/aggregator/gpu-aggregator/webgl-bin-sorter.d.ts +38 -0
  46. package/dist/common/aggregator/gpu-aggregator/webgl-bin-sorter.d.ts.map +1 -0
  47. package/dist/common/aggregator/gpu-aggregator/webgl-bin-sorter.js +224 -0
  48. package/dist/common/aggregator/gpu-aggregator/webgl-bin-sorter.js.map +1 -0
  49. package/dist/common/aggregator/index.d.ts +6 -0
  50. package/dist/common/aggregator/index.d.ts.map +1 -0
  51. package/dist/common/aggregator/index.js +6 -0
  52. package/dist/common/aggregator/index.js.map +1 -0
  53. package/dist/common/types.d.ts +11 -0
  54. package/dist/common/types.d.ts.map +1 -0
  55. package/dist/common/types.js +5 -0
  56. package/dist/common/types.js.map +1 -0
  57. package/dist/common/utils/bounds-utils.d.ts +10 -0
  58. package/dist/common/utils/bounds-utils.d.ts.map +1 -0
  59. package/dist/common/utils/bounds-utils.js +21 -0
  60. package/dist/common/utils/bounds-utils.js.map +1 -0
  61. package/dist/common/utils/color-utils.d.ts +10 -0
  62. package/dist/common/utils/color-utils.d.ts.map +1 -0
  63. package/dist/common/utils/color-utils.js +66 -0
  64. package/dist/common/utils/color-utils.js.map +1 -0
  65. package/dist/common/utils/prop-utils.d.ts.map +1 -0
  66. package/dist/common/utils/prop-utils.js +13 -0
  67. package/dist/common/utils/prop-utils.js.map +1 -0
  68. package/dist/common/utils/scale-utils.d.ts +46 -0
  69. package/dist/common/utils/scale-utils.d.ts.map +1 -0
  70. package/dist/common/utils/scale-utils.js +181 -0
  71. package/dist/common/utils/scale-utils.js.map +1 -0
  72. package/dist/contour-layer/bin-options-uniforms.d.ts +13 -0
  73. package/dist/contour-layer/bin-options-uniforms.d.ts.map +1 -0
  74. package/dist/contour-layer/bin-options-uniforms.js +18 -0
  75. package/dist/contour-layer/bin-options-uniforms.js.map +1 -0
  76. package/dist/contour-layer/contour-layer.d.ts +42 -50
  77. package/dist/contour-layer/contour-layer.d.ts.map +1 -1
  78. package/dist/contour-layer/contour-layer.js +233 -192
  79. package/dist/contour-layer/contour-layer.js.map +1 -0
  80. package/dist/contour-layer/contour-utils.d.ts +36 -15
  81. package/dist/contour-layer/contour-utils.d.ts.map +1 -1
  82. package/dist/contour-layer/contour-utils.js +25 -29
  83. package/dist/contour-layer/contour-utils.js.map +1 -0
  84. package/dist/contour-layer/marching-squares-codes.d.ts.map +1 -1
  85. package/dist/contour-layer/marching-squares-codes.js +4 -0
  86. package/dist/contour-layer/marching-squares-codes.js.map +1 -0
  87. package/dist/contour-layer/marching-squares.d.ts +22 -6
  88. package/dist/contour-layer/marching-squares.d.ts.map +1 -1
  89. package/dist/contour-layer/marching-squares.js +72 -68
  90. package/dist/contour-layer/marching-squares.js.map +1 -0
  91. package/dist/contour-layer/value-reader.d.ts +10 -0
  92. package/dist/contour-layer/value-reader.d.ts.map +1 -0
  93. package/dist/contour-layer/value-reader.js +47 -0
  94. package/dist/contour-layer/value-reader.js.map +1 -0
  95. package/dist/dist.dev.js +4844 -4083
  96. package/dist/grid-layer/bin-options-uniforms.d.ts +13 -0
  97. package/dist/grid-layer/bin-options-uniforms.d.ts.map +1 -0
  98. package/dist/grid-layer/bin-options-uniforms.js +18 -0
  99. package/dist/grid-layer/bin-options-uniforms.js.map +1 -0
  100. package/dist/grid-layer/grid-cell-layer-vertex.glsl.d.ts +3 -0
  101. package/dist/grid-layer/grid-cell-layer-vertex.glsl.d.ts.map +1 -0
  102. package/dist/grid-layer/grid-cell-layer-vertex.glsl.js +52 -0
  103. package/dist/grid-layer/grid-cell-layer-vertex.glsl.js.map +1 -0
  104. package/dist/grid-layer/grid-cell-layer.d.ts +32 -0
  105. package/dist/grid-layer/grid-cell-layer.d.ts.map +1 -0
  106. package/dist/grid-layer/grid-cell-layer.js +94 -0
  107. package/dist/grid-layer/grid-cell-layer.js.map +1 -0
  108. package/dist/grid-layer/grid-layer-uniforms.d.ts +21 -0
  109. package/dist/grid-layer/grid-layer-uniforms.d.ts.map +1 -0
  110. package/dist/grid-layer/grid-layer-uniforms.js +24 -0
  111. package/dist/grid-layer/grid-layer-uniforms.js.map +1 -0
  112. package/dist/grid-layer/grid-layer.d.ts +176 -14
  113. package/dist/grid-layer/grid-layer.d.ts.map +1 -1
  114. package/dist/grid-layer/grid-layer.js +343 -46
  115. package/dist/grid-layer/grid-layer.js.map +1 -0
  116. package/dist/{aggregation-layer.d.ts → heatmap-layer/aggregation-layer.d.ts} +1 -0
  117. package/dist/heatmap-layer/aggregation-layer.d.ts.map +1 -0
  118. package/dist/{aggregation-layer.js → heatmap-layer/aggregation-layer.js} +7 -21
  119. package/dist/heatmap-layer/aggregation-layer.js.map +1 -0
  120. package/dist/heatmap-layer/heatmap-layer-uniforms.d.ts +30 -0
  121. package/dist/heatmap-layer/heatmap-layer-uniforms.d.ts.map +1 -0
  122. package/dist/heatmap-layer/heatmap-layer-uniforms.js +33 -0
  123. package/dist/heatmap-layer/heatmap-layer-uniforms.js.map +1 -0
  124. package/dist/heatmap-layer/heatmap-layer-utils.d.ts +1 -1
  125. package/dist/heatmap-layer/heatmap-layer-utils.d.ts.map +1 -1
  126. package/dist/heatmap-layer/heatmap-layer-utils.js +4 -0
  127. package/dist/heatmap-layer/heatmap-layer-utils.js.map +1 -0
  128. package/dist/heatmap-layer/heatmap-layer.d.ts +6 -4
  129. package/dist/heatmap-layer/heatmap-layer.d.ts.map +1 -1
  130. package/dist/heatmap-layer/heatmap-layer.js +44 -33
  131. package/dist/heatmap-layer/heatmap-layer.js.map +1 -0
  132. package/dist/heatmap-layer/max-fs.glsl.d.ts.map +1 -1
  133. package/dist/heatmap-layer/max-fs.glsl.js +4 -0
  134. package/dist/heatmap-layer/max-fs.glsl.js.map +1 -0
  135. package/dist/heatmap-layer/max-vs.glsl.d.ts +1 -1
  136. package/dist/heatmap-layer/max-vs.glsl.d.ts.map +1 -1
  137. package/dist/heatmap-layer/max-vs.glsl.js +7 -4
  138. package/dist/heatmap-layer/max-vs.glsl.js.map +1 -0
  139. package/dist/heatmap-layer/triangle-layer-fragment.glsl.d.ts +1 -1
  140. package/dist/heatmap-layer/triangle-layer-fragment.glsl.d.ts.map +1 -1
  141. package/dist/heatmap-layer/triangle-layer-fragment.glsl.js +6 -23
  142. package/dist/heatmap-layer/triangle-layer-fragment.glsl.js.map +1 -0
  143. package/dist/heatmap-layer/triangle-layer-uniforms.d.ts +22 -0
  144. package/dist/heatmap-layer/triangle-layer-uniforms.d.ts.map +1 -0
  145. package/dist/heatmap-layer/triangle-layer-uniforms.js +23 -0
  146. package/dist/heatmap-layer/triangle-layer-uniforms.js.map +1 -0
  147. package/dist/heatmap-layer/triangle-layer-vertex.glsl.d.ts +1 -1
  148. package/dist/heatmap-layer/triangle-layer-vertex.glsl.d.ts.map +1 -1
  149. package/dist/heatmap-layer/triangle-layer-vertex.glsl.js +11 -30
  150. package/dist/heatmap-layer/triangle-layer-vertex.glsl.js.map +1 -0
  151. package/dist/heatmap-layer/triangle-layer.d.ts +4 -10
  152. package/dist/heatmap-layer/triangle-layer.d.ts.map +1 -1
  153. package/dist/heatmap-layer/triangle-layer.js +18 -30
  154. package/dist/heatmap-layer/triangle-layer.js.map +1 -0
  155. package/dist/heatmap-layer/weights-fs.glsl.d.ts.map +1 -1
  156. package/dist/heatmap-layer/weights-fs.glsl.js +4 -0
  157. package/dist/heatmap-layer/weights-fs.glsl.js.map +1 -0
  158. package/dist/heatmap-layer/weights-vs.glsl.d.ts +1 -1
  159. package/dist/heatmap-layer/weights-vs.glsl.d.ts.map +1 -1
  160. package/dist/heatmap-layer/weights-vs.glsl.js +7 -7
  161. package/dist/heatmap-layer/weights-vs.glsl.js.map +1 -0
  162. package/dist/hexagon-layer/bin-options-uniforms.d.ts +14 -0
  163. package/dist/hexagon-layer/bin-options-uniforms.d.ts.map +1 -0
  164. package/dist/hexagon-layer/bin-options-uniforms.js +18 -0
  165. package/dist/hexagon-layer/bin-options-uniforms.js.map +1 -0
  166. package/dist/hexagon-layer/hexagon-cell-layer-vertex.glsl.d.ts +3 -0
  167. package/dist/hexagon-layer/hexagon-cell-layer-vertex.glsl.d.ts.map +1 -0
  168. package/dist/hexagon-layer/hexagon-cell-layer-vertex.glsl.js +56 -0
  169. package/dist/hexagon-layer/hexagon-cell-layer-vertex.glsl.js.map +1 -0
  170. package/dist/hexagon-layer/hexagon-cell-layer.d.ts +29 -0
  171. package/dist/hexagon-layer/hexagon-cell-layer.d.ts.map +1 -0
  172. package/dist/hexagon-layer/hexagon-cell-layer.js +95 -0
  173. package/dist/hexagon-layer/hexagon-cell-layer.js.map +1 -0
  174. package/dist/hexagon-layer/hexagon-layer-uniforms.d.ts +19 -0
  175. package/dist/hexagon-layer/hexagon-layer-uniforms.d.ts.map +1 -0
  176. package/dist/hexagon-layer/hexagon-layer-uniforms.js +22 -0
  177. package/dist/hexagon-layer/hexagon-layer-uniforms.js.map +1 -0
  178. package/dist/hexagon-layer/hexagon-layer.d.ts +84 -54
  179. package/dist/hexagon-layer/hexagon-layer.d.ts.map +1 -1
  180. package/dist/hexagon-layer/hexagon-layer.js +308 -123
  181. package/dist/hexagon-layer/hexagon-layer.js.map +1 -0
  182. package/dist/hexagon-layer/hexbin.d.ts +17 -0
  183. package/dist/hexagon-layer/hexbin.d.ts.map +1 -0
  184. package/dist/hexagon-layer/hexbin.js +70 -0
  185. package/dist/hexagon-layer/hexbin.js.map +1 -0
  186. package/dist/index.cjs +3026 -2947
  187. package/dist/index.cjs.map +4 -4
  188. package/dist/index.d.ts +7 -13
  189. package/dist/index.d.ts.map +1 -1
  190. package/dist/index.js +6 -27
  191. package/dist/index.js.map +1 -0
  192. package/dist/screen-grid-layer/bin-options-uniforms.d.ts +11 -0
  193. package/dist/screen-grid-layer/bin-options-uniforms.d.ts.map +1 -0
  194. package/dist/screen-grid-layer/bin-options-uniforms.js +16 -0
  195. package/dist/screen-grid-layer/bin-options-uniforms.js.map +1 -0
  196. package/dist/screen-grid-layer/screen-grid-cell-layer.d.ts +11 -16
  197. package/dist/screen-grid-layer/screen-grid-cell-layer.d.ts.map +1 -1
  198. package/dist/screen-grid-layer/screen-grid-cell-layer.js +53 -134
  199. package/dist/screen-grid-layer/screen-grid-cell-layer.js.map +1 -0
  200. package/dist/screen-grid-layer/screen-grid-layer-fragment.glsl.d.ts +1 -1
  201. package/dist/screen-grid-layer/screen-grid-layer-fragment.glsl.d.ts.map +1 -1
  202. package/dist/screen-grid-layer/screen-grid-layer-fragment.glsl.js +5 -24
  203. package/dist/screen-grid-layer/screen-grid-layer-fragment.glsl.js.map +1 -0
  204. package/dist/screen-grid-layer/screen-grid-layer-uniforms.d.ts +17 -0
  205. package/dist/screen-grid-layer/screen-grid-layer-uniforms.d.ts.map +1 -0
  206. package/dist/screen-grid-layer/screen-grid-layer-uniforms.js +20 -0
  207. package/dist/screen-grid-layer/screen-grid-layer-uniforms.js.map +1 -0
  208. package/dist/screen-grid-layer/screen-grid-layer-vertex.glsl.d.ts +1 -1
  209. package/dist/screen-grid-layer/screen-grid-layer-vertex.glsl.d.ts.map +1 -1
  210. package/dist/screen-grid-layer/screen-grid-layer-vertex.glsl.js +22 -62
  211. package/dist/screen-grid-layer/screen-grid-layer-vertex.glsl.js.map +1 -0
  212. package/dist/screen-grid-layer/screen-grid-layer.d.ts +33 -40
  213. package/dist/screen-grid-layer/screen-grid-layer.d.ts.map +1 -1
  214. package/dist/screen-grid-layer/screen-grid-layer.js +158 -174
  215. package/dist/screen-grid-layer/screen-grid-layer.js.map +1 -0
  216. package/dist.min.js +401 -382
  217. package/package.json +10 -9
  218. package/src/common/aggregation-layer.ts +107 -0
  219. package/src/common/aggregator/aggregator.ts +88 -0
  220. package/src/common/aggregator/cpu-aggregator/aggregate.ts +101 -0
  221. package/src/common/aggregator/cpu-aggregator/cpu-aggregator.ts +203 -0
  222. package/src/common/aggregator/cpu-aggregator/sort-bins.ts +63 -0
  223. package/src/common/aggregator/cpu-aggregator/vertex-accessor.ts +86 -0
  224. package/src/common/aggregator/gpu-aggregator/aggregation-transform-uniforms.ts +33 -0
  225. package/src/common/aggregator/gpu-aggregator/bin-sorter-uniforms.ts +27 -0
  226. package/src/common/aggregator/gpu-aggregator/utils.ts +27 -0
  227. package/src/common/aggregator/gpu-aggregator/webgl-aggregation-transform.ts +247 -0
  228. package/src/common/aggregator/gpu-aggregator/webgl-aggregator.ts +274 -0
  229. package/src/common/aggregator/gpu-aggregator/webgl-bin-sorter.ts +258 -0
  230. package/src/common/aggregator/index.ts +10 -0
  231. package/src/{types.ts → common/types.ts} +10 -4
  232. package/src/common/utils/bounds-utils.ts +34 -0
  233. package/src/common/utils/color-utils.ts +86 -0
  234. package/src/common/utils/prop-utils.ts +13 -0
  235. package/src/common/utils/scale-utils.ts +236 -0
  236. package/src/contour-layer/bin-options-uniforms.ts +26 -0
  237. package/src/contour-layer/contour-layer.ts +300 -265
  238. package/src/contour-layer/contour-utils.ts +68 -39
  239. package/src/contour-layer/marching-squares-codes.ts +4 -0
  240. package/src/contour-layer/marching-squares.ts +93 -82
  241. package/src/contour-layer/value-reader.ts +65 -0
  242. package/src/grid-layer/bin-options-uniforms.ts +26 -0
  243. package/src/grid-layer/grid-cell-layer-vertex.glsl.ts +68 -0
  244. package/src/grid-layer/grid-cell-layer.ts +141 -0
  245. package/src/grid-layer/grid-layer-uniforms.ts +37 -0
  246. package/src/grid-layer/grid-layer.ts +614 -73
  247. package/src/{aggregation-layer.ts → heatmap-layer/aggregation-layer.ts} +6 -21
  248. package/src/heatmap-layer/heatmap-layer-uniforms.ts +50 -0
  249. package/src/heatmap-layer/heatmap-layer-utils.ts +9 -1
  250. package/src/heatmap-layer/heatmap-layer.ts +59 -36
  251. package/src/heatmap-layer/max-fs.glsl.ts +4 -0
  252. package/src/heatmap-layer/max-vs.glsl.ts +7 -4
  253. package/src/heatmap-layer/triangle-layer-fragment.glsl.ts +5 -23
  254. package/src/heatmap-layer/triangle-layer-uniforms.ts +37 -0
  255. package/src/heatmap-layer/triangle-layer-vertex.glsl.ts +10 -30
  256. package/src/heatmap-layer/triangle-layer.ts +26 -31
  257. package/src/heatmap-layer/weights-fs.glsl.ts +4 -0
  258. package/src/heatmap-layer/weights-vs.glsl.ts +7 -7
  259. package/src/hexagon-layer/bin-options-uniforms.ts +27 -0
  260. package/src/hexagon-layer/hexagon-cell-layer-vertex.glsl.ts +73 -0
  261. package/src/hexagon-layer/hexagon-cell-layer.ts +141 -0
  262. package/src/hexagon-layer/hexagon-layer-uniforms.ts +34 -0
  263. package/src/hexagon-layer/hexagon-layer.ts +454 -186
  264. package/src/hexagon-layer/hexbin.ts +79 -0
  265. package/src/index.ts +21 -34
  266. package/src/screen-grid-layer/bin-options-uniforms.ts +23 -0
  267. package/src/screen-grid-layer/screen-grid-cell-layer.ts +71 -156
  268. package/src/screen-grid-layer/screen-grid-layer-fragment.glsl.ts +4 -24
  269. package/src/screen-grid-layer/screen-grid-layer-uniforms.ts +31 -0
  270. package/src/screen-grid-layer/screen-grid-layer-vertex.glsl.ts +21 -64
  271. package/src/screen-grid-layer/screen-grid-layer.ts +194 -222
  272. package/dist/aggregation-layer.d.ts.map +0 -1
  273. package/dist/cpu-grid-layer/cpu-grid-layer.d.ts +0 -158
  274. package/dist/cpu-grid-layer/cpu-grid-layer.d.ts.map +0 -1
  275. package/dist/cpu-grid-layer/cpu-grid-layer.js +0 -130
  276. package/dist/cpu-grid-layer/grid-aggregator.d.ts +0 -35
  277. package/dist/cpu-grid-layer/grid-aggregator.d.ts.map +0 -1
  278. package/dist/cpu-grid-layer/grid-aggregator.js +0 -141
  279. package/dist/gpu-grid-layer/gpu-grid-cell-layer-fragment.glsl.d.ts +0 -3
  280. package/dist/gpu-grid-layer/gpu-grid-cell-layer-fragment.glsl.d.ts.map +0 -1
  281. package/dist/gpu-grid-layer/gpu-grid-cell-layer-fragment.glsl.js +0 -30
  282. package/dist/gpu-grid-layer/gpu-grid-cell-layer-vertex.glsl.d.ts +0 -3
  283. package/dist/gpu-grid-layer/gpu-grid-cell-layer-vertex.glsl.d.ts.map +0 -1
  284. package/dist/gpu-grid-layer/gpu-grid-cell-layer-vertex.glsl.js +0 -112
  285. package/dist/gpu-grid-layer/gpu-grid-cell-layer.d.ts +0 -48
  286. package/dist/gpu-grid-layer/gpu-grid-cell-layer.d.ts.map +0 -1
  287. package/dist/gpu-grid-layer/gpu-grid-cell-layer.js +0 -146
  288. package/dist/gpu-grid-layer/gpu-grid-layer.d.ts +0 -99
  289. package/dist/gpu-grid-layer/gpu-grid-layer.d.ts.map +0 -1
  290. package/dist/gpu-grid-layer/gpu-grid-layer.js +0 -289
  291. package/dist/grid-aggregation-layer.d.ts +0 -67
  292. package/dist/grid-aggregation-layer.d.ts.map +0 -1
  293. package/dist/grid-aggregation-layer.js +0 -173
  294. package/dist/hexagon-layer/hexagon-aggregator.d.ts +0 -27
  295. package/dist/hexagon-layer/hexagon-aggregator.d.ts.map +0 -1
  296. package/dist/hexagon-layer/hexagon-aggregator.js +0 -112
  297. package/dist/types.d.ts +0 -12
  298. package/dist/types.d.ts.map +0 -1
  299. package/dist/types.js +0 -1
  300. package/dist/utils/aggregation-operation-utils.d.ts +0 -19
  301. package/dist/utils/aggregation-operation-utils.d.ts.map +0 -1
  302. package/dist/utils/aggregation-operation-utils.js +0 -94
  303. package/dist/utils/bin-sorter.d.ts +0 -52
  304. package/dist/utils/bin-sorter.d.ts.map +0 -1
  305. package/dist/utils/bin-sorter.js +0 -167
  306. package/dist/utils/color-utils.d.ts +0 -3
  307. package/dist/utils/color-utils.d.ts.map +0 -1
  308. package/dist/utils/color-utils.js +0 -53
  309. package/dist/utils/cpu-aggregator.d.ts +0 -169
  310. package/dist/utils/cpu-aggregator.d.ts.map +0 -1
  311. package/dist/utils/cpu-aggregator.js +0 -421
  312. package/dist/utils/gpu-grid-aggregation/aggregate-all-fs.glsl.d.ts +0 -3
  313. package/dist/utils/gpu-grid-aggregation/aggregate-all-fs.glsl.d.ts.map +0 -1
  314. package/dist/utils/gpu-grid-aggregation/aggregate-all-fs.glsl.js +0 -36
  315. package/dist/utils/gpu-grid-aggregation/aggregate-all-vs.glsl.d.ts +0 -3
  316. package/dist/utils/gpu-grid-aggregation/aggregate-all-vs.glsl.d.ts.map +0 -1
  317. package/dist/utils/gpu-grid-aggregation/aggregate-all-vs.glsl.js +0 -42
  318. package/dist/utils/gpu-grid-aggregation/aggregate-to-grid-fs.glsl.d.ts +0 -3
  319. package/dist/utils/gpu-grid-aggregation/aggregate-to-grid-fs.glsl.d.ts.map +0 -1
  320. package/dist/utils/gpu-grid-aggregation/aggregate-to-grid-fs.glsl.js +0 -30
  321. package/dist/utils/gpu-grid-aggregation/aggregate-to-grid-vs.glsl.d.ts +0 -3
  322. package/dist/utils/gpu-grid-aggregation/aggregate-to-grid-vs.glsl.d.ts.map +0 -1
  323. package/dist/utils/gpu-grid-aggregation/aggregate-to-grid-vs.glsl.js +0 -61
  324. package/dist/utils/gpu-grid-aggregation/gpu-grid-aggregator-constants.d.ts +0 -38
  325. package/dist/utils/gpu-grid-aggregation/gpu-grid-aggregator-constants.d.ts.map +0 -1
  326. package/dist/utils/gpu-grid-aggregation/gpu-grid-aggregator-constants.js +0 -41
  327. package/dist/utils/gpu-grid-aggregation/gpu-grid-aggregator-utils.d.ts +0 -1
  328. package/dist/utils/gpu-grid-aggregation/gpu-grid-aggregator-utils.d.ts.map +0 -1
  329. package/dist/utils/gpu-grid-aggregation/gpu-grid-aggregator-utils.js +0 -1
  330. package/dist/utils/gpu-grid-aggregation/gpu-grid-aggregator.d.ts +0 -76
  331. package/dist/utils/gpu-grid-aggregation/gpu-grid-aggregator.d.ts.map +0 -1
  332. package/dist/utils/gpu-grid-aggregation/gpu-grid-aggregator.js +0 -555
  333. package/dist/utils/gpu-grid-aggregation/transform-mean-vs.glsl.d.ts +0 -3
  334. package/dist/utils/gpu-grid-aggregation/transform-mean-vs.glsl.d.ts.map +0 -1
  335. package/dist/utils/gpu-grid-aggregation/transform-mean-vs.glsl.js +0 -32
  336. package/dist/utils/grid-aggregation-utils.d.ts +0 -30
  337. package/dist/utils/grid-aggregation-utils.d.ts.map +0 -1
  338. package/dist/utils/grid-aggregation-utils.js +0 -114
  339. package/dist/utils/prop-utils.d.ts.map +0 -1
  340. package/dist/utils/prop-utils.js +0 -28
  341. package/dist/utils/resource-utils.d.ts +0 -14
  342. package/dist/utils/resource-utils.d.ts.map +0 -1
  343. package/dist/utils/resource-utils.js +0 -38
  344. package/dist/utils/scale-utils.d.ts +0 -15
  345. package/dist/utils/scale-utils.d.ts.map +0 -1
  346. package/dist/utils/scale-utils.js +0 -184
  347. package/src/cpu-grid-layer/cpu-grid-layer.ts +0 -329
  348. package/src/cpu-grid-layer/grid-aggregator.ts +0 -184
  349. package/src/gpu-grid-layer/gpu-grid-cell-layer-fragment.glsl.ts +0 -35
  350. package/src/gpu-grid-layer/gpu-grid-cell-layer-vertex.glsl.ts +0 -143
  351. package/src/gpu-grid-layer/gpu-grid-cell-layer.ts +0 -201
  352. package/src/gpu-grid-layer/gpu-grid-layer.ts +0 -455
  353. package/src/grid-aggregation-layer.ts +0 -243
  354. package/src/hexagon-layer/hexagon-aggregator.ts +0 -127
  355. package/src/utils/aggregation-operation-utils.ts +0 -118
  356. package/src/utils/bin-sorter.ts +0 -218
  357. package/src/utils/color-utils.ts +0 -57
  358. package/src/utils/cpu-aggregator.ts +0 -503
  359. package/src/utils/gpu-grid-aggregation/aggregate-all-fs.glsl.ts +0 -40
  360. package/src/utils/gpu-grid-aggregation/aggregate-all-vs.glsl.ts +0 -54
  361. package/src/utils/gpu-grid-aggregation/aggregate-to-grid-fs.glsl.ts +0 -35
  362. package/src/utils/gpu-grid-aggregation/aggregate-to-grid-vs.glsl.ts +0 -79
  363. package/src/utils/gpu-grid-aggregation/gpu-grid-aggregator-constants.ts +0 -46
  364. package/src/utils/gpu-grid-aggregation/gpu-grid-aggregator-utils.ts +0 -0
  365. package/src/utils/gpu-grid-aggregation/gpu-grid-aggregator.md +0 -155
  366. package/src/utils/gpu-grid-aggregation/gpu-grid-aggregator.ts +0 -690
  367. package/src/utils/gpu-grid-aggregation/transform-mean-vs.glsl.ts +0 -38
  368. package/src/utils/grid-aggregation-utils.ts +0 -147
  369. package/src/utils/prop-utils.ts +0 -29
  370. package/src/utils/resource-utils.ts +0 -53
  371. package/src/utils/scale-utils.js +0 -219
  372. /package/dist/{utils → common/utils}/prop-utils.d.ts +0 -0
@@ -0,0 +1,202 @@
1
+ // deck.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright (c) vis.gl contributors
4
+ import { WebGLBinSorter } from "./webgl-bin-sorter.js";
5
+ import { WebGLAggregationTransform } from "./webgl-aggregation-transform.js";
6
+ import { _deepEqual as deepEqual, log } from '@deck.gl/core';
7
+ /** An Aggregator implementation that calculates aggregation on the GPU */
8
+ export class WebGLAggregator {
9
+ /** Checks if the current device supports GPU aggregation */
10
+ static isSupported(device) {
11
+ return (device.features.has('float32-renderable-webgl') &&
12
+ device.features.has('texture-blend-float-webgl'));
13
+ }
14
+ constructor(device, props) {
15
+ this.binCount = 0;
16
+ /** Cached outputs */
17
+ this.binIds = null;
18
+ this.results = [];
19
+ this.device = device;
20
+ this.dimensions = props.dimensions;
21
+ this.channelCount = props.channelCount;
22
+ this.props = {
23
+ ...props,
24
+ pointCount: 0,
25
+ binIdRange: [[0, 0]],
26
+ operations: [],
27
+ attributes: {},
28
+ binOptions: {}
29
+ };
30
+ this.needsUpdate = new Array(this.channelCount).fill(true);
31
+ this.binSorter = new WebGLBinSorter(device, props);
32
+ this.aggregationTransform = new WebGLAggregationTransform(device, props);
33
+ this.setProps(props);
34
+ }
35
+ getBins() {
36
+ const buffer = this.aggregationTransform.binBuffer;
37
+ if (!buffer) {
38
+ return null;
39
+ }
40
+ if (this.binIds?.buffer !== buffer) {
41
+ // deck.gl Attribute.setBinaryValue uses shallow comparison to determine if attribute value has changed
42
+ // For performance, only create a new binary attribute descriptor when Buffer changes
43
+ this.binIds = { buffer, type: 'float32', size: this.dimensions };
44
+ }
45
+ return this.binIds;
46
+ }
47
+ /** Returns an accessor to the output for a given channel. */
48
+ getResult(channel) {
49
+ const buffer = this.aggregationTransform.valueBuffer;
50
+ if (!buffer || channel >= this.channelCount) {
51
+ return null;
52
+ }
53
+ if (this.results[channel]?.buffer !== buffer) {
54
+ this.results[channel] = {
55
+ buffer,
56
+ type: 'float32',
57
+ size: 1,
58
+ stride: this.channelCount * 4,
59
+ offset: channel * 4
60
+ };
61
+ }
62
+ return this.results[channel];
63
+ }
64
+ /** Returns the [min, max] of aggregated values for a given channel. */
65
+ getResultDomain(channel) {
66
+ return this.aggregationTransform.domains[channel];
67
+ }
68
+ /** Returns the information for a given bin. */
69
+ getBin(index) {
70
+ if (index < 0 || index >= this.binCount) {
71
+ return null;
72
+ }
73
+ const { binIdRange } = this.props;
74
+ let id;
75
+ if (this.dimensions === 1) {
76
+ id = [index + binIdRange[0][0]];
77
+ }
78
+ else {
79
+ const [[x0, x1], [y0]] = binIdRange;
80
+ const width = x1 - x0;
81
+ id = [(index % width) + x0, Math.floor(index / width) + y0];
82
+ }
83
+ const pixel = this.binSorter.getBinValues(index);
84
+ if (!pixel) {
85
+ return null;
86
+ }
87
+ const count = pixel[3];
88
+ const value = [];
89
+ for (let channel = 0; channel < this.channelCount; channel++) {
90
+ const operation = this.props.operations[channel];
91
+ if (operation === 'COUNT') {
92
+ value[channel] = count;
93
+ }
94
+ else if (count === 0) {
95
+ value[channel] = NaN;
96
+ }
97
+ else {
98
+ value[channel] = operation === 'MEAN' ? pixel[channel] / count : pixel[channel];
99
+ }
100
+ }
101
+ return { id, value, count };
102
+ }
103
+ /** Release GPU resources */
104
+ destroy() {
105
+ this.binSorter.destroy();
106
+ this.aggregationTransform.destroy();
107
+ }
108
+ /** Update aggregation props. Normalize prop values and set change flags. */
109
+ setProps(props) {
110
+ const oldProps = this.props;
111
+ // Update local settings. These will set the flag this._needsUpdate
112
+ if ('binIdRange' in props && !deepEqual(props.binIdRange, oldProps.binIdRange, 2)) {
113
+ const binIdRange = props.binIdRange;
114
+ log.assert(binIdRange.length === this.dimensions);
115
+ if (this.dimensions === 1) {
116
+ const [[x0, x1]] = binIdRange;
117
+ this.binCount = x1 - x0;
118
+ }
119
+ else {
120
+ const [[x0, x1], [y0, y1]] = binIdRange;
121
+ this.binCount = (x1 - x0) * (y1 - y0);
122
+ }
123
+ this.binSorter.setDimensions(this.binCount, binIdRange);
124
+ this.aggregationTransform.setDimensions(this.binCount, binIdRange);
125
+ this.setNeedsUpdate();
126
+ }
127
+ if (props.operations) {
128
+ for (let channel = 0; channel < this.channelCount; channel++) {
129
+ if (props.operations[channel] !== oldProps.operations[channel]) {
130
+ this.setNeedsUpdate(channel);
131
+ }
132
+ }
133
+ }
134
+ if (props.pointCount !== undefined && props.pointCount !== oldProps.pointCount) {
135
+ this.binSorter.setModelProps({ vertexCount: props.pointCount });
136
+ this.setNeedsUpdate();
137
+ }
138
+ if (props.binOptions) {
139
+ if (!deepEqual(props.binOptions, oldProps.binOptions, 2)) {
140
+ this.setNeedsUpdate();
141
+ }
142
+ this.binSorter.model.shaderInputs.setProps({ binOptions: props.binOptions });
143
+ }
144
+ if (props.attributes) {
145
+ const attributeBuffers = {};
146
+ const constantAttributes = {};
147
+ for (const attribute of Object.values(props.attributes)) {
148
+ for (const [attributeName, value] of Object.entries(attribute.getValue())) {
149
+ if (ArrayBuffer.isView(value)) {
150
+ constantAttributes[attributeName] = value;
151
+ }
152
+ else if (value) {
153
+ attributeBuffers[attributeName] = value;
154
+ }
155
+ }
156
+ }
157
+ this.binSorter.setModelProps({ attributes: attributeBuffers, constantAttributes });
158
+ }
159
+ if (props.shaderModuleProps) {
160
+ this.binSorter.setModelProps({ shaderModuleProps: props.shaderModuleProps });
161
+ }
162
+ Object.assign(this.props, props);
163
+ }
164
+ /** Flags a channel to need update.
165
+ * This is called internally by setProps() if certain props change
166
+ * Users of this class still need to manually set the dirty flag sometimes, because even if no props changed
167
+ * the underlying buffers could have been updated and require rerunning the aggregation
168
+ * @param {number} channel - mark the given channel as dirty. If not provided, all channels will be updated.
169
+ */
170
+ setNeedsUpdate(channel) {
171
+ if (channel === undefined) {
172
+ this.needsUpdate.fill(true);
173
+ }
174
+ else {
175
+ this.needsUpdate[channel] = true;
176
+ }
177
+ }
178
+ update() { }
179
+ /** Run aggregation */
180
+ preDraw() {
181
+ if (!this.needsUpdate.some(Boolean)) {
182
+ return;
183
+ }
184
+ const { operations } = this.props;
185
+ const operationsToUpdate = this.needsUpdate.map((needsUpdate, i) => needsUpdate ? operations[i] : null);
186
+ // Render data to bins
187
+ this.binSorter.update(operationsToUpdate);
188
+ // Read to buffer and calculate domain
189
+ this.aggregationTransform.update(this.binSorter.texture, operations);
190
+ for (let i = 0; i < this.channelCount; i++) {
191
+ if (this.needsUpdate[i]) {
192
+ this.needsUpdate[i] = false;
193
+ this.props.onUpdate?.({ channel: i });
194
+ }
195
+ }
196
+ // Uncomment to debug
197
+ // console.log('binsFBO', new Float32Array(this.device.readPixelsToArrayWebGL(this.binSorter.texture!).buffer));
198
+ // console.log('binsBuffer', new Float32Array(this.aggregationTransform.binBuffer?.readSyncWebGL().buffer!));
199
+ // console.log('resultBuffer', new Float32Array(this.aggregationTransform.valueBuffer?.readSyncWebGL().buffer!));
200
+ }
201
+ }
202
+ //# sourceMappingURL=webgl-aggregator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"webgl-aggregator.js","sourceRoot":"","sources":["../../../../src/common/aggregator/gpu-aggregator/webgl-aggregator.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,oCAAoC;AAGpC,OAAO,EAAC,cAAc,EAAC,8BAA2B;AAClD,OAAO,EAAC,yBAAyB,EAAC,yCAAsC;AACxE,OAAO,EAAC,UAAU,IAAI,SAAS,EAAE,GAAG,EAAkB,MAAM,eAAe,CAAC;AAwC5E,0EAA0E;AAC1E,MAAM,OAAO,eAAe;IAC1B,4DAA4D;IAC5D,MAAM,CAAC,WAAW,CAAC,MAAc;QAC/B,OAAO,CACL,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,0BAA0B,CAAC;YAC/C,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,2BAA2B,CAAC,CACjD,CAAC;IACJ,CAAC;IAoBD,YAAY,MAAc,EAAE,KAA2B;QAhBvD,aAAQ,GAAW,CAAC,CAAC;QAYrB,qBAAqB;QACX,WAAM,GAA2B,IAAI,CAAC;QACtC,YAAO,GAAsB,EAAE,CAAC;QAGxC,IAAI,CAAC,MA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AC;gBACxB,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC;gBAC5B,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,EAAC,OAAO,EAAE,CAAC,EAAC,CAAC,CAAC;YACtC,CAAC;QACH,CAAC;QAED,qBAAqB;QACrB,gHAAgH;QAChH,6GAA6G;QAC7G,iHAAiH;IACnH,CAAC;CACF"}
@@ -0,0 +1,38 @@
1
+ import { Model, ModelProps } from '@luma.gl/engine';
2
+ import type { Device, Texture } from '@luma.gl/core';
3
+ import type { WebGLAggregatorProps } from "./webgl-aggregator.js";
4
+ import type { AggregationOperation } from "../aggregator.js";
5
+ export declare const TEXTURE_WIDTH = 1024;
6
+ /**
7
+ * This class manages the resources for performing the first step of aggregation
8
+ * Sort a list of data points into a number of bins
9
+ */
10
+ export declare class WebGLBinSorter {
11
+ device: Device;
12
+ model: Model;
13
+ /**
14
+ * A packed texture in which each pixel represents a bin.
15
+ * The index of the pixel in the memory layout is the bin index.
16
+ * Alpha value is the count of data points that fall into this bin
17
+ * R,G,B values are the aggregated values of each channel:
18
+ * - Sum of all data points if operation is 'SUM', or 'MEAN'
19
+ * - Min of all data points if operation is 'MIN'
20
+ * - Max of all data points if operation is 'MAX'
21
+ */
22
+ private binsFBO;
23
+ constructor(device: Device, props: WebGLAggregatorProps);
24
+ get texture(): Texture | null;
25
+ destroy(): void;
26
+ getBinValues(index: number): Float32Array | null;
27
+ setDimensions(binCount: number, binIdRange: [number, number][]): void;
28
+ setModelProps(props: Pick<ModelProps, 'vertexCount' | 'uniforms' | 'attributes' | 'constantAttributes'> & {
29
+ shaderModuleProps?: Record<string, any>;
30
+ }): void;
31
+ /** Update aggregation */
32
+ update(
33
+ /** The aggregation operation for each channel. Use null to skip update. */
34
+ operations: (AggregationOperation | null)[]): void;
35
+ /** Recalculate aggregation on the given channels using the given operation */
36
+ private _updateBins;
37
+ }
38
+ //# sourceMappingURL=webgl-bin-sorter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"webgl-bin-sorter.d.ts","sourceRoot":"","sources":["../../../../src/common/aggregator/gpu-aggregator/webgl-bin-sorter.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,KAAK,EAAE,UAAU,EAAC,MAAM,iBAAiB,CAAC;AAGlD,OAAO,KAAK,EAAC,MAAM,EAAe,OAAO,EAAC,MAAM,eAAe,CAAC;AAChE,OAAO,KAAK,EAAC,oBAAoB,EAAC,8BAA2B;AAC7D,OAAO,KAAK,EAAC,oBAAoB,EAAC,yBAAsB;AAOxD,eAAO,MAAM,aAAa,OAAO,CAAC;AAElC;;;GAGG;AACH,qBAAa,cAAc;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,KAAK,CAAC;IAEb;;;;;;;;OAQG;IACH,OAAO,CAAC,OAAO,CAA4B;gBAE/B,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,oBAAoB;IAKvD,IAAI,OAAO,IAAI,OAAO,GAAG,IAAI,CAE5B;IAED,OAAO;IAMP,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,YAAY,GAAG,IAAI;IAehD,aAAa,CAAC,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE;IAuB9D,aAAa,CACX,KAAK,EAAE,IAAI,CAAC,UAAU,EAAE,aAAa,GAAG,UAAU,GAAG,YAAY,GAAG,oBAAoB,CAAC,GAAG;QAC1F,iBAAiB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;KACzC;IAiBH,yBAAyB;IACzB,MAAM;IACJ,2EAA2E;IAC3E,UAAU,EAAE,CAAC,oBAAoB,GAAG,IAAI,CAAC,EAAE;IAW7C,8EAA8E;IAC9E,OAAO,CAAC,WAAW;CAqCpB"}
@@ -0,0 +1,224 @@
1
+ // deck.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright (c) vis.gl contributors
4
+ import { Model } from '@luma.gl/engine';
5
+ import { createRenderTarget } from "./utils.js";
6
+ import { binSorterUniforms } from "./bin-sorter-uniforms.js";
7
+ const COLOR_CHANNELS = [0x1, 0x2, 0x4, 0x8]; // GPU color mask RED, GREEN, BLUE, ALPHA
8
+ const MAX_FLOAT32 = 3e38;
9
+ const EMPTY_MASKS = { SUM: 0, MEAN: 0, MIN: 0, MAX: 0, COUNT: 0 };
10
+ export const TEXTURE_WIDTH = 1024;
11
+ /**
12
+ * This class manages the resources for performing the first step of aggregation
13
+ * Sort a list of data points into a number of bins
14
+ */
15
+ export class WebGLBinSorter {
16
+ constructor(device, props) {
17
+ /**
18
+ * A packed texture in which each pixel represents a bin.
19
+ * The index of the pixel in the memory layout is the bin index.
20
+ * Alpha value is the count of data points that fall into this bin
21
+ * R,G,B values are the aggregated values of each channel:
22
+ * - Sum of all data points if operation is 'SUM', or 'MEAN'
23
+ * - Min of all data points if operation is 'MIN'
24
+ * - Max of all data points if operation is 'MAX'
25
+ */
26
+ this.binsFBO = null;
27
+ this.device = device;
28
+ this.model = createModel(device, props);
29
+ }
30
+ get texture() {
31
+ return this.binsFBO ? this.binsFBO.colorAttachments[0].texture : null;
32
+ }
33
+ destroy() {
34
+ this.model.destroy();
35
+ this.binsFBO?.colorAttachments[0].texture.destroy();
36
+ this.binsFBO?.destroy();
37
+ }
38
+ getBinValues(index) {
39
+ if (!this.binsFBO) {
40
+ return null;
41
+ }
42
+ const x = index % TEXTURE_WIDTH;
43
+ const y = Math.floor(index / TEXTURE_WIDTH);
44
+ const buffer = this.device.readPixelsToArrayWebGL(this.binsFBO, {
45
+ sourceX: x,
46
+ sourceY: y,
47
+ sourceWidth: 1,
48
+ sourceHeight: 1
49
+ }).buffer;
50
+ return new Float32Array(buffer);
51
+ }
52
+ setDimensions(binCount, binIdRange) {
53
+ const width = TEXTURE_WIDTH;
54
+ const height = Math.ceil(binCount / width);
55
+ // Only destroy existing texture if it is not large enough
56
+ if (!this.binsFBO) {
57
+ this.binsFBO = createRenderTarget(this.device, width, height);
58
+ }
59
+ else if (this.binsFBO.height < height) {
60
+ this.binsFBO.resize({ width, height });
61
+ }
62
+ const binSorterProps = {
63
+ binIdRange: [
64
+ binIdRange[0][0],
65
+ binIdRange[0][1],
66
+ binIdRange[1]?.[0] || 0,
67
+ binIdRange[1]?.[1] || 0
68
+ ],
69
+ targetSize: [this.binsFBO.width, this.binsFBO.height]
70
+ };
71
+ this.model.shaderInputs.setProps({ binSorter: binSorterProps });
72
+ }
73
+ setModelProps(props) {
74
+ const model = this.model;
75
+ if (props.attributes) {
76
+ model.setAttributes(props.attributes);
77
+ }
78
+ if (props.constantAttributes) {
79
+ model.setConstantAttributes(props.constantAttributes);
80
+ }
81
+ if (props.vertexCount !== undefined) {
82
+ model.setVertexCount(props.vertexCount);
83
+ }
84
+ if (props.shaderModuleProps) {
85
+ model.shaderInputs.setProps(props.shaderModuleProps);
86
+ }
87
+ }
88
+ /** Update aggregation */
89
+ update(
90
+ /** The aggregation operation for each channel. Use null to skip update. */
91
+ operations) {
92
+ if (!this.binsFBO) {
93
+ return;
94
+ }
95
+ const masks = getMaskByOperation(operations);
96
+ this._updateBins('SUM', masks.SUM + masks.MEAN);
97
+ this._updateBins('MIN', masks.MIN);
98
+ this._updateBins('MAX', masks.MAX);
99
+ }
100
+ /** Recalculate aggregation on the given channels using the given operation */
101
+ _updateBins(operation,
102
+ /** GPU bit mask of one or more channels that should be updated */
103
+ colorMask) {
104
+ if (colorMask === 0) {
105
+ return;
106
+ }
107
+ colorMask |= COLOR_CHANNELS[3]; // Also renders to the alpha channel (point count)
108
+ const model = this.model;
109
+ const target = this.binsFBO;
110
+ const initialValue = operation === 'MAX' ? -MAX_FLOAT32 : operation === 'MIN' ? MAX_FLOAT32 : 0;
111
+ const renderPass = this.device.beginRenderPass({
112
+ id: `gpu-aggregation-${operation}`,
113
+ framebuffer: target,
114
+ parameters: {
115
+ viewport: [0, 0, target.width, target.height],
116
+ colorMask
117
+ },
118
+ clearColor: [initialValue, initialValue, initialValue, 0],
119
+ clearDepth: false,
120
+ clearStencil: false
121
+ });
122
+ model.setParameters({
123
+ blend: true,
124
+ blendColorSrcFactor: 'one',
125
+ blendColorDstFactor: 'one',
126
+ blendAlphaSrcFactor: 'one',
127
+ blendAlphaDstFactor: 'one',
128
+ blendColorOperation: operation === 'MAX' ? 'max' : operation === 'MIN' ? 'min' : 'add',
129
+ blendAlphaOperation: 'add'
130
+ });
131
+ model.draw(renderPass);
132
+ renderPass.end();
133
+ }
134
+ }
135
+ /** Convert a [channel -> operation] map to a [operation -> GPU color mask] map */
136
+ function getMaskByOperation(operations) {
137
+ const result = { ...EMPTY_MASKS };
138
+ for (let channel = 0; channel < operations.length; channel++) {
139
+ const op = operations[channel];
140
+ if (op) {
141
+ result[op] += COLOR_CHANNELS[channel];
142
+ }
143
+ }
144
+ return result;
145
+ }
146
+ function createModel(device, props) {
147
+ let userVs = props.vs;
148
+ if (props.dimensions === 2) {
149
+ // If user provides 2d bin IDs, convert them to 1d indices for data packing
150
+ userVs += /* glsl */ `
151
+ void getBin(out int binId) {
152
+ ivec2 binId2;
153
+ getBin(binId2);
154
+ if (binId2.x < binSorter.binIdRange.x || binId2.x >= binSorter.binIdRange.y) {
155
+ binId = -1;
156
+ } else {
157
+ binId = (binId2.y - binSorter.binIdRange.z) * (binSorter.binIdRange.y - binSorter.binIdRange.x) + binId2.x;
158
+ }
159
+ }
160
+ `;
161
+ }
162
+ const vs = `\
163
+ #version 300 es
164
+ #define SHADER_NAME gpu-aggregation-sort-bins-vertex
165
+
166
+ ${userVs}
167
+
168
+ out vec3 v_Value;
169
+
170
+ void main() {
171
+ int binIndex;
172
+ getBin(binIndex);
173
+ binIndex = binIndex - binSorter.binIdRange.x;
174
+ if (binIndex < 0) {
175
+ gl_Position = vec4(0.);
176
+ return;
177
+ }
178
+ int row = binIndex / binSorter.targetSize.x;
179
+ int col = binIndex - row * binSorter.targetSize.x;
180
+ vec2 position = (vec2(col, row) + 0.5) / vec2(binSorter.targetSize) * 2.0 - 1.0;
181
+ gl_Position = vec4(position, 0.0, 1.0);
182
+ gl_PointSize = 1.0;
183
+
184
+ #if NUM_CHANNELS == 3
185
+ getValue(v_Value);
186
+ #elif NUM_CHANNELS == 2
187
+ getValue(v_Value.xy);
188
+ #else
189
+ getValue(v_Value.x);
190
+ #endif
191
+ }
192
+ `;
193
+ const fs = /* glsl */ `\
194
+ #version 300 es
195
+ #define SHADER_NAME gpu-aggregation-sort-bins-fragment
196
+
197
+ precision highp float;
198
+
199
+ in vec3 v_Value;
200
+ out vec4 fragColor;
201
+
202
+ void main() {
203
+ fragColor.xyz = v_Value;
204
+
205
+ #ifdef MODULE_GEOMETRY
206
+ geometry.uv = vec2(0.);
207
+ DECKGL_FILTER_COLOR(fragColor, geometry);
208
+ #endif
209
+
210
+ fragColor.w = 1.0;
211
+ }
212
+ `;
213
+ const model = new Model(device, {
214
+ bufferLayout: props.bufferLayout,
215
+ modules: [...(props.modules || []), binSorterUniforms],
216
+ defines: { ...props.defines, NON_INSTANCED_MODEL: 1, NUM_CHANNELS: props.channelCount },
217
+ isInstanced: false,
218
+ vs,
219
+ fs,
220
+ topology: 'point-list'
221
+ });
222
+ return model;
223
+ }
224
+ //# sourceMappingURL=webgl-bin-sorter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"webgl-bin-sorter.js","sourceRoot":"","sources":["../../../../src/common/aggregator/gpu-aggregator/webgl-bin-sorter.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,oCAAoC;AAEpC,OAAO,EAAC,KAAK,EAAa,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAC,kBAAkB,EAAC,mBAAgB;AAK3C,OAAO,EAAiB,iBAAiB,EAAC,iCAA8B;AAExE,MAAM,cAAc,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC,yCAAyC;AACtF,MAAM,WAAW,GAAG,IAAI,CAAC;AACzB,MAAM,WAAW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CAAC,EAAE,CAAC,IAAI,cAAc,CAAC,OAAO,CAAC,CAAC;QACxC,CAAC;IACH,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,SAAS,WAAW,CAAC,MAAc,EAAE,KAA2B;IAC9D,IAAI,MAAM,GAAG,KAAK,CAAC,EAAE,CAAC;IAEtB,IAAI,KAAK,CAAC,UAAU,KAAK,CAAC,EAAE,CAAC;QAC3B,2EAA2E;QAC3E,MAAM,IAAI,UAAU,CAAC;;;;;;;;;;CAUxB,CAAC;IACA,CAAC;IAED,MAAM,EAAE,GAAG;;;;EAIX,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;CA0BP,CAAC;IACA,MAAM,EAAE,GAAG,UAAU,CAAC;;;;;;;;;;;;;;;;;;;CAmBvB,CAAC;IACA,MAAM,KAAK,GAAG,IAAI,KAAK,CAAC,MAAM,EAAE;QAC9B,YAAY,EAAE,KAAK,CAAC,YAAY;QAChC,OAAO,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC,OAAO,IAAI,EAAE,CAAC,EAAE,iBAAiB,CAAC;QACtD,OAAO,EAAE,EAAC,GAAG,KAAK,CAAC,OAAO,EAAE,mBAAmB,EAAE,CAAC,EAAE,YAAY,EAAE,KAAK,CAAC,YAAY,EAAC;QACrF,WAAW,EAAE,KAAK;QAClB,EAAE;QACF,EAAE;QACF,QAAQ,EAAE,YAAY;KACvB,CAAC,CAAC;IACH,OAAO,KAAK,CAAC;AACf,CAAC"}
@@ -0,0 +1,6 @@
1
+ export { CPUAggregator } from "./cpu-aggregator/cpu-aggregator.js";
2
+ export { WebGLAggregator } from "./gpu-aggregator/webgl-aggregator.js";
3
+ export type { Aggregator, AggregatedBin, AggregationOperation, AggregationProps } from "./aggregator.js";
4
+ export type { CPUAggregatorProps } from "./cpu-aggregator/cpu-aggregator.js";
5
+ export type { WebGLAggregatorProps } from "./gpu-aggregator/webgl-aggregator.js";
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/common/aggregator/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,aAAa,EAAC,2CAAwC;AAC9D,OAAO,EAAC,eAAe,EAAC,6CAA0C;AAElE,YAAY,EAAC,UAAU,EAAE,aAAa,EAAE,oBAAoB,EAAE,gBAAgB,EAAC,wBAAqB;AACpG,YAAY,EAAC,kBAAkB,EAAC,2CAAwC;AACxE,YAAY,EAAC,oBAAoB,EAAC,6CAA0C"}
@@ -0,0 +1,6 @@
1
+ // deck.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright (c) vis.gl contributors
4
+ export { CPUAggregator } from "./cpu-aggregator/cpu-aggregator.js";
5
+ export { WebGLAggregator } from "./gpu-aggregator/webgl-aggregator.js";
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/common/aggregator/index.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,oCAAoC;AAEpC,OAAO,EAAC,aAAa,EAAC,2CAAwC;AAC9D,OAAO,EAAC,eAAe,EAAC,6CAA0C"}
@@ -0,0 +1,11 @@
1
+ /** Type assigned to e.g. getColorValue/getElevationValue props in aggregation layers (e.g. CPUGridLayer, HexagonLayer)*/
2
+ export type AggregateAccessor<DataT = any> = (
3
+ /** a list of objects whose positions fall inside this cell. */
4
+ objects: DataT[], objectInfo: {
5
+ /** the indices of `objects` in the original data. */
6
+ indices: number[];
7
+ /** the value of the `data` prop */
8
+ data: any;
9
+ }) => number;
10
+ export type ScaleType = 'linear' | 'quantize' | 'quantile' | 'ordinal';
11
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/common/types.ts"],"names":[],"mappings":"AAIA,yHAAyH;AACzH,MAAM,MAAM,iBAAiB,CAAC,KAAK,GAAG,GAAG,IAAI;AAC3C,+DAA+D;AAC/D,OAAO,EAAE,KAAK,EAAE,EAChB,UAAU,EAAE;IACV,qDAAqD;IACrD,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,mCAAmC;IACnC,IAAI,EAAE,GAAG,CAAC;CACX,KACE,MAAM,CAAC;AAEZ,MAAM,MAAM,SAAS,GAAG,QAAQ,GAAG,UAAU,GAAG,UAAU,GAAG,SAAS,CAAC"}
@@ -0,0 +1,5 @@
1
+ // deck.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright (c) vis.gl contributors
4
+ export {};
5
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/common/types.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,oCAAoC"}
@@ -0,0 +1,10 @@
1
+ /** Utility to estimate binIdRange as expected by AggregatorProps */
2
+ export declare function getBinIdRange({ dataBounds, getBinId, padding }: {
3
+ /** Bounds of the input data */
4
+ dataBounds: [min: number[], max: number[]];
5
+ /** Given a data point, returns the bin id that it belongs to */
6
+ getBinId: (p: number[]) => number[];
7
+ /** Add a border around the result to avoid clipping */
8
+ padding?: number;
9
+ }): [number, number][];
10
+ //# sourceMappingURL=bounds-utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bounds-utils.d.ts","sourceRoot":"","sources":["../../../src/common/utils/bounds-utils.ts"],"names":[],"mappings":"AAIA,oEAAoE;AACpE,wBAAgB,aAAa,CAAC,EAC5B,UAAU,EACV,QAAQ,EACR,OAAW,EACZ,EAAE;IACD,+BAA+B;IAC/B,UAAU,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,EAAE,CAAC,CAAC;IAC3C,gEAAgE;IAChE,QAAQ,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,MAAM,EAAE,CAAC;IACpC,uDAAuD;IACvD,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,CAiBrB"}
@@ -0,0 +1,21 @@
1
+ // deck.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright (c) vis.gl contributors
4
+ /** Utility to estimate binIdRange as expected by AggregatorProps */
5
+ export function getBinIdRange({ dataBounds, getBinId, padding = 0 }) {
6
+ const corners = [
7
+ dataBounds[0],
8
+ dataBounds[1],
9
+ [dataBounds[0][0], dataBounds[1][1]],
10
+ [dataBounds[1][0], dataBounds[0][1]]
11
+ ].map(p => getBinId(p));
12
+ const minX = Math.min(...corners.map(p => p[0])) - padding;
13
+ const minY = Math.min(...corners.map(p => p[1])) - padding;
14
+ const maxX = Math.max(...corners.map(p => p[0])) + padding + 1;
15
+ const maxY = Math.max(...corners.map(p => p[1])) + padding + 1;
16
+ return [
17
+ [minX, maxX],
18
+ [minY, maxY]
19
+ ];
20
+ }
21
+ //# sourceMappingURL=bounds-utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bounds-utils.js","sourceRoot":"","sources":["../../../src/common/utils/bounds-utils.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,oCAAoC;AAEpC,oEAAoE;AACpE,MAAM,UAAU,aAAa,CAAC,EAC5B,UAAU,EACV,QAAQ,EACR,OAAO,GAAG,CAAC,EAQZ;IACC,MAAM,OAAO,GAAG;QACd,UAAU,CAAC,CAAC,CAAC;QACb,UAAU,CAAC,CAAC,CAAC;QACb,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QACpC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;KACrC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;IAExB,MAAM,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC;IAC3D,MAAM,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC;IAC3D,MAAM,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,OAAO,GAAG,CAAC,CAAC;IAC/D,MAAM,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,OAAO,GAAG,CAAC,CAAC;IAE/D,OAAO;QACL,CAAC,IAAI,EAAE,IAAI,CAAC;QACZ,CAAC,IAAI,EAAE,IAAI,CAAC;KACb,CAAC;AACJ,CAAC"}
@@ -0,0 +1,10 @@
1
+ import type { Color } from '@deck.gl/core';
2
+ import type { Device, Texture } from '@luma.gl/core';
3
+ import type { NumericArray, TypedArray, TypedArrayConstructor } from '@math.gl/types';
4
+ import type { ScaleType } from "../types.js";
5
+ export declare const defaultColorRange: Color[];
6
+ export declare function colorRangeToFlatArray(colorRange: Color[] | NumericArray, normalize?: boolean, ArrayType?: TypedArrayConstructor): TypedArray;
7
+ export declare const COLOR_RANGE_FILTER: Record<ScaleType, 'linear' | 'nearest'>;
8
+ export declare function updateColorRangeTexture(texture: Texture, type: ScaleType): void;
9
+ export declare function createColorRangeTexture(device: Device, colorRange: Color[] | NumericArray, type?: ScaleType): Texture;
10
+ //# sourceMappingURL=color-utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"color-utils.d.ts","sourceRoot":"","sources":["../../../src/common/utils/color-utils.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,KAAK,EAAC,MAAM,eAAe,CAAC;AACzC,OAAO,KAAK,EAAC,MAAM,EAAE,OAAO,EAAC,MAAM,eAAe,CAAC;AACnD,OAAO,KAAK,EAAC,YAAY,EAAE,UAAU,EAAE,qBAAqB,EAAC,MAAM,gBAAgB,CAAC;AACpF,OAAO,KAAK,EAAC,SAAS,EAAC,oBAAiB;AAExC,eAAO,MAAM,iBAAiB,EAAE,KAAK,EAOpC,CAAC;AAGF,wBAAgB,qBAAqB,CACnC,UAAU,EAAE,KAAK,EAAE,GAAG,YAAY,EAClC,SAAS,UAAQ,EACjB,SAAS,GAAE,qBAAoC,GAC9C,UAAU,CA0BZ;AAED,eAAO,MAAM,kBAAkB,EAAE,MAAM,CAAC,SAAS,EAAE,QAAQ,GAAG,SAAS,CAK7D,CAAC;AAEX,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,QAKxE;AAED,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,KAAK,EAAE,GAAG,YAAY,EAClC,IAAI,GAAE,SAAoB,GACzB,OAAO,CAgBT"}