@deck.gl/aggregation-layers 9.0.35 → 9.1.0-beta.1

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 (318) 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 +69 -0
  4. package/dist/common/aggregator/aggregator.d.ts +76 -0
  5. package/dist/common/aggregator/aggregator.d.ts.map +1 -0
  6. package/dist/common/aggregator/aggregator.js +4 -0
  7. package/dist/common/aggregator/cpu-aggregator/aggregate.d.ts +27 -0
  8. package/dist/common/aggregator/cpu-aggregator/aggregate.d.ts.map +1 -0
  9. package/dist/common/aggregator/cpu-aggregator/aggregate.js +66 -0
  10. package/dist/common/aggregator/cpu-aggregator/cpu-aggregator.d.ts +70 -0
  11. package/dist/common/aggregator/cpu-aggregator/cpu-aggregator.d.ts.map +1 -0
  12. package/dist/common/aggregator/cpu-aggregator/cpu-aggregator.js +139 -0
  13. package/dist/common/aggregator/cpu-aggregator/sort-bins.d.ts +15 -0
  14. package/dist/common/aggregator/cpu-aggregator/sort-bins.d.ts.map +1 -0
  15. package/dist/common/aggregator/cpu-aggregator/sort-bins.js +43 -0
  16. package/dist/common/aggregator/cpu-aggregator/vertex-accessor.d.ts +21 -0
  17. package/dist/common/aggregator/cpu-aggregator/vertex-accessor.d.ts.map +1 -0
  18. package/dist/common/aggregator/cpu-aggregator/vertex-accessor.js +55 -0
  19. package/dist/common/aggregator/gpu-aggregator/aggregation-transform-uniforms.d.ts +18 -0
  20. package/dist/common/aggregator/gpu-aggregator/aggregation-transform-uniforms.d.ts.map +1 -0
  21. package/dist/common/aggregator/gpu-aggregator/aggregation-transform-uniforms.js +20 -0
  22. package/dist/common/aggregator/gpu-aggregator/bin-sorter-uniforms.d.ts +14 -0
  23. package/dist/common/aggregator/gpu-aggregator/bin-sorter-uniforms.d.ts.map +1 -0
  24. package/dist/common/aggregator/gpu-aggregator/bin-sorter-uniforms.js +17 -0
  25. package/dist/common/aggregator/gpu-aggregator/utils.d.ts +6 -0
  26. package/dist/common/aggregator/gpu-aggregator/utils.d.ts.map +1 -0
  27. package/dist/common/aggregator/gpu-aggregator/utils.js +24 -0
  28. package/dist/common/aggregator/gpu-aggregator/webgl-aggregation-transform.d.ts +24 -0
  29. package/dist/common/aggregator/gpu-aggregator/webgl-aggregation-transform.d.ts.map +1 -0
  30. package/dist/common/aggregator/gpu-aggregator/webgl-aggregation-transform.js +215 -0
  31. package/dist/common/aggregator/gpu-aggregator/webgl-aggregator.d.ts +81 -0
  32. package/dist/common/aggregator/gpu-aggregator/webgl-aggregator.d.ts.map +1 -0
  33. package/dist/common/aggregator/gpu-aggregator/webgl-aggregator.js +201 -0
  34. package/dist/common/aggregator/gpu-aggregator/webgl-bin-sorter.d.ts +38 -0
  35. package/dist/common/aggregator/gpu-aggregator/webgl-bin-sorter.d.ts.map +1 -0
  36. package/dist/common/aggregator/gpu-aggregator/webgl-bin-sorter.js +223 -0
  37. package/dist/common/aggregator/index.d.ts +6 -0
  38. package/dist/common/aggregator/index.d.ts.map +1 -0
  39. package/dist/common/aggregator/index.js +5 -0
  40. package/dist/common/types.d.ts +11 -0
  41. package/dist/common/types.d.ts.map +1 -0
  42. package/dist/common/types.js +4 -0
  43. package/dist/common/utils/bounds-utils.d.ts +10 -0
  44. package/dist/common/utils/bounds-utils.d.ts.map +1 -0
  45. package/dist/common/utils/bounds-utils.js +20 -0
  46. package/dist/common/utils/color-utils.d.ts +10 -0
  47. package/dist/common/utils/color-utils.d.ts.map +1 -0
  48. package/dist/common/utils/color-utils.js +65 -0
  49. package/dist/common/utils/prop-utils.d.ts.map +1 -0
  50. package/dist/common/utils/prop-utils.js +12 -0
  51. package/dist/common/utils/scale-utils.d.ts +46 -0
  52. package/dist/common/utils/scale-utils.d.ts.map +1 -0
  53. package/dist/common/utils/scale-utils.js +180 -0
  54. package/dist/contour-layer/bin-options-uniforms.d.ts +13 -0
  55. package/dist/contour-layer/bin-options-uniforms.d.ts.map +1 -0
  56. package/dist/contour-layer/bin-options-uniforms.js +17 -0
  57. package/dist/contour-layer/contour-layer.d.ts +42 -50
  58. package/dist/contour-layer/contour-layer.d.ts.map +1 -1
  59. package/dist/contour-layer/contour-layer.js +232 -192
  60. package/dist/contour-layer/contour-utils.d.ts +36 -15
  61. package/dist/contour-layer/contour-utils.d.ts.map +1 -1
  62. package/dist/contour-layer/contour-utils.js +24 -29
  63. package/dist/contour-layer/marching-squares-codes.d.ts.map +1 -1
  64. package/dist/contour-layer/marching-squares-codes.js +3 -0
  65. package/dist/contour-layer/marching-squares.d.ts +22 -6
  66. package/dist/contour-layer/marching-squares.d.ts.map +1 -1
  67. package/dist/contour-layer/marching-squares.js +71 -68
  68. package/dist/contour-layer/value-reader.d.ts +10 -0
  69. package/dist/contour-layer/value-reader.d.ts.map +1 -0
  70. package/dist/contour-layer/value-reader.js +46 -0
  71. package/dist/dist.dev.js +4842 -4081
  72. package/dist/grid-layer/bin-options-uniforms.d.ts +13 -0
  73. package/dist/grid-layer/bin-options-uniforms.d.ts.map +1 -0
  74. package/dist/grid-layer/bin-options-uniforms.js +17 -0
  75. package/dist/grid-layer/grid-cell-layer-vertex.glsl.d.ts +3 -0
  76. package/dist/grid-layer/grid-cell-layer-vertex.glsl.d.ts.map +1 -0
  77. package/dist/grid-layer/grid-cell-layer-vertex.glsl.js +51 -0
  78. package/dist/grid-layer/grid-cell-layer.d.ts +32 -0
  79. package/dist/grid-layer/grid-cell-layer.d.ts.map +1 -0
  80. package/dist/grid-layer/grid-cell-layer.js +93 -0
  81. package/dist/grid-layer/grid-layer-uniforms.d.ts +21 -0
  82. package/dist/grid-layer/grid-layer-uniforms.d.ts.map +1 -0
  83. package/dist/grid-layer/grid-layer-uniforms.js +23 -0
  84. package/dist/grid-layer/grid-layer.d.ts +175 -13
  85. package/dist/grid-layer/grid-layer.d.ts.map +1 -1
  86. package/dist/grid-layer/grid-layer.js +342 -46
  87. package/dist/{aggregation-layer.d.ts → heatmap-layer/aggregation-layer.d.ts} +1 -0
  88. package/dist/heatmap-layer/aggregation-layer.d.ts.map +1 -0
  89. package/dist/{aggregation-layer.js → heatmap-layer/aggregation-layer.js} +6 -21
  90. package/dist/heatmap-layer/heatmap-layer-uniforms.d.ts +30 -0
  91. package/dist/heatmap-layer/heatmap-layer-uniforms.d.ts.map +1 -0
  92. package/dist/heatmap-layer/heatmap-layer-uniforms.js +32 -0
  93. package/dist/heatmap-layer/heatmap-layer-utils.d.ts +1 -1
  94. package/dist/heatmap-layer/heatmap-layer-utils.d.ts.map +1 -1
  95. package/dist/heatmap-layer/heatmap-layer-utils.js +3 -0
  96. package/dist/heatmap-layer/heatmap-layer.d.ts +6 -4
  97. package/dist/heatmap-layer/heatmap-layer.d.ts.map +1 -1
  98. package/dist/heatmap-layer/heatmap-layer.js +43 -33
  99. package/dist/heatmap-layer/max-fs.glsl.d.ts.map +1 -1
  100. package/dist/heatmap-layer/max-fs.glsl.js +3 -0
  101. package/dist/heatmap-layer/max-vs.glsl.d.ts +1 -1
  102. package/dist/heatmap-layer/max-vs.glsl.d.ts.map +1 -1
  103. package/dist/heatmap-layer/max-vs.glsl.js +6 -4
  104. package/dist/heatmap-layer/triangle-layer-fragment.glsl.d.ts +1 -1
  105. package/dist/heatmap-layer/triangle-layer-fragment.glsl.d.ts.map +1 -1
  106. package/dist/heatmap-layer/triangle-layer-fragment.glsl.js +5 -23
  107. package/dist/heatmap-layer/triangle-layer-uniforms.d.ts +22 -0
  108. package/dist/heatmap-layer/triangle-layer-uniforms.d.ts.map +1 -0
  109. package/dist/heatmap-layer/triangle-layer-uniforms.js +22 -0
  110. package/dist/heatmap-layer/triangle-layer-vertex.glsl.d.ts +1 -1
  111. package/dist/heatmap-layer/triangle-layer-vertex.glsl.d.ts.map +1 -1
  112. package/dist/heatmap-layer/triangle-layer-vertex.glsl.js +10 -30
  113. package/dist/heatmap-layer/triangle-layer.d.ts +4 -10
  114. package/dist/heatmap-layer/triangle-layer.d.ts.map +1 -1
  115. package/dist/heatmap-layer/triangle-layer.js +17 -30
  116. package/dist/heatmap-layer/weights-fs.glsl.d.ts.map +1 -1
  117. package/dist/heatmap-layer/weights-fs.glsl.js +3 -0
  118. package/dist/heatmap-layer/weights-vs.glsl.d.ts +1 -1
  119. package/dist/heatmap-layer/weights-vs.glsl.d.ts.map +1 -1
  120. package/dist/heatmap-layer/weights-vs.glsl.js +6 -7
  121. package/dist/hexagon-layer/bin-options-uniforms.d.ts +14 -0
  122. package/dist/hexagon-layer/bin-options-uniforms.d.ts.map +1 -0
  123. package/dist/hexagon-layer/bin-options-uniforms.js +17 -0
  124. package/dist/hexagon-layer/hexagon-cell-layer-vertex.glsl.d.ts +3 -0
  125. package/dist/hexagon-layer/hexagon-cell-layer-vertex.glsl.d.ts.map +1 -0
  126. package/dist/hexagon-layer/hexagon-cell-layer-vertex.glsl.js +55 -0
  127. package/dist/hexagon-layer/hexagon-cell-layer.d.ts +29 -0
  128. package/dist/hexagon-layer/hexagon-cell-layer.d.ts.map +1 -0
  129. package/dist/hexagon-layer/hexagon-cell-layer.js +94 -0
  130. package/dist/hexagon-layer/hexagon-layer-uniforms.d.ts +19 -0
  131. package/dist/hexagon-layer/hexagon-layer-uniforms.d.ts.map +1 -0
  132. package/dist/hexagon-layer/hexagon-layer-uniforms.js +21 -0
  133. package/dist/hexagon-layer/hexagon-layer.d.ts +84 -54
  134. package/dist/hexagon-layer/hexagon-layer.d.ts.map +1 -1
  135. package/dist/hexagon-layer/hexagon-layer.js +307 -123
  136. package/dist/hexagon-layer/hexbin.d.ts +17 -0
  137. package/dist/hexagon-layer/hexbin.d.ts.map +1 -0
  138. package/dist/hexagon-layer/hexbin.js +69 -0
  139. package/dist/index.cjs +3025 -2946
  140. package/dist/index.cjs.map +4 -4
  141. package/dist/index.d.ts +7 -13
  142. package/dist/index.d.ts.map +1 -1
  143. package/dist/index.js +5 -27
  144. package/dist/screen-grid-layer/bin-options-uniforms.d.ts +11 -0
  145. package/dist/screen-grid-layer/bin-options-uniforms.d.ts.map +1 -0
  146. package/dist/screen-grid-layer/bin-options-uniforms.js +15 -0
  147. package/dist/screen-grid-layer/screen-grid-cell-layer.d.ts +11 -16
  148. package/dist/screen-grid-layer/screen-grid-cell-layer.d.ts.map +1 -1
  149. package/dist/screen-grid-layer/screen-grid-cell-layer.js +52 -134
  150. package/dist/screen-grid-layer/screen-grid-layer-fragment.glsl.d.ts +1 -1
  151. package/dist/screen-grid-layer/screen-grid-layer-fragment.glsl.d.ts.map +1 -1
  152. package/dist/screen-grid-layer/screen-grid-layer-fragment.glsl.js +4 -24
  153. package/dist/screen-grid-layer/screen-grid-layer-uniforms.d.ts +17 -0
  154. package/dist/screen-grid-layer/screen-grid-layer-uniforms.d.ts.map +1 -0
  155. package/dist/screen-grid-layer/screen-grid-layer-uniforms.js +19 -0
  156. package/dist/screen-grid-layer/screen-grid-layer-vertex.glsl.d.ts +1 -1
  157. package/dist/screen-grid-layer/screen-grid-layer-vertex.glsl.d.ts.map +1 -1
  158. package/dist/screen-grid-layer/screen-grid-layer-vertex.glsl.js +21 -62
  159. package/dist/screen-grid-layer/screen-grid-layer.d.ts +33 -40
  160. package/dist/screen-grid-layer/screen-grid-layer.d.ts.map +1 -1
  161. package/dist/screen-grid-layer/screen-grid-layer.js +157 -174
  162. package/dist.min.js +401 -382
  163. package/package.json +10 -9
  164. package/src/common/aggregation-layer.ts +107 -0
  165. package/src/common/aggregator/aggregator.ts +88 -0
  166. package/src/common/aggregator/cpu-aggregator/aggregate.ts +101 -0
  167. package/src/common/aggregator/cpu-aggregator/cpu-aggregator.ts +203 -0
  168. package/src/common/aggregator/cpu-aggregator/sort-bins.ts +63 -0
  169. package/src/common/aggregator/cpu-aggregator/vertex-accessor.ts +86 -0
  170. package/src/common/aggregator/gpu-aggregator/aggregation-transform-uniforms.ts +33 -0
  171. package/src/common/aggregator/gpu-aggregator/bin-sorter-uniforms.ts +27 -0
  172. package/src/common/aggregator/gpu-aggregator/utils.ts +27 -0
  173. package/src/common/aggregator/gpu-aggregator/webgl-aggregation-transform.ts +247 -0
  174. package/src/common/aggregator/gpu-aggregator/webgl-aggregator.ts +274 -0
  175. package/src/common/aggregator/gpu-aggregator/webgl-bin-sorter.ts +258 -0
  176. package/src/common/aggregator/index.ts +10 -0
  177. package/src/{types.ts → common/types.ts} +10 -4
  178. package/src/common/utils/bounds-utils.ts +34 -0
  179. package/src/common/utils/color-utils.ts +86 -0
  180. package/src/common/utils/prop-utils.ts +13 -0
  181. package/src/common/utils/scale-utils.ts +236 -0
  182. package/src/contour-layer/bin-options-uniforms.ts +26 -0
  183. package/src/contour-layer/contour-layer.ts +300 -265
  184. package/src/contour-layer/contour-utils.ts +68 -39
  185. package/src/contour-layer/marching-squares-codes.ts +4 -0
  186. package/src/contour-layer/marching-squares.ts +93 -82
  187. package/src/contour-layer/value-reader.ts +65 -0
  188. package/src/grid-layer/bin-options-uniforms.ts +26 -0
  189. package/src/grid-layer/grid-cell-layer-vertex.glsl.ts +68 -0
  190. package/src/grid-layer/grid-cell-layer.ts +141 -0
  191. package/src/grid-layer/grid-layer-uniforms.ts +37 -0
  192. package/src/grid-layer/grid-layer.ts +614 -73
  193. package/src/{aggregation-layer.ts → heatmap-layer/aggregation-layer.ts} +6 -21
  194. package/src/heatmap-layer/heatmap-layer-uniforms.ts +50 -0
  195. package/src/heatmap-layer/heatmap-layer-utils.ts +9 -1
  196. package/src/heatmap-layer/heatmap-layer.ts +59 -36
  197. package/src/heatmap-layer/max-fs.glsl.ts +4 -0
  198. package/src/heatmap-layer/max-vs.glsl.ts +7 -4
  199. package/src/heatmap-layer/triangle-layer-fragment.glsl.ts +5 -23
  200. package/src/heatmap-layer/triangle-layer-uniforms.ts +37 -0
  201. package/src/heatmap-layer/triangle-layer-vertex.glsl.ts +10 -30
  202. package/src/heatmap-layer/triangle-layer.ts +26 -31
  203. package/src/heatmap-layer/weights-fs.glsl.ts +4 -0
  204. package/src/heatmap-layer/weights-vs.glsl.ts +7 -7
  205. package/src/hexagon-layer/bin-options-uniforms.ts +27 -0
  206. package/src/hexagon-layer/hexagon-cell-layer-vertex.glsl.ts +73 -0
  207. package/src/hexagon-layer/hexagon-cell-layer.ts +141 -0
  208. package/src/hexagon-layer/hexagon-layer-uniforms.ts +34 -0
  209. package/src/hexagon-layer/hexagon-layer.ts +454 -186
  210. package/src/hexagon-layer/hexbin.ts +79 -0
  211. package/src/index.ts +21 -34
  212. package/src/screen-grid-layer/bin-options-uniforms.ts +23 -0
  213. package/src/screen-grid-layer/screen-grid-cell-layer.ts +71 -156
  214. package/src/screen-grid-layer/screen-grid-layer-fragment.glsl.ts +4 -24
  215. package/src/screen-grid-layer/screen-grid-layer-uniforms.ts +31 -0
  216. package/src/screen-grid-layer/screen-grid-layer-vertex.glsl.ts +21 -64
  217. package/src/screen-grid-layer/screen-grid-layer.ts +194 -222
  218. package/dist/aggregation-layer.d.ts.map +0 -1
  219. package/dist/cpu-grid-layer/cpu-grid-layer.d.ts +0 -158
  220. package/dist/cpu-grid-layer/cpu-grid-layer.d.ts.map +0 -1
  221. package/dist/cpu-grid-layer/cpu-grid-layer.js +0 -130
  222. package/dist/cpu-grid-layer/grid-aggregator.d.ts +0 -35
  223. package/dist/cpu-grid-layer/grid-aggregator.d.ts.map +0 -1
  224. package/dist/cpu-grid-layer/grid-aggregator.js +0 -141
  225. package/dist/gpu-grid-layer/gpu-grid-cell-layer-fragment.glsl.d.ts +0 -3
  226. package/dist/gpu-grid-layer/gpu-grid-cell-layer-fragment.glsl.d.ts.map +0 -1
  227. package/dist/gpu-grid-layer/gpu-grid-cell-layer-fragment.glsl.js +0 -30
  228. package/dist/gpu-grid-layer/gpu-grid-cell-layer-vertex.glsl.d.ts +0 -3
  229. package/dist/gpu-grid-layer/gpu-grid-cell-layer-vertex.glsl.d.ts.map +0 -1
  230. package/dist/gpu-grid-layer/gpu-grid-cell-layer-vertex.glsl.js +0 -112
  231. package/dist/gpu-grid-layer/gpu-grid-cell-layer.d.ts +0 -48
  232. package/dist/gpu-grid-layer/gpu-grid-cell-layer.d.ts.map +0 -1
  233. package/dist/gpu-grid-layer/gpu-grid-cell-layer.js +0 -146
  234. package/dist/gpu-grid-layer/gpu-grid-layer.d.ts +0 -99
  235. package/dist/gpu-grid-layer/gpu-grid-layer.d.ts.map +0 -1
  236. package/dist/gpu-grid-layer/gpu-grid-layer.js +0 -289
  237. package/dist/grid-aggregation-layer.d.ts +0 -67
  238. package/dist/grid-aggregation-layer.d.ts.map +0 -1
  239. package/dist/grid-aggregation-layer.js +0 -173
  240. package/dist/hexagon-layer/hexagon-aggregator.d.ts +0 -27
  241. package/dist/hexagon-layer/hexagon-aggregator.d.ts.map +0 -1
  242. package/dist/hexagon-layer/hexagon-aggregator.js +0 -112
  243. package/dist/types.d.ts +0 -12
  244. package/dist/types.d.ts.map +0 -1
  245. package/dist/types.js +0 -1
  246. package/dist/utils/aggregation-operation-utils.d.ts +0 -19
  247. package/dist/utils/aggregation-operation-utils.d.ts.map +0 -1
  248. package/dist/utils/aggregation-operation-utils.js +0 -94
  249. package/dist/utils/bin-sorter.d.ts +0 -52
  250. package/dist/utils/bin-sorter.d.ts.map +0 -1
  251. package/dist/utils/bin-sorter.js +0 -167
  252. package/dist/utils/color-utils.d.ts +0 -3
  253. package/dist/utils/color-utils.d.ts.map +0 -1
  254. package/dist/utils/color-utils.js +0 -53
  255. package/dist/utils/cpu-aggregator.d.ts +0 -169
  256. package/dist/utils/cpu-aggregator.d.ts.map +0 -1
  257. package/dist/utils/cpu-aggregator.js +0 -421
  258. package/dist/utils/gpu-grid-aggregation/aggregate-all-fs.glsl.d.ts +0 -3
  259. package/dist/utils/gpu-grid-aggregation/aggregate-all-fs.glsl.d.ts.map +0 -1
  260. package/dist/utils/gpu-grid-aggregation/aggregate-all-fs.glsl.js +0 -36
  261. package/dist/utils/gpu-grid-aggregation/aggregate-all-vs.glsl.d.ts +0 -3
  262. package/dist/utils/gpu-grid-aggregation/aggregate-all-vs.glsl.d.ts.map +0 -1
  263. package/dist/utils/gpu-grid-aggregation/aggregate-all-vs.glsl.js +0 -42
  264. package/dist/utils/gpu-grid-aggregation/aggregate-to-grid-fs.glsl.d.ts +0 -3
  265. package/dist/utils/gpu-grid-aggregation/aggregate-to-grid-fs.glsl.d.ts.map +0 -1
  266. package/dist/utils/gpu-grid-aggregation/aggregate-to-grid-fs.glsl.js +0 -30
  267. package/dist/utils/gpu-grid-aggregation/aggregate-to-grid-vs.glsl.d.ts +0 -3
  268. package/dist/utils/gpu-grid-aggregation/aggregate-to-grid-vs.glsl.d.ts.map +0 -1
  269. package/dist/utils/gpu-grid-aggregation/aggregate-to-grid-vs.glsl.js +0 -61
  270. package/dist/utils/gpu-grid-aggregation/gpu-grid-aggregator-constants.d.ts +0 -38
  271. package/dist/utils/gpu-grid-aggregation/gpu-grid-aggregator-constants.d.ts.map +0 -1
  272. package/dist/utils/gpu-grid-aggregation/gpu-grid-aggregator-constants.js +0 -41
  273. package/dist/utils/gpu-grid-aggregation/gpu-grid-aggregator-utils.d.ts +0 -1
  274. package/dist/utils/gpu-grid-aggregation/gpu-grid-aggregator-utils.d.ts.map +0 -1
  275. package/dist/utils/gpu-grid-aggregation/gpu-grid-aggregator-utils.js +0 -1
  276. package/dist/utils/gpu-grid-aggregation/gpu-grid-aggregator.d.ts +0 -76
  277. package/dist/utils/gpu-grid-aggregation/gpu-grid-aggregator.d.ts.map +0 -1
  278. package/dist/utils/gpu-grid-aggregation/gpu-grid-aggregator.js +0 -555
  279. package/dist/utils/gpu-grid-aggregation/transform-mean-vs.glsl.d.ts +0 -3
  280. package/dist/utils/gpu-grid-aggregation/transform-mean-vs.glsl.d.ts.map +0 -1
  281. package/dist/utils/gpu-grid-aggregation/transform-mean-vs.glsl.js +0 -32
  282. package/dist/utils/grid-aggregation-utils.d.ts +0 -30
  283. package/dist/utils/grid-aggregation-utils.d.ts.map +0 -1
  284. package/dist/utils/grid-aggregation-utils.js +0 -114
  285. package/dist/utils/prop-utils.d.ts.map +0 -1
  286. package/dist/utils/prop-utils.js +0 -28
  287. package/dist/utils/resource-utils.d.ts +0 -14
  288. package/dist/utils/resource-utils.d.ts.map +0 -1
  289. package/dist/utils/resource-utils.js +0 -38
  290. package/dist/utils/scale-utils.d.ts +0 -15
  291. package/dist/utils/scale-utils.d.ts.map +0 -1
  292. package/dist/utils/scale-utils.js +0 -184
  293. package/src/cpu-grid-layer/cpu-grid-layer.ts +0 -329
  294. package/src/cpu-grid-layer/grid-aggregator.ts +0 -184
  295. package/src/gpu-grid-layer/gpu-grid-cell-layer-fragment.glsl.ts +0 -35
  296. package/src/gpu-grid-layer/gpu-grid-cell-layer-vertex.glsl.ts +0 -143
  297. package/src/gpu-grid-layer/gpu-grid-cell-layer.ts +0 -201
  298. package/src/gpu-grid-layer/gpu-grid-layer.ts +0 -455
  299. package/src/grid-aggregation-layer.ts +0 -243
  300. package/src/hexagon-layer/hexagon-aggregator.ts +0 -127
  301. package/src/utils/aggregation-operation-utils.ts +0 -118
  302. package/src/utils/bin-sorter.ts +0 -218
  303. package/src/utils/color-utils.ts +0 -57
  304. package/src/utils/cpu-aggregator.ts +0 -503
  305. package/src/utils/gpu-grid-aggregation/aggregate-all-fs.glsl.ts +0 -40
  306. package/src/utils/gpu-grid-aggregation/aggregate-all-vs.glsl.ts +0 -54
  307. package/src/utils/gpu-grid-aggregation/aggregate-to-grid-fs.glsl.ts +0 -35
  308. package/src/utils/gpu-grid-aggregation/aggregate-to-grid-vs.glsl.ts +0 -79
  309. package/src/utils/gpu-grid-aggregation/gpu-grid-aggregator-constants.ts +0 -46
  310. package/src/utils/gpu-grid-aggregation/gpu-grid-aggregator-utils.ts +0 -0
  311. package/src/utils/gpu-grid-aggregation/gpu-grid-aggregator.md +0 -155
  312. package/src/utils/gpu-grid-aggregation/gpu-grid-aggregator.ts +0 -690
  313. package/src/utils/gpu-grid-aggregation/transform-mean-vs.glsl.ts +0 -38
  314. package/src/utils/grid-aggregation-utils.ts +0 -147
  315. package/src/utils/prop-utils.ts +0 -29
  316. package/src/utils/resource-utils.ts +0 -53
  317. package/src/utils/scale-utils.js +0 -219
  318. /package/dist/{utils → common/utils}/prop-utils.d.ts +0 -0
@@ -0,0 +1,55 @@
1
+ // deck.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright (c) vis.gl contributors
4
+ import { getHexbinCentroidGLSL } from "./hexbin.js";
5
+ export default /* glsl */ `\
6
+ #version 300 es
7
+ #define SHADER_NAME hexagon-cell-layer-vertex-shader
8
+ in vec3 positions;
9
+ in vec3 normals;
10
+ in vec2 instancePositions;
11
+ in float instanceElevationValues;
12
+ in float instanceColorValues;
13
+ in vec3 instancePickingColors;
14
+ uniform sampler2D colorRange;
15
+ out vec4 vColor;
16
+ ${getHexbinCentroidGLSL}
17
+ float interp(float value, vec2 domain, vec2 range) {
18
+ float r = min(max((value - domain.x) / (domain.y - domain.x), 0.), 1.);
19
+ return mix(range.x, range.y, r);
20
+ }
21
+ vec4 interp(float value, vec2 domain, sampler2D range) {
22
+ float r = (value - domain.x) / (domain.y - domain.x);
23
+ return texture(range, vec2(r, 0.5));
24
+ }
25
+ void main(void) {
26
+ geometry.pickingColor = instancePickingColors;
27
+ if (isnan(instanceColorValues) ||
28
+ instanceColorValues < hexagon.colorDomain.z ||
29
+ instanceColorValues > hexagon.colorDomain.w ||
30
+ instanceElevationValues < hexagon.elevationDomain.z ||
31
+ instanceElevationValues > hexagon.elevationDomain.w
32
+ ) {
33
+ gl_Position = vec4(0.);
34
+ return;
35
+ }
36
+ vec2 commonPosition = hexbinCentroid(instancePositions, column.radius) + (hexagon.originCommon - project.commonOrigin.xy);
37
+ commonPosition += positions.xy * column.radius * column.coverage;
38
+ geometry.position = vec4(commonPosition, 0.0, 1.0);
39
+ geometry.normal = project_normal(normals);
40
+ float elevation = 0.0;
41
+ if (column.extruded) {
42
+ elevation = interp(instanceElevationValues, hexagon.elevationDomain.xy, hexagon.elevationRange);
43
+ elevation = project_size(elevation);
44
+ geometry.position.z = (positions.z + 1.0) / 2.0 * elevation;
45
+ }
46
+ gl_Position = project_common_position_to_clipspace(geometry.position);
47
+ DECKGL_FILTER_GL_POSITION(gl_Position, geometry);
48
+ vColor = interp(instanceColorValues, hexagon.colorDomain.xy, colorRange);
49
+ vColor.a *= layer.opacity;
50
+ if (column.extruded) {
51
+ vColor.rgb = lighting_getLightColor(vColor.rgb, project.cameraPosition, geometry.position.xyz, geometry.normal);
52
+ }
53
+ DECKGL_FILTER_COLOR(vColor, geometry);
54
+ }
55
+ `;
@@ -0,0 +1,29 @@
1
+ import { Texture } from '@luma.gl/core';
2
+ import { UpdateParameters, Color } from '@deck.gl/core';
3
+ import { ColumnLayer } from '@deck.gl/layers';
4
+ import type { ScaleType } from "../common/types.js";
5
+ /** Proprties added by HexagonCellLayer. */
6
+ export type _HexagonCellLayerProps = {
7
+ hexOriginCommon: [number, number];
8
+ colorDomain: [number, number];
9
+ colorCutoff: [number, number] | null;
10
+ colorRange: Color[];
11
+ colorScaleType: ScaleType;
12
+ elevationDomain: [number, number];
13
+ elevationCutoff: [number, number] | null;
14
+ elevationRange: [number, number];
15
+ };
16
+ export default class HexagonCellLayer<ExtraPropsT extends {} = {}> extends ColumnLayer<null, ExtraPropsT & Required<_HexagonCellLayerProps>> {
17
+ static layerName: string;
18
+ state: ColumnLayer['state'] & {
19
+ colorTexture: Texture;
20
+ };
21
+ getShaders(): any;
22
+ initializeState(): void;
23
+ updateState(params: UpdateParameters<this>): void;
24
+ finalizeState(context: any): void;
25
+ draw({ uniforms }: {
26
+ uniforms: any;
27
+ }): void;
28
+ }
29
+ //# sourceMappingURL=hexagon-cell-layer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hexagon-cell-layer.d.ts","sourceRoot":"","sources":["../../src/hexagon-layer/hexagon-cell-layer.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,OAAO,EAAC,MAAM,eAAe,CAAC;AACtC,OAAO,EAAC,gBAAgB,EAAE,KAAK,EAAC,MAAM,eAAe,CAAC;AACtD,OAAO,EAAC,WAAW,EAAC,MAAM,iBAAiB,CAAC;AAI5C,OAAO,KAAK,EAAC,SAAS,EAAC,2BAAwB;AAE/C,2CAA2C;AAC3C,MAAM,MAAM,sBAAsB,GAAG;IACnC,eAAe,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAClC,WAAW,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC9B,WAAW,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,CAAC;IACrC,UAAU,EAAE,KAAK,EAAE,CAAC;IACpB,cAAc,EAAE,SAAS,CAAC;IAC1B,eAAe,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAClC,eAAe,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,CAAC;IACzC,cAAc,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAClC,CAAC;AAEF,MAAM,CAAC,OAAO,OAAO,gBAAgB,CAAC,WAAW,SAAS,EAAE,GAAG,EAAE,CAAE,SAAQ,WAAW,CACpF,IAAI,EACJ,WAAW,GAAG,QAAQ,CAAC,sBAAsB,CAAC,CAC/C;IACC,MAAM,CAAC,SAAS,SAAsB;IAEtC,KAAK,EAAG,WAAW,CAAC,OAAO,CAAC,GAAG;QAC7B,YAAY,EAAE,OAAO,CAAC;KACvB,CAAC;IAEF,UAAU;IAMV,eAAe;IA6Bf,WAAW,CAAC,MAAM,EAAE,gBAAgB,CAAC,IAAI,CAAC;IAoB1C,aAAa,CAAC,OAAO,KAAA;IAMrB,IAAI,CAAC,EAAC,QAAQ,EAAC;;KAAA;CA6ChB"}
@@ -0,0 +1,94 @@
1
+ // deck.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright (c) vis.gl contributors
4
+ import { ColumnLayer } from '@deck.gl/layers';
5
+ import { createColorRangeTexture, updateColorRangeTexture } from "../common/utils/color-utils.js";
6
+ import vs from "./hexagon-cell-layer-vertex.glsl.js";
7
+ import { hexagonUniforms } from "./hexagon-layer-uniforms.js";
8
+ class HexagonCellLayer extends ColumnLayer {
9
+ getShaders() {
10
+ const shaders = super.getShaders();
11
+ shaders.modules.push(hexagonUniforms);
12
+ return { ...shaders, vs };
13
+ }
14
+ initializeState() {
15
+ super.initializeState();
16
+ const attributeManager = this.getAttributeManager();
17
+ attributeManager.remove([
18
+ 'instanceElevations',
19
+ 'instanceFillColors',
20
+ 'instanceLineColors',
21
+ 'instanceStrokeWidths'
22
+ ]);
23
+ attributeManager.addInstanced({
24
+ instancePositions: {
25
+ size: 2,
26
+ type: 'float32',
27
+ accessor: 'getBin'
28
+ },
29
+ instanceColorValues: {
30
+ size: 1,
31
+ type: 'float32',
32
+ accessor: 'getColorValue'
33
+ },
34
+ instanceElevationValues: {
35
+ size: 1,
36
+ type: 'float32',
37
+ accessor: 'getElevationValue'
38
+ }
39
+ });
40
+ }
41
+ updateState(params) {
42
+ super.updateState(params);
43
+ const { props, oldProps } = params;
44
+ const model = this.state.fillModel;
45
+ if (oldProps.colorRange !== props.colorRange) {
46
+ this.state.colorTexture?.destroy();
47
+ this.state.colorTexture = createColorRangeTexture(this.context.device, props.colorRange, props.colorScaleType);
48
+ const hexagonProps = { colorRange: this.state.colorTexture };
49
+ model.shaderInputs.setProps({ hexagon: hexagonProps });
50
+ }
51
+ else if (oldProps.colorScaleType !== props.colorScaleType) {
52
+ updateColorRangeTexture(this.state.colorTexture, props.colorScaleType);
53
+ }
54
+ }
55
+ finalizeState(context) {
56
+ super.finalizeState(context);
57
+ this.state.colorTexture?.destroy();
58
+ }
59
+ draw({ uniforms }) {
60
+ const { radius, hexOriginCommon, elevationRange, elevationScale, extruded, coverage, colorDomain, elevationDomain } = this.props;
61
+ const colorCutoff = this.props.colorCutoff || [-Infinity, Infinity];
62
+ const elevationCutoff = this.props.elevationCutoff || [-Infinity, Infinity];
63
+ const fillModel = this.state.fillModel;
64
+ if (fillModel.vertexArray.indexBuffer) {
65
+ // indices are for drawing wireframe, disable them
66
+ // TODO - this should be handled in ColumnLayer?
67
+ fillModel.setIndexBuffer(null);
68
+ }
69
+ fillModel.setVertexCount(this.state.fillVertexCount);
70
+ const hexagonProps = {
71
+ colorDomain: [
72
+ Math.max(colorDomain[0], colorCutoff[0]), // instanceColorValue that maps to colorRange[0]
73
+ Math.min(colorDomain[1], colorCutoff[1]), // instanceColorValue that maps to colorRange[colorRange.length - 1]
74
+ Math.max(colorDomain[0] - 1, colorCutoff[0]), // hide cell if instanceColorValue is less than this
75
+ Math.min(colorDomain[1] + 1, colorCutoff[1]) // hide cell if instanceColorValue is greater than this
76
+ ],
77
+ elevationDomain: [
78
+ Math.max(elevationDomain[0], elevationCutoff[0]), // instanceElevationValue that maps to elevationRange[0]
79
+ Math.min(elevationDomain[1], elevationCutoff[1]), // instanceElevationValue that maps to elevationRange[elevationRange.length - 1]
80
+ Math.max(elevationDomain[0] - 1, elevationCutoff[0]), // hide cell if instanceElevationValue is less than this
81
+ Math.min(elevationDomain[1] + 1, elevationCutoff[1]) // hide cell if instanceElevationValue is greater than this
82
+ ],
83
+ elevationRange: [elevationRange[0] * elevationScale, elevationRange[1] * elevationScale],
84
+ originCommon: hexOriginCommon
85
+ };
86
+ fillModel.shaderInputs.setProps({
87
+ column: { extruded, coverage, radius },
88
+ hexagon: hexagonProps
89
+ });
90
+ fillModel.draw(this.context.renderPass);
91
+ }
92
+ }
93
+ HexagonCellLayer.layerName = 'HexagonCellLayer';
94
+ export default HexagonCellLayer;
@@ -0,0 +1,19 @@
1
+ import { Texture } from '@luma.gl/core';
2
+ export type HexagonProps = {
3
+ colorDomain: [number, number, number, number];
4
+ colorRange: Texture;
5
+ elevationDomain: [number, number, number, number];
6
+ elevationRange: [number, number];
7
+ originCommon: [number, number];
8
+ };
9
+ export declare const hexagonUniforms: {
10
+ readonly name: "hexagon";
11
+ readonly vs: "uniform hexagonUniforms {\n vec4 colorDomain;\n vec4 elevationDomain;\n vec2 elevationRange;\n vec2 originCommon;\n} hexagon;\n";
12
+ readonly uniformTypes: {
13
+ readonly colorDomain: "vec4<f32>";
14
+ readonly elevationDomain: "vec4<f32>";
15
+ readonly elevationRange: "vec2<f32>";
16
+ readonly originCommon: "vec2<f32>";
17
+ };
18
+ };
19
+ //# sourceMappingURL=hexagon-layer-uniforms.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hexagon-layer-uniforms.d.ts","sourceRoot":"","sources":["../../src/hexagon-layer/hexagon-layer-uniforms.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,OAAO,EAAC,MAAM,eAAe,CAAC;AAYtC,MAAM,MAAM,YAAY,GAAG;IACzB,WAAW,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IAC9C,UAAU,EAAE,OAAO,CAAC;IACpB,eAAe,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IAClD,cAAc,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,YAAY,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAChC,CAAC;AAEF,eAAO,MAAM,eAAe;;;;;;;;;CASmB,CAAC"}
@@ -0,0 +1,21 @@
1
+ // deck.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright (c) vis.gl contributors
4
+ const uniformBlock = /* glsl */ `\
5
+ uniform hexagonUniforms {
6
+ vec4 colorDomain;
7
+ vec4 elevationDomain;
8
+ vec2 elevationRange;
9
+ vec2 originCommon;
10
+ } hexagon;
11
+ `;
12
+ export const hexagonUniforms = {
13
+ name: 'hexagon',
14
+ vs: uniformBlock,
15
+ uniformTypes: {
16
+ colorDomain: 'vec4<f32>',
17
+ elevationDomain: 'vec4<f32>',
18
+ elevationRange: 'vec2<f32>',
19
+ originCommon: 'vec2<f32>'
20
+ }
21
+ };
@@ -1,39 +1,40 @@
1
- import { Accessor, AccessorFunction, Color, Position, Material, UpdateParameters, DefaultProps } from '@deck.gl/core';
2
- import { ColumnLayer } from '@deck.gl/layers';
3
- import CPUAggregator from "../utils/cpu-aggregator.js";
4
- import AggregationLayer, { AggregationLayerProps } from "../aggregation-layer.js";
5
- import { AggregateAccessor } from "../types.js";
6
- /** All properties supported by by HexagonLayer. */
7
- export type HexagonLayerProps<DataT = unknown> = _HexagonLayerProps<DataT> & AggregationLayerProps<DataT>;
1
+ import { Accessor, Color, GetPickingInfoParams, CompositeLayerProps, Layer, Material, LayersList, PickingInfo, Position, Viewport, UpdateParameters, DefaultProps } from '@deck.gl/core';
2
+ import { WebGLAggregator, CPUAggregator, AggregationOperation } from "../common/aggregator/index.js";
3
+ import AggregationLayer from "../common/aggregation-layer.js";
4
+ import { AggregateAccessor } from "../common/types.js";
5
+ import { AttributeWithScale } from "../common/utils/scale-utils.js";
6
+ import { BinOptions } from "./bin-options-uniforms.js";
7
+ /** All properties supported by HexagonLayer. */
8
+ export type HexagonLayerProps<DataT = unknown> = _HexagonLayerProps<DataT> & CompositeLayerProps;
8
9
  /** Properties added by HexagonLayer. */
9
- type _HexagonLayerProps<DataT = unknown> = {
10
+ type _HexagonLayerProps<DataT> = {
10
11
  /**
11
12
  * Radius of hexagon bin in meters. The hexagons are pointy-topped (rather than flat-topped).
12
13
  * @default 1000
13
14
  */
14
15
  radius?: number;
15
16
  /**
16
- * Function to aggregate data into hexagonal bins.
17
- * @default d3-hexbin
17
+ * Custom accessor to retrieve a hexagonal bin index from each data object.
18
+ * Not supported by GPU aggregation.
19
+ * @default null
18
20
  */
19
- hexagonAggregator?: (props: any, params: any) => any;
21
+ hexagonAggregator?: ((position: number[], radius: number) => [number, number]) | null;
20
22
  /**
21
- * Color scale input domain.
23
+ * Color scale domain, default is set to the extent of aggregated weights in each cell.
22
24
  * @default [min(colorWeight), max(colorWeight)]
23
25
  */
24
26
  colorDomain?: [number, number] | null;
25
27
  /**
26
- * Specified as an array of colors [color1, color2, ...].
27
- * @default `6-class YlOrRd` - [colorbrewer](http://colorbrewer2.org/#type=sequential&scheme=YlOrRd&n=6)
28
+ * Default: [colorbrewer](http://colorbrewer2.org/#type=sequential&scheme=YlOrRd&n=6) `6-class YlOrRd`
28
29
  */
29
30
  colorRange?: Color[];
30
31
  /**
31
- * Hexagon radius multiplier, clamped between 0 - 1.
32
+ * Cell size multiplier, clamped between 0 - 1.
32
33
  * @default 1
33
34
  */
34
35
  coverage?: number;
35
36
  /**
36
- * Elevation scale input domain. The elevation scale is a linear scale that maps number of counts to elevation.
37
+ * Elevation scale input domain, default is set to between 0 and the max of aggregated weights in each cell.
37
38
  * @default [0, max(elevationWeight)]
38
39
  */
39
40
  elevationDomain?: [number, number] | null;
@@ -43,47 +44,49 @@ type _HexagonLayerProps<DataT = unknown> = {
43
44
  */
44
45
  elevationRange?: [number, number];
45
46
  /**
46
- * Hexagon elevation multiplier.
47
+ * Cell elevation multiplier.
47
48
  * @default 1
48
49
  */
49
50
  elevationScale?: number;
50
51
  /**
51
52
  * Whether to enable cell elevation. If set to false, all cell will be flat.
52
- * @default false
53
+ * @default true
53
54
  */
54
55
  extruded?: boolean;
55
56
  /**
56
- * Filter bins and re-calculate color by `upperPercentile`.
57
- * Hexagons with color value larger than the `upperPercentile` will be hidden.
57
+ * Filter cells and re-calculate color by `upperPercentile`.
58
+ * Cells with value larger than the upperPercentile will be hidden.
58
59
  * @default 100
59
60
  */
60
61
  upperPercentile?: number;
61
62
  /**
62
- * Filter bins and re-calculate color by `lowerPercentile`.
63
- * Hexagons with color value smaller than the `lowerPercentile` will be hidden.
63
+ * Filter cells and re-calculate color by `lowerPercentile`.
64
+ * Cells with value smaller than the lowerPercentile will be hidden.
64
65
  * @default 0
65
66
  */
66
67
  lowerPercentile?: number;
67
68
  /**
68
- * Filter bins and re-calculate elevation by `elevationUpperPercentile`.
69
- * Hexagons with elevation value larger than the `elevationUpperPercentile` will be hidden.
69
+ * Filter cells and re-calculate elevation by `elevationUpperPercentile`.
70
+ * Cells with elevation value larger than the `elevationUpperPercentile` will be hidden.
70
71
  * @default 100
71
72
  */
72
73
  elevationUpperPercentile?: number;
73
74
  /**
74
- * Filter bins and re-calculate elevation by `elevationLowerPercentile`.
75
- * Hexagons with elevation value larger than the `elevationLowerPercentile` will be hidden.
75
+ * Filter cells and re-calculate elevation by `elevationLowerPercentile`.
76
+ * Cells with elevation value larger than the `elevationLowerPercentile` will be hidden.
76
77
  * @default 0
77
78
  */
78
79
  elevationLowerPercentile?: number;
79
80
  /**
80
81
  * Scaling function used to determine the color of the grid cell, default value is 'quantize'.
81
- * Supported Values are 'quantize', 'quantile' and 'ordinal'.
82
+ * Supported Values are 'quantize', 'linear', 'quantile' and 'ordinal'.
82
83
  * @default 'quantize'
83
84
  */
84
- colorScaleType?: 'quantize' | 'quantile' | 'ordinal';
85
+ colorScaleType?: 'quantize' | 'linear' | 'quantile' | 'ordinal';
85
86
  /**
86
87
  * Scaling function used to determine the elevation of the grid cell, only supports 'linear'.
88
+ * Supported Values are 'linear' and 'quantile'.
89
+ * @default 'linear'
87
90
  */
88
91
  elevationScaleType?: 'linear';
89
92
  /**
@@ -95,73 +98,100 @@ type _HexagonLayerProps<DataT = unknown> = {
95
98
  material?: Material;
96
99
  /**
97
100
  * Defines the operation used to aggregate all data object weights to calculate a cell's color value.
101
+ * Valid values are 'SUM', 'MEAN', 'MIN', 'MAX', 'COUNT'.
102
+ *
98
103
  * @default 'SUM'
99
104
  */
100
- colorAggregation?: 'SUM' | 'MEAN' | 'MIN' | 'MAX';
105
+ colorAggregation?: AggregationOperation;
101
106
  /**
102
107
  * Defines the operation used to aggregate all data object weights to calculate a cell's elevation value.
108
+ * Valid values are 'SUM', 'MEAN', 'MIN', 'MAX', 'COUNT'.
109
+ *
103
110
  * @default 'SUM'
104
111
  */
105
- elevationAggregation?: 'SUM' | 'MEAN' | 'MIN' | 'MAX';
112
+ elevationAggregation?: AggregationOperation;
106
113
  /**
107
114
  * Method called to retrieve the position of each object.
108
115
  * @default object => object.position
109
116
  */
110
- getPosition?: AccessorFunction<DataT, Position>;
117
+ getPosition?: Accessor<DataT, Position>;
111
118
  /**
112
- * The weight of a data object used to calculate the color value for a bin.
119
+ * The weight of a data object used to calculate the color value for a cell.
113
120
  * @default 1
114
121
  */
115
122
  getColorWeight?: Accessor<DataT, number>;
116
123
  /**
117
- * After data objects are aggregated into bins, this accessor is called on each cell to get the value that its color is based on.
124
+ * After data objects are aggregated into cells, this accessor is called on each cell to get the value that its color is based on.
125
+ * Not supported by GPU aggregation.
118
126
  * @default null
119
127
  */
120
128
  getColorValue?: AggregateAccessor<DataT> | null;
121
129
  /**
122
- * The weight of a data object used to calculate the elevation value for a bin.
130
+ * The weight of a data object used to calculate the elevation value for a cell.
123
131
  * @default 1
124
132
  */
125
133
  getElevationWeight?: Accessor<DataT, number>;
126
134
  /**
127
- * After data objects are aggregated into bins, this accessor is called on each cell to get the value that its elevation is based on.
135
+ * After data objects are aggregated into cells, this accessor is called on each cell to get the value that its elevation is based on.
136
+ * Not supported by GPU aggregation.
128
137
  * @default null
129
138
  */
130
139
  getElevationValue?: AggregateAccessor<DataT> | null;
131
140
  /**
132
- * This callback will be called when cell color domain has been calculated.
141
+ * This callback will be called when bin color domain has been calculated.
133
142
  * @default () => {}
134
143
  */
135
144
  onSetColorDomain?: (minMax: [number, number]) => void;
136
145
  /**
137
- * This callback will be called when cell elevation domain has been calculated.
146
+ * This callback will be called when bin elevation domain has been calculated.
138
147
  * @default () => {}
139
148
  */
140
149
  onSetElevationDomain?: (minMax: [number, number]) => void;
141
150
  /**
142
- * (Experimental) Filter data objects
151
+ * When set to true, aggregation is performed on GPU, provided other conditions are met.
152
+ * @default false
143
153
  */
144
- _filterData: null | ((d: DataT) => boolean);
154
+ gpuAggregation?: boolean;
145
155
  };
146
- /** Aggregates data into a hexagon-based heatmap. The color and height of a hexagon are determined based on the objects it contains. */
147
- export default class HexagonLayer<DataT, ExtraPropsT extends {} = {}> extends AggregationLayer<DataT, ExtraPropsT & Required<_HexagonLayerProps<DataT>>> {
156
+ export type HexagonLayerPickingInfo<DataT> = PickingInfo<{
157
+ /** Column index of the picked cell */
158
+ col: number;
159
+ /** Row index of the picked cell */
160
+ row: number;
161
+ /** Aggregated color value, as determined by `getColorWeight` and `colorAggregation` */
162
+ colorValue: number;
163
+ /** Aggregated elevation value, as determined by `getElevationWeight` and `elevationAggregation` */
164
+ elevationValue: number;
165
+ /** Number of data points in the picked cell */
166
+ count: number;
167
+ /** Centroid of the hexagon */
168
+ position: [number, number];
169
+ /** Indices of the data objects in the picked cell. Only available if using CPU aggregation. */
170
+ pointIndices?: number[];
171
+ /** The data objects in the picked cell. Only available if using CPU aggregation and layer data is an array. */
172
+ points?: DataT[];
173
+ }>;
174
+ /** Aggregate data into a grid-based heatmap. The color and height of a cell are determined based on the objects it contains. */
175
+ export default class HexagonLayer<DataT = any, ExtraPropsT extends {} = {}> extends AggregationLayer<DataT, ExtraPropsT & Required<_HexagonLayerProps<DataT>>> {
148
176
  static layerName: string;
149
177
  static defaultProps: DefaultProps<HexagonLayerProps<unknown>>;
150
- state: AggregationLayer<DataT>['state'] & {
151
- cpuAggregator: CPUAggregator;
152
- aggregatorState: CPUAggregator['state'];
153
- vertices: number[][] | null;
178
+ state: AggregationLayer<DataT>['state'] & BinOptions & {
179
+ dataAsArray?: DataT[];
180
+ colors?: AttributeWithScale;
181
+ elevations?: AttributeWithScale;
182
+ binIdRange: [number, number][];
183
+ aggregatorViewport: Viewport;
154
184
  };
185
+ getAggregatorType(): string;
186
+ createAggregator(type: string): WebGLAggregator | CPUAggregator;
155
187
  initializeState(): void;
156
- updateState(opts: UpdateParameters<this>): void;
157
- convertLatLngToMeterOffset(hexagonVertices: any): number[][] | null;
158
- getPickingInfo({ info }: {
159
- info: any;
160
- }): any;
161
- _onGetSublayerColor(cell: any): any;
162
- _onGetSublayerElevation(cell: any): any;
163
- _getSublayerUpdateTriggers(): {};
164
- renderLayers(): ColumnLayer<any, {}>;
188
+ updateState(params: UpdateParameters<this>): boolean;
189
+ private _updateBinOptions;
190
+ draw(opts: any): void;
191
+ private _onAggregationUpdate;
192
+ onAttributeChange(id: string): void;
193
+ renderLayers(): LayersList | Layer | null;
194
+ getPickingInfo(params: GetPickingInfoParams): HexagonLayerPickingInfo<DataT>;
165
195
  }
166
196
  export {};
167
197
  //# sourceMappingURL=hexagon-layer.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"hexagon-layer.d.ts","sourceRoot":"","sources":["../../src/hexagon-layer/hexagon-layer.ts"],"names":[],"mappings":"AAoBA,OAAO,EACL,QAAQ,EACR,gBAAgB,EAChB,KAAK,EAEL,QAAQ,EACR,QAAQ,EACR,gBAAgB,EAChB,YAAY,EACb,MAAM,eAAe,CAAC;AACvB,OAAO,EAAC,WAAW,EAAC,MAAM,iBAAiB,CAAC;AAK5C,OAAO,aAAa,mCAAgC;AACpD,OAAO,gBAAgB,EAAE,EAAC,qBAAqB,EAAC,gCAA6B;AAE7E,OAAO,EAAC,iBAAiB,EAAC,oBAAiB;AAyC3C,mDAAmD;AACnD,MAAM,MAAM,iBAAiB,CAAC,KAAK,GAAG,OAAO,IAAI,kBAAkB,CAAC,KAAK,CAAC,GACxE,qBAAqB,CAAC,KAAK,CAAC,CAAC;AAE/B,wCAAwC;AACxC,KAAK,kBAAkB,CAAC,KAAK,GAAG,OAAO,IAAI;IACzC;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;;OAGG;IACH,iBAAiB,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,KAAK,GAAG,CAAC;IAErD;;;OAGG;IACH,WAAW,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,CAAC;IAEtC;;;OAGG;IACH,UAAU,CAAC,EAAE,KAAK,EAAE,CAAC;IAErB;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;;OAGG;IACH,eAAe,CAAC,EAAE,CAA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