@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,30 @@
1
+ import { CompositeLayer, LayerDataSource, LayerContext, UpdateParameters, CompositeLayerProps, Attribute, AttributeManager } from '@deck.gl/core';
2
+ import { Aggregator } from "./aggregator/aggregator.js";
3
+ export type AggregationLayerProps<DataT> = CompositeLayerProps & {
4
+ data: LayerDataSource<DataT>;
5
+ };
6
+ export default abstract class AggregationLayer<DataT, ExtraPropsT extends {} = {}> extends CompositeLayer<Required<AggregationLayer<DataT>> & ExtraPropsT> {
7
+ static layerName: string;
8
+ state: {
9
+ aggregatorType: string;
10
+ aggregator: Aggregator;
11
+ };
12
+ /** Allow this layer to participates in the draw cycle */
13
+ get isDrawable(): boolean;
14
+ abstract getAggregatorType(): string;
15
+ /** Called to create an Aggregator instance */
16
+ abstract createAggregator(type: string): Aggregator;
17
+ /** Called when some attributes change, a chance to mark Aggregator as dirty */
18
+ abstract onAttributeChange(id: string): void;
19
+ initializeState(): void;
20
+ updateState(params: UpdateParameters<this>): boolean;
21
+ finalizeState(context: LayerContext): void;
22
+ protected updateAttributes(changedAttributes: {
23
+ [id: string]: Attribute;
24
+ }): void;
25
+ draw({ shaderModuleProps }: {
26
+ shaderModuleProps: any;
27
+ }): void;
28
+ _getAttributeManager(): AttributeManager;
29
+ }
30
+ //# sourceMappingURL=aggregation-layer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"aggregation-layer.d.ts","sourceRoot":"","sources":["../../src/common/aggregation-layer.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,cAAc,EACd,eAAe,EACf,YAAY,EACZ,gBAAgB,EAChB,mBAAmB,EACnB,SAAS,EACT,gBAAgB,EACjB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAC,UAAU,EAAC,mCAAgC;AAEnD,MAAM,MAAM,qBAAqB,CAAC,KAAK,IAAI,mBAAmB,GAAG;IAC/D,IAAI,EAAE,eAAe,CAAC,KAAK,CAAC,CAAC;CAC9B,CAAC;AAEF,MAAM,CAAC,OAAO,CAAC,QAAQ,OAAO,gBAAgB,CAC5C,KAAK,EACL,WAAW,SAAS,EAAE,GAAG,EAAE,CAC3B,SAAQ,cAAc,CAAC,QAAQ,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC,GAAG,WAAW,CAAC;IACvE,MAAM,CAAC,SAAS,SAAsB;IAEtC,KAAK,EAAG;QACN,cAAc,EAAE,MAAM,CAAC;QACvB,UAAU,EAAE,UAAU,CAAC;KACxB,CAAC;IAEF,yDAAyD;IACzD,IAAI,UAAU,YAEb;IAED,QAAQ,CAAC,iBAAiB,IAAI,MAAM;IACpC,8CAA8C;IAC9C,QAAQ,CAAC,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU;IACnD,+EAA+E;IAC/E,QAAQ,CAAC,iBAAiB,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI;IAE5C,eAAe,IAAI,IAAI;IAMvB,WAAW,CAAC,MAAM,EAAE,gBAAgB,CAAC,IAAI,CAAC,GAAG,OAAO;IAiBpD,aAAa,CAAC,OAAO,EAAE,YAAY;IAMnC,SAAS,CAAC,gBAAgB,CAAC,iBAAiB,EAAE;QAAC,CAAC,EAAE,EAAE,MAAM,GAAG,SAAS,CAAA;KAAC;IAkBvE,IAAI,CAAC,EAAC,iBAAiB,EAAC;;KAAA;IAYxB,oBAAoB;CAMrB"}
@@ -0,0 +1,70 @@
1
+ // deck.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright (c) vis.gl contributors
4
+ import { CompositeLayer, AttributeManager } from '@deck.gl/core';
5
+ class AggregationLayer extends CompositeLayer {
6
+ /** Allow this layer to participates in the draw cycle */
7
+ get isDrawable() {
8
+ return true;
9
+ }
10
+ initializeState() {
11
+ this.getAttributeManager().remove(['instancePickingColors']);
12
+ }
13
+ // Extend Layer.updateState to update the Aggregator instance
14
+ // returns true if aggregator is changed
15
+ updateState(params) {
16
+ super.updateState(params);
17
+ const aggregatorType = this.getAggregatorType();
18
+ if (params.changeFlags.extensionsChanged || this.state.aggregatorType !== aggregatorType) {
19
+ this.state.aggregator?.destroy();
20
+ const aggregator = this.createAggregator(aggregatorType);
21
+ aggregator.setProps({
22
+ attributes: this.getAttributeManager()?.attributes
23
+ });
24
+ this.setState({ aggregator, aggregatorType });
25
+ return true;
26
+ }
27
+ return false;
28
+ }
29
+ // Override Layer.finalizeState to dispose the Aggregator instance
30
+ finalizeState(context) {
31
+ super.finalizeState(context);
32
+ this.state.aggregator.destroy();
33
+ }
34
+ // Override Layer.updateAttributes to update the aggregator
35
+ updateAttributes(changedAttributes) {
36
+ const { aggregator } = this.state;
37
+ aggregator.setProps({
38
+ attributes: changedAttributes
39
+ });
40
+ for (const id in changedAttributes) {
41
+ this.onAttributeChange(id);
42
+ }
43
+ // In aggregator.update() the aggregator allocates the buffers to store its output
44
+ // These buffers will be exposed by aggregator.getResults() and passed to the sublayers
45
+ // Therefore update() must be called before renderLayers()
46
+ // CPUAggregator's output is populated right here in update()
47
+ // GPUAggregator's output is pre-allocated and populated in preDraw(), see comments below
48
+ aggregator.update();
49
+ }
50
+ draw({ shaderModuleProps }) {
51
+ // GPU aggregation needs `shaderModuleProps` for projection/filter uniforms which are only accessible at draw time
52
+ // GPUAggregator's Buffers are pre-allocated during `update()` and passed down to the sublayer attributes in renderLayers()
53
+ // Although the Buffers have been bound to the sublayer's Model, their content are not populated yet
54
+ // GPUAggregator.preDraw() is called in the draw cycle here right before Buffers are used by sublayer.draw()
55
+ const { aggregator } = this.state;
56
+ // @ts-expect-error only used by GPU aggregators
57
+ aggregator.setProps({ shaderModuleProps });
58
+ aggregator.preDraw();
59
+ }
60
+ // override CompositeLayer._getAttributeManager to create AttributeManager instance
61
+ _getAttributeManager() {
62
+ return new AttributeManager(this.context.device, {
63
+ id: this.props.id,
64
+ stats: this.context.stats
65
+ });
66
+ }
67
+ }
68
+ AggregationLayer.layerName = 'AggregationLayer';
69
+ export default AggregationLayer;
70
+ //# sourceMappingURL=aggregation-layer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"aggregation-layer.js","sourceRoot":"","sources":["../../src/common/aggregation-layer.ts"],"names":[],"mappings":"A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AAC,QAAQ,CAAC;YAClB,UAAU,EAAE,iBAAiB;SAC9B,CAAC,CAAC;QAEH,KAAK,MAAM,EAAE,IAAI,iBAAiB,EAAE,CAAC;YACnC,IAAI,CAAC,iBAAiB,CAAC,EAAE,CAAC,CAAC;QAC7B,CAAC;QAED,kFAAkF;QAClF,uFAAuF;QACvF,0DAA0D;QAC1D,6DAA6D;QAC7D,yFAAyF;QACzF,UAAU,CAAC,MAAM,EAAE,CAAC;IACtB,CAAC;IAED,IAAI,CAAC,EAAC,iBAAiB,EAAC;QACtB,kHAAkH;QAClH,2HAA2H;QAC3H,oGAAoG;QACpG,4GAA4G;QAC5G,MAAM,EAAC,UAAU,EAAC,GAAG,IAAI,CAAC,KAAK,CAAC;QAChC,gDAAgD;QAChD,UAAU,CAAC,QAAQ,CAAC,EAAC,iBAAiB,EAAC,CAAC,CAAC;QACzC,UAAU,CAAC,OAAO,EAAE,CAAC;IACvB,CAAC;IAED,mFAAmF;IACnF,oBAAoB;QAClB,OAAO,IAAI,gBAAgB,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE;YAC/C,EAAE,EAAE,IAAI,CAAC,KAAK,CAAC,EAAE;YACjB,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC,KAAK;SAC1B,CAAC,CAAC;IACL,CAAC;;AAlFM,0BAAS,GAAG,kBAAkB,CAAC;eAJV,gBAAgB"}
@@ -0,0 +1,76 @@
1
+ import type { Attribute, BinaryAttribute } from '@deck.gl/core';
2
+ /** Method used to reduce a list of values to one number */
3
+ export type AggregationOperation = 'SUM' | 'MEAN' | 'MIN' | 'MAX' | 'COUNT';
4
+ /** Baseline inputs to an Aggregator */
5
+ export type AggregationProps = {
6
+ /** Number of data points */
7
+ pointCount: number;
8
+ /** The input data */
9
+ attributes: {
10
+ [id: string]: Attribute;
11
+ };
12
+ /** How to aggregate the values inside a bin, defined for each channel */
13
+ operations: AggregationOperation[];
14
+ /** Additional options to control bin sorting, e.g. bin size */
15
+ binOptions: Record<string, number | number[]>;
16
+ /** Callback after a channel is updated */
17
+ onUpdate?: (event: {
18
+ channel: number;
19
+ }) => void;
20
+ };
21
+ /** Descriptor of an aggregated bin */
22
+ export type AggregatedBin = {
23
+ /** The unique identifier of the bin */
24
+ id: number[];
25
+ /** Aggregated values by channel */
26
+ value: number[];
27
+ /** Count of data points in this bin */
28
+ count: number;
29
+ /** Indices of data points in this bin. Only available if using CPU aggregation. */
30
+ pointIndices?: number[];
31
+ };
32
+ /**
33
+ * The Aggregator interface describes a class that performs aggregation.
34
+ *
35
+ * _Aggregation_ is a 2-step process:
36
+ * 1. Sort: Group a collection of _data points_ by some property into _bins_.
37
+ * 2. Aggregate: for each _bin_, calculate a numeric output (_result_) from some metrics (_values_) from all its members.
38
+ * Multiple results can be obtained independently (_channels_).
39
+ *
40
+ * An implementation of the _Aggregator_ interface takes the following inputs:
41
+ * - The number of data points
42
+ * - The group that each data point belongs to, by mapping each data point to a _binId_ (integer or array of integers)
43
+ * - The values to aggregate, by mapping each data point in each channel to one _value_ (number)
44
+ * - The method (_operation_) to reduce a list of values to one number, such as SUM
45
+ *
46
+ * And yields the following outputs:
47
+ * - A list of _binId_ that data points get sorted into
48
+ * - The aggregated values (_result_) as a list of numbers, comprised of one number per bin per channel
49
+ * - The [min, max] among all aggregated values (_domain_) for each channel
50
+ *
51
+ */
52
+ export interface Aggregator {
53
+ /** Update aggregation props */
54
+ setProps(props: Partial<AggregationProps>): void;
55
+ /** Flags a channel to need update
56
+ * @param {number} channel - mark the given channel as dirty. If not provided, all channels will be updated.
57
+ */
58
+ setNeedsUpdate(channel?: number): void;
59
+ /** Called after props are set and before results are accessed */
60
+ update(): void;
61
+ /** Called before layer is drawn to screen. */
62
+ preDraw(): void;
63
+ /** Dispose all allocated resources */
64
+ destroy(): void;
65
+ /** Get the number of bins */
66
+ get binCount(): number;
67
+ /** Returns an accessor to the bins. */
68
+ getBins(): BinaryAttribute | null;
69
+ /** Returns an accessor to the output for a given channel. */
70
+ getResult(channel: number): BinaryAttribute | null;
71
+ /** Returns the [min, max] of aggregated values for a given channel. */
72
+ getResultDomain(channel: number): [min: number, max: number];
73
+ /** Returns the information for a given bin. */
74
+ getBin(index: number): AggregatedBin | null;
75
+ }
76
+ //# sourceMappingURL=aggregator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"aggregator.d.ts","sourceRoot":"","sources":["../../../src/common/aggregator/aggregator.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,SAAS,EAAE,eAAe,EAAC,MAAM,eAAe,CAAC;AAE9D,2DAA2D;AAC3D,MAAM,MAAM,oBAAoB,GAAG,KAAK,GAAG,MAAM,GAAG,KAAK,GAAG,KAAK,GAAG,OAAO,CAAC;AAE5E,uCAAuC;AACvC,MAAM,MAAM,gBAAgB,GAAG;IAC7B,4BAA4B;IAC5B,UAAU,EAAE,MAAM,CAAC;IACnB,qBAAqB;IACrB,UAAU,EAAE;QAAC,CAAC,EAAE,EAAE,MAAM,GAAG,SAAS,CAAA;KAAC,CAAC;IACtC,yEAAyE;IACzE,UAAU,EAAE,oBAAoB,EAAE,CAAC;IACnC,+DAA+D;IAC/D,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC,CAAC;IAC9C,0CAA0C;IAC1C,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE;QAAC,OAAO,EAAE,MAAM,CAAA;KAAC,KAAK,IAAI,CAAC;CAC/C,CAAC;AAEF,sCAAsC;AACtC,MAAM,MAAM,aAAa,GAAG;IAC1B,uCAAuC;IACvC,EAAE,EAAE,MAAM,EAAE,CAAC;IACb,mCAAmC;IACnC,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,uCAAuC;IACvC,KAAK,EAAE,MAAM,CAAC;IACd,mFAAmF;IACnF,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;CACzB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,WAAW,UAAU;IACzB,+BAA+B;IAC/B,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC,gBAAgB,CAAC,GAAG,IAAI,CAAC;IAEjD;;OAEG;IACH,cAAc,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAEvC,iEAAiE;IACjE,MAAM,IAAI,IAAI,CAAC;IAEf,8CAA8C;IAC9C,OAAO,IAAI,IAAI,CAAC;IAEhB,sCAAsC;IACtC,OAAO,IAAI,IAAI,CAAC;IAEhB,6BAA6B;IAC7B,IAAI,QAAQ,IAAI,MAAM,CAAC;IAEvB,uCAAuC;IACvC,OAAO,IAAI,eAAe,GAAG,IAAI,CAAC;IAElC,6DAA6D;IAC7D,SAAS,CAAC,OAAO,EAAE,MAAM,GAAG,eAAe,GAAG,IAAI,CAAC;IAEnD,uEAAuE;IACvE,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,CAAC,CAAC;IAE7D,+CAA+C;IAC/C,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,aAAa,GAAG,IAAI,CAAC;CAC7C"}
@@ -0,0 +1,5 @@
1
+ // deck.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright (c) vis.gl contributors
4
+ export {};
5
+ //# sourceMappingURL=aggregator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"aggregator.js","sourceRoot":"","sources":["../../../src/common/aggregator/aggregator.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,oCAAoC"}
@@ -0,0 +1,27 @@
1
+ import type { Bin } from "./cpu-aggregator.js";
2
+ import type { AggregationOperation } from "../aggregator.js";
3
+ /** A reducer function that takes a list of data points and outputs one measurement */
4
+ export type AggregationFunc = (
5
+ /** Indices of the points */
6
+ pointIndices: number[],
7
+ /** Accessor to the value for each point */
8
+ getValue: (index: number) => number) => number;
9
+ export declare const BUILT_IN_OPERATIONS: Record<AggregationOperation, AggregationFunc>;
10
+ /**
11
+ * Performs the aggregation step. See interface Aggregator comments.
12
+ * @returns Floa32Array of aggregated values, one for each bin, and the [min,max] of the values
13
+ */
14
+ export declare function aggregate({ bins, getValue, operation, target }: {
15
+ /** Data points sorted by bins */
16
+ bins: Bin[];
17
+ /** Given the index of a data point, returns its value */
18
+ getValue: (index: number) => number;
19
+ /** Method used to reduce a list of values to one number */
20
+ operation: AggregationFunc;
21
+ /** Array to write the output into */
22
+ target?: Float32Array | null;
23
+ }): {
24
+ value: Float32Array;
25
+ domain: [min: number, max: number];
26
+ };
27
+ //# sourceMappingURL=aggregate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"aggregate.d.ts","sourceRoot":"","sources":["../../../../src/common/aggregator/cpu-aggregator/aggregate.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,GAAG,EAAC,4BAAyB;AAC1C,OAAO,KAAK,EAAC,oBAAoB,EAAC,yBAAsB;AAExD,sFAAsF;AACtF,MAAM,MAAM,eAAe,GAAG;AAC5B,4BAA4B;AAC5B,YAAY,EAAE,MAAM,EAAE;AACtB,2CAA2C;AAC3C,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,KAChC,MAAM,CAAC;AA2CZ,eAAO,MAAM,mBAAmB,EAAE,MAAM,CAAC,oBAAoB,EAAE,eAAe,CAMpE,CAAC;AAEX;;;GAGG;AACH,wBAAgB,SAAS,CAAC,EACxB,IAAI,EACJ,QAAQ,EACR,SAAS,EACT,MAAM,EACP,EAAE;IACD,iCAAiC;IACjC,IAAI,EAAE,GAAG,EAAE,CAAC;IACZ,yDAAyD;IACzD,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;IACpC,2DAA2D;IAC3D,SAAS,EAAE,eAAe,CAAC;IAC3B,qCAAqC;IACrC,MAAM,CAAC,EAAE,YAAY,GAAG,IAAI,CAAC;CAC9B,GAAG;IACF,KAAK,EAAE,YAAY,CAAC;IACpB,MAAM,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,CAAC,CAAC;CACpC,CAeA"}
@@ -0,0 +1,67 @@
1
+ // deck.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright (c) vis.gl contributors
4
+ const count = pointIndices => {
5
+ return pointIndices.length;
6
+ };
7
+ const sum = (pointIndices, getValue) => {
8
+ let result = 0;
9
+ for (const i of pointIndices) {
10
+ result += getValue(i);
11
+ }
12
+ return result;
13
+ };
14
+ const mean = (pointIndices, getValue) => {
15
+ if (pointIndices.length === 0) {
16
+ return NaN;
17
+ }
18
+ return sum(pointIndices, getValue) / pointIndices.length;
19
+ };
20
+ const min = (pointIndices, getValue) => {
21
+ let result = Infinity;
22
+ for (const i of pointIndices) {
23
+ const value = getValue(i);
24
+ if (value < result) {
25
+ result = value;
26
+ }
27
+ }
28
+ return result;
29
+ };
30
+ const max = (pointIndices, getValue) => {
31
+ let result = -Infinity;
32
+ for (const i of pointIndices) {
33
+ const value = getValue(i);
34
+ if (value > result) {
35
+ result = value;
36
+ }
37
+ }
38
+ return result;
39
+ };
40
+ export const BUILT_IN_OPERATIONS = {
41
+ COUNT: count,
42
+ SUM: sum,
43
+ MEAN: mean,
44
+ MIN: min,
45
+ MAX: max
46
+ };
47
+ /**
48
+ * Performs the aggregation step. See interface Aggregator comments.
49
+ * @returns Floa32Array of aggregated values, one for each bin, and the [min,max] of the values
50
+ */
51
+ export function aggregate({ bins, getValue, operation, target }) {
52
+ if (!target || target.length < bins.length) {
53
+ target = new Float32Array(bins.length);
54
+ }
55
+ let min = Infinity;
56
+ let max = -Infinity;
57
+ for (let j = 0; j < bins.length; j++) {
58
+ const { points } = bins[j];
59
+ target[j] = operation(points, getValue);
60
+ if (target[j] < min)
61
+ min = target[j];
62
+ if (target[j] > max)
63
+ max = target[j];
64
+ }
65
+ return { value: target, domain: [min, max] };
66
+ }
67
+ //# sourceMappingURL=aggregate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,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AAC7C,CAAC"}
@@ -0,0 +1,70 @@
1
+ import type { Aggregator, AggregationProps, AggregatedBin } from "../aggregator.js";
2
+ import { BinaryAttribute } from '@deck.gl/core';
3
+ import { AggregationFunc } from "./aggregate.js";
4
+ import { VertexAccessor } from "./vertex-accessor.js";
5
+ /** Options used to construct a new CPUAggregator */
6
+ export type CPUAggregatorProps = {
7
+ /** Size of bin IDs */
8
+ dimensions: number;
9
+ /** Accessor to map each data point to a bin ID.
10
+ * Bin ID should be an array with [dimensions] elements; or null if the data point should be skipped
11
+ */
12
+ getBin: VertexAccessor<number[] | null, any>;
13
+ /** Accessor to map each data point to a weight value, defined per channel */
14
+ getValue: VertexAccessor<number>[];
15
+ } & Partial<CPUAggregationProps>;
16
+ /** Props used to run CPU aggregation, can be changed at any time */
17
+ type CPUAggregationProps = AggregationProps & {
18
+ /** Custom callback to aggregate points, overrides the built-in operations */
19
+ customOperations: (AggregationFunc | null | undefined)[];
20
+ };
21
+ export type Bin = {
22
+ id: number[];
23
+ index: number;
24
+ /** list of data point indices */
25
+ points: number[];
26
+ };
27
+ /** An Aggregator implementation that calculates aggregation on the CPU */
28
+ export declare class CPUAggregator implements Aggregator {
29
+ readonly dimensions: number;
30
+ readonly channelCount: number;
31
+ props: CPUAggregatorProps & CPUAggregationProps;
32
+ /** Dirty flag
33
+ * If true, redo sorting
34
+ * If array, redo aggregation on the specified channel
35
+ */
36
+ protected needsUpdate: boolean[] | boolean;
37
+ protected bins: Bin[];
38
+ protected binIds: (BinaryAttribute & {
39
+ value: Float32Array;
40
+ }) | null;
41
+ protected results: (BinaryAttribute & {
42
+ value: Float32Array;
43
+ domain: [min: number, max: number];
44
+ })[];
45
+ constructor(props: CPUAggregatorProps);
46
+ destroy(): void;
47
+ get binCount(): number;
48
+ /** Update aggregation props */
49
+ setProps(props: Partial<CPUAggregationProps>): void;
50
+ /** Flags a channel to need update
51
+ * This is called internally by setProps() if certain props change
52
+ * Users of this class still need to manually set the dirty flag sometimes, because even if no props changed
53
+ * the underlying buffers could have been updated and require rerunning the aggregation
54
+ * @param {number} channel - mark the given channel as dirty. If not provided, all channels will be updated.
55
+ */
56
+ setNeedsUpdate(channel?: number): void;
57
+ /** Run aggregation */
58
+ update(): void;
59
+ preDraw(): void;
60
+ /** Returns an accessor to the bins. */
61
+ getBins(): BinaryAttribute | null;
62
+ /** Returns an accessor to the output for a given channel. */
63
+ getResult(channel: number): BinaryAttribute | null;
64
+ /** Returns the [min, max] of aggregated values for a given channel. */
65
+ getResultDomain(channel: number): [min: number, max: number];
66
+ /** Returns the information for a given bin. */
67
+ getBin(index: number): AggregatedBin | null;
68
+ }
69
+ export {};
70
+ //# sourceMappingURL=cpu-aggregator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cpu-aggregator.d.ts","sourceRoot":"","sources":["../../../../src/common/aggregator/cpu-aggregator/cpu-aggregator.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,UAAU,EAAE,gBAAgB,EAAE,aAAa,EAAC,yBAAsB;AAC/E,OAAO,EAA0B,eAAe,EAAC,MAAM,eAAe,CAAC;AAEvE,OAAO,EAAY,eAAe,EAAsB,uBAAoB;AAC5E,OAAO,EAAC,cAAc,EAAyB,6BAA0B;AAEzE,oDAAoD;AACpD,MAAM,MAAM,kBAAkB,GAAG;IAC/B,sBAAsB;IACtB,UAAU,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,MAAM,EAAE,cAAc,CAAC,MAAM,EAAE,GAAG,IAAI,EAAE,GAAG,CAAC,CAAC;IAC7C,6EAA6E;IAC7E,QAAQ,EAAE,cAAc,CAAC,MAAM,CAAC,EAAE,CAAC;CACpC,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC;AAEjC,oEAAoE;AACpE,KAAK,mBAAmB,GAAG,gBAAgB,GAAG;IAC5C,6EAA6E;IAC7E,gBAAgB,EAAE,CAAC,eAAe,GAAG,IAAI,GAAG,SAAS,CAAC,EAAE,CAAC;CAC1D,CAAC;AAEF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M,CAAC;IAI5D,+CAA+C;IAC/C,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,aAAa,GAAG,IAAI;CAiB5C"}
@@ -0,0 +1,140 @@
1
+ // deck.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright (c) vis.gl contributors
4
+ import { _deepEqual as deepEqual } from '@deck.gl/core';
5
+ import { sortBins, packBinIds } from "./sort-bins.js";
6
+ import { aggregate, BUILT_IN_OPERATIONS } from "./aggregate.js";
7
+ import { evaluateVertexAccessor } from "./vertex-accessor.js";
8
+ /** An Aggregator implementation that calculates aggregation on the CPU */
9
+ export class CPUAggregator {
10
+ constructor(props) {
11
+ this.bins = [];
12
+ this.binIds = null;
13
+ this.results = [];
14
+ this.dimensions = props.dimensions;
15
+ this.channelCount = props.getValue.length;
16
+ this.props = {
17
+ ...props,
18
+ binOptions: {},
19
+ pointCount: 0,
20
+ operations: [],
21
+ customOperations: [],
22
+ attributes: {}
23
+ };
24
+ this.needsUpdate = true;
25
+ this.setProps(props);
26
+ }
27
+ destroy() { }
28
+ get binCount() {
29
+ return this.bins.length;
30
+ }
31
+ /** Update aggregation props */
32
+ setProps(props) {
33
+ const oldProps = this.props;
34
+ if (props.binOptions) {
35
+ if (!deepEqual(props.binOptions, oldProps.binOptions, 2)) {
36
+ this.setNeedsUpdate();
37
+ }
38
+ }
39
+ if (props.operations) {
40
+ for (let channel = 0; channel < this.channelCount; channel++) {
41
+ if (props.operations[channel] !== oldProps.operations[channel]) {
42
+ this.setNeedsUpdate(channel);
43
+ }
44
+ }
45
+ }
46
+ if (props.customOperations) {
47
+ for (let channel = 0; channel < this.channelCount; channel++) {
48
+ if (Boolean(props.customOperations[channel]) !== Boolean(oldProps.customOperations[channel])) {
49
+ this.setNeedsUpdate(channel);
50
+ }
51
+ }
52
+ }
53
+ if (props.pointCount !== undefined && props.pointCount !== oldProps.pointCount) {
54
+ this.setNeedsUpdate();
55
+ }
56
+ if (props.attributes) {
57
+ props.attributes = { ...oldProps.attributes, ...props.attributes };
58
+ }
59
+ Object.assign(this.props, props);
60
+ }
61
+ /** Flags a channel to need update
62
+ * This is called internally by setProps() if certain props change
63
+ * Users of this class still need to manually set the dirty flag sometimes, because even if no props changed
64
+ * the underlying buffers could have been updated and require rerunning the aggregation
65
+ * @param {number} channel - mark the given channel as dirty. If not provided, all channels will be updated.
66
+ */
67
+ setNeedsUpdate(channel) {
68
+ if (channel === undefined) {
69
+ this.needsUpdate = true;
70
+ }
71
+ else if (this.needsUpdate !== true) {
72
+ this.needsUpdate = this.needsUpdate || [];
73
+ this.needsUpdate[channel] = true;
74
+ }
75
+ }
76
+ /** Run aggregation */
77
+ update() {
78
+ if (this.needsUpdate === true) {
79
+ this.bins = sortBins({
80
+ pointCount: this.props.pointCount,
81
+ getBinId: evaluateVertexAccessor(this.props.getBin, this.props.attributes, this.props.binOptions)
82
+ });
83
+ const value = packBinIds({
84
+ bins: this.bins,
85
+ dimensions: this.dimensions,
86
+ // Reuse allocated typed array
87
+ target: this.binIds?.value
88
+ });
89
+ this.binIds = { value, type: 'float32', size: this.dimensions };
90
+ }
91
+ for (let channel = 0; channel < this.channelCount; channel++) {
92
+ if (this.needsUpdate === true || this.needsUpdate[channel]) {
93
+ const operation = this.props.customOperations[channel] ||
94
+ BUILT_IN_OPERATIONS[this.props.operations[channel]];
95
+ const { value, domain } = aggregate({
96
+ bins: this.bins,
97
+ getValue: evaluateVertexAccessor(this.props.getValue[channel], this.props.attributes, undefined),
98
+ operation,
99
+ // Reuse allocated typed array
100
+ target: this.results[channel]?.value
101
+ });
102
+ this.results[channel] = { value, domain, type: 'float32', size: 1 };
103
+ this.props.onUpdate?.({ channel });
104
+ }
105
+ }
106
+ this.needsUpdate = false;
107
+ }
108
+ preDraw() { }
109
+ /** Returns an accessor to the bins. */
110
+ getBins() {
111
+ return this.binIds;
112
+ }
113
+ /** Returns an accessor to the output for a given channel. */
114
+ getResult(channel) {
115
+ return this.results[channel];
116
+ }
117
+ /** Returns the [min, max] of aggregated values for a given channel. */
118
+ getResultDomain(channel) {
119
+ return this.results[channel]?.domain ?? [Infinity, -Infinity];
120
+ }
121
+ /** Returns the information for a given bin. */
122
+ getBin(index) {
123
+ const bin = this.bins[index];
124
+ if (!bin) {
125
+ return null;
126
+ }
127
+ const value = new Array(this.channelCount);
128
+ for (let i = 0; i < value.length; i++) {
129
+ const result = this.results[i];
130
+ value[i] = result?.value[index];
131
+ }
132
+ return {
133
+ id: bin.id,
134
+ value,
135
+ count: bin.points.length,
136
+ pointIndices: bin.points
137
+ };
138
+ }
139
+ }
140
+ //# sourceMappingURL=cpu-aggregator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cpu-aggregator.js","sourceRoot":"","sources":["../../../../src/common/aggregator/cpu-aggregator/cpu-aggregator.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,oCAAoC;AAGpC,OAAO,EAAC,UAAU,IAAI,SAAS,EAAkB,MAAM,eAAe,CAAC;AACvE,OAAO,EAAC,QAAQ,EAAE,UAAU,EAAC,uBAAoB;AACjD,OAAO,EAAC,SAAS,EAAmB,mBAAmB,EAAC,uBAAoB;AAC5E,OAAO,EAAiB,sBAAsB,EAAC,6BAA0B;AA2BzE,0EAA0E;AAC1E,MAAM,OAAO,aAAa;IAmBxB,YAAY,KAAyB;QAP3B,SAAI,GAAU,EAAE,CAAC;QACjB,WAAM,GAAqD,IAAI,CAAC;QAChE,YAAO,GAGV,EAAE,CAAC;QAGR,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC,UAAU,CAAC;QACnC,IAAI,CAAC,YAAY,GAAG,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC;QAC1C,IAAI,CAAC,KAAK,GAAG;YACX,GAAG,KAAK;YACR,UAAU,EAAE,EAAE;YACd,UAAU,EAAE,CAAC;YACb,UAAU,EAAE,EAAE;YACd,gBAAgB,EAAE,EAAE;YACpB,UAAU,EAAE,EAAE;SACf,CAAC;QACF,IAAI,CAAC,WAAW,GA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SAAS,CAAC,OAAe;QACvB,OAAO,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IAC/B,CAAC;IAED,uEAAuE;IACvE,eAAe,CAAC,OAAe;QAC7B,OAAO,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,CAAC;IAChE,CAAC;IAED,+CAA+C;IAC/C,MAAM,CAAC,KAAa;QAClB,MAAM,GAAG,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAC7B,IAAI,CAAC,GAAG,EAAE,CAAC;YACT,OAAO,IAAI,CAAC;QACd,CAAC;QACD,MAAM,KAAK,GAAG,IAAI,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;QAC3C,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YACtC,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;YAC/B,KAAK,CAAC,CAAC,CAAC,GAAG,MAAM,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC;QAClC,CAAC;QACD,OAAO;YACL,EAAE,EAAE,GAAG,CAAC,EAAE;YACV,KAAK;YACL,KAAK,EAAE,GAAG,CAAC,MAAM,CAAC,MAAM;YACxB,YAAY,EAAE,GAAG,CAAC,MAAM;SACzB,CAAC;IACJ,CAAC;CACF"}
@@ -0,0 +1,15 @@
1
+ import type { Bin } from "./cpu-aggregator.js";
2
+ /** Group data points into bins */
3
+ export declare function sortBins({ pointCount, getBinId }: {
4
+ pointCount: number;
5
+ getBinId: (index: number) => number[] | null;
6
+ }): Bin[];
7
+ /** Pack bin ids into a typed array */
8
+ export declare function packBinIds({ bins, dimensions, target }: {
9
+ bins: Bin[];
10
+ /** Size of bin IDs */
11
+ dimensions: number;
12
+ /** Array to write output into */
13
+ target?: Float32Array | null;
14
+ }): Float32Array;
15
+ //# sourceMappingURL=sort-bins.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sort-bins.d.ts","sourceRoot":"","sources":["../../../../src/common/aggregator/cpu-aggregator/sort-bins.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,GAAG,EAAC,4BAAyB;AAE1C,kCAAkC;AAClC,wBAAgB,QAAQ,CAAC,EACvB,UAAU,EACV,QAAQ,EACT,EAAE;IACD,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,EAAE,GAAG,IAAI,CAAC;CAC9C,GAAG,GAAG,EAAE,CAqBR;AAED,sCAAsC;AACtC,wBAAgB,UAAU,CAAC,EACzB,IAAI,EACJ,UAAU,EACV,MAAM,EACP,EAAE;IACD,IAAI,EAAE,GAAG,EAAE,CAAC;IACZ,sBAAsB;IACtB,UAAU,EAAE,MAAM,CAAC;IACnB,iCAAiC;IACjC,MAAM,CAAC,EAAE,YAAY,GAAG,IAAI,CAAC;CAC9B,GAAG,YAAY,CAef"}
@@ -0,0 +1,44 @@
1
+ // deck.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright (c) vis.gl contributors
4
+ /** Group data points into bins */
5
+ export function sortBins({ pointCount, getBinId }) {
6
+ const binsById = new Map();
7
+ for (let i = 0; i < pointCount; i++) {
8
+ const id = getBinId(i);
9
+ if (id === null) {
10
+ continue;
11
+ }
12
+ let bin = binsById.get(String(id));
13
+ if (bin) {
14
+ bin.points.push(i);
15
+ }
16
+ else {
17
+ bin = {
18
+ id,
19
+ index: binsById.size,
20
+ points: [i]
21
+ };
22
+ binsById.set(String(id), bin);
23
+ }
24
+ }
25
+ return Array.from(binsById.values());
26
+ }
27
+ /** Pack bin ids into a typed array */
28
+ export function packBinIds({ bins, dimensions, target }) {
29
+ const targetLength = bins.length * dimensions;
30
+ if (!target || target.length < targetLength) {
31
+ target = new Float32Array(targetLength);
32
+ }
33
+ for (let i = 0; i < bins.length; i++) {
34
+ const { id } = bins[i];
35
+ if (Array.isArray(id)) {
36
+ target.set(id, i * dimensions);
37
+ }
38
+ else {
39
+ target[i] = id;
40
+ }
41
+ }
42
+ return target;
43
+ }
44
+ //# sourceMappingURL=sort-bins.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sort-bins.js","sourceRoot":"","sources":["../../../../src/common/aggregator/cpu-aggregator/sort-bins.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,oCAAoC;AAIpC,kCAAkC;AAClC,MAAM,UAAU,QAAQ,CAAC,EACvB,UAAU,EACV,QAAQ,EAIT;IACC,MAAM,QAAQ,GAAqB,IAAI,GAAG,EAAE,CAAC;IAE7C,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,UAAU,EAAE,CAAC,EAAE,EAAE,CAAC;QACpC,MAAM,EAAE,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;QACvB,IAAI,EAAE,KAAK,IAAI,EAAE,CAAC;YAChB,SAAS;QACX,CAAC;QACD,IAAI,GAAG,GAAG,QAAQ,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC;QACnC,IAAI,GAAG,EAAE,CAAC;YACR,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACrB,CAAC;aAAM,CAAC;YACN,GAAG,GAAG;gBACJ,EAAE;gBACF,KAAK,EAAE,QAAQ,CAAC,IAAI;gBACpB,MAAM,EAAE,CAAC,CAAC,CAAC;aACZ,CAAC;YACF,QAAQ,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,EAAE,GAAG,CAAC,CAAC;QAChC,CAAC;IACH,CAAC;IACD,OAAO,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC;AACvC,CAAC;AAED,sCAAsC;AACtC,MAAM,UAAU,UAAU,CAAC,EACzB,IAAI,EACJ,UAAU,EACV,MAAM,EAOP;IACC,MAAM,YAAY,GAAG,IAAI,CAAC,MAAM,GAAG,UAAU,CAAC;IAC9C,IAAI,CAAC,MAAM,IAAI,MAAM,CAAC,MAAM,GAAG,YAAY,EAAE,CAAC;QAC5C,MAAM,GAAG,IAAI,YAAY,CAAC,YAAY,CAAC,CAAC;IAC1C,CAAC;IAED,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACrC,MAAM,EAAC,EAAE,EAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;QACrB,IAAI,KAAK,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE,CAAC;YACtB,MAAM,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC,GAAG,UAAU,CAAC,CAAC;QACjC,CAAC;aAAM,CAAC;YACN,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC;QACjB,CAAC;IACH,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC"}
@@ -0,0 +1,21 @@
1
+ import type { Attribute } from '@deck.gl/core';
2
+ /** This is designed to mirror a vertex shader function
3
+ * For each vertex, calculates a value from attribtes, vertex index and options (uniforms)
4
+ */
5
+ export type VertexAccessor<ValueT, OptionsT = undefined> = {
6
+ /** Attribute ids that provide input to getValue, used to index into the attributes map.
7
+ * For example `['position', 'size']`
8
+ */
9
+ sources?: string[];
10
+ /** Called for each data point to retrieve a value during update. */
11
+ getValue: (
12
+ /** Attributes at the vertex index */
13
+ data: any,
14
+ /** Vertex index */
15
+ index: number,
16
+ /** Shared options across all vertices */
17
+ options: OptionsT) => ValueT;
18
+ };
19
+ /** Evaluate a VertexAccessor with a set of attributes */
20
+ export declare function evaluateVertexAccessor<ValueT, OptionsT>(accessor: VertexAccessor<ValueT, OptionsT>, attributes: Record<string, Attribute>, options: OptionsT): (vertexIndex: number) => ValueT;
21
+ //# sourceMappingURL=vertex-accessor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vertex-accessor.d.ts","sourceRoot":"","sources":["../../../../src/common/aggregator/cpu-aggregator/vertex-accessor.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,eAAe,CAAC;AAG7C;;GAEG;AACH,MAAM,MAAM,cAAc,CAAC,MAAM,EAAE,QAAQ,GAAG,SAAS,IAAI;IACzD;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,oEAAoE;IACpE,QAAQ,EAAE;IACR,qCAAqC;IACrC,IAAI,EAAE,GAAG;IACT,mBAAmB;IACnB,KAAK,EAAE,MAAM;IACb,yCAAyC;IACzC,OAAO,EAAE,QAAQ,KACd,MAAM,CAAC;CACb,CAAC;AAEF,yDAAyD;AACzD,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,QAAQ,EACrD,QAAQ,EAAE,cAAc,CAAC,MAAM,EAAE,QAAQ,CAAC,EAC1C,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,EACrC,OAAO,EAAE,QAAQ,GAChB,CAAC,WAAW,EAAE,MAAM,KAAK,MAAM,CAkBjC"}