@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 @@
1
+ {"version":3,"file":"triangle-layer.js","sourceRoot":"","sources":["../../src/heatmap-layer/triangle-layer.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,oCAAoC;AAGpC,OAAO,EAAC,KAAK,EAAC,MAAM,iBAAiB,CAAC;AACtC,OAAO,EAAC,KAAK,EAAgB,SAAS,EAAC,MAAM,eAAe,CAAC;AAC7D,OAAO,EAAE,wCAAqC;AAC9C,OAAO,EAAE,0CAAuC;AAChD,OAAO,EAAgB,gBAAgB,EAAC,qCAAkC;AAc1E,MAAqB,aAAc,SAAQ,KAA0B;IASnE,UAAU;QACR,OAAO,KAAK,CAAC,UAAU,CAAC,EAAC,EAAE,EAAE,EAAE,EAAE,OAAO,EAAE,CAAC,SAAS,EAAE,gBAAgB,CAAC,EAAC,CAAC,CAAC;IAC5E,CAAC;IAED,eAAe,CAAC,EAAC,MAAM,EAAe;QACpC,IAAI,CAAC,QAAQ,CAAC,EAAC,KAAK,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,EAAC,CAAC,CAAC;IACjD,CAAC;IAED,SAAS,CAAC,MAAc;QACtB,MAAM,EAAC,WAAW,EAAE,IAAI,EAAC,GAAG,IAAI,CAAC,KAAK,CAAC;QAEvC,OAAO,IAAI,KAAK,CAAC,MAAM,EAAE;YACvB,GAAG,IAAI,CAAC,UAAU,EAAE;YACpB,EAAE,EAAE,IAAI,CAAC,KAAK,CAAC,EAAE;YACjB,UAAU,EAAE,IAAI,CAAC,UAAU;YAC3B,YAAY,EAAE;gBACZ,EAAC,IAAI,EAAE,WAAW,EAAE,MAAM,EAAE,WAAW,EAAC;gBACxC,EAAC,IAAI,EAAE,WAAW,EAAE,MAAM,EAAE,WAAW,EAAC;aACzC;YACD,QAAQ,EAAE,gBAAgB;YAC1B,WAAW;SACZ,CAAC,CAAC;IACL,CAAC;IAED,IAAI;QACF,MAAM,EAAC,KAAK,EAAC,GAAG,IAAI,CAAC,KAAK,CAAC;QAC3B,MAAM,EACJ,eAAe,EACf,WAAW,EACX,SAAS,EACT,SAAS,EACT,YAAY,EACZ,UAAU,EACV,cAAc,EACf,GAAG,IAAI,CAAC,KAAK,CAAC;QACf,MAAM,aAAa,GAAkB;YACnC,eAAe;YACf,WAAW;YACX,SAAS;YACT,SAAS;YACT,YAAY;YACZ,UAAU;YACV,cAAc;SACf,CAAC;QACF,KAAK,CAAC,YAAY,CAAC,QAAQ,CAAC,EAAC,QAAQ,EAAE,aAAa,EAAC,CAAC,CAAC;QACvD,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;IACtC,CAAC;;AAtDM,uBAAS,GAAG,eAAe,CAAC;eADhB,aAAa"}
@@ -1 +1 @@
1
- {"version":3,"file":"weights-fs.glsl.d.ts","sourceRoot":"","sources":["../../src/heatmap-layer/weights-fs.glsl.ts"],"names":[],"mappings":";AAAA,wBAoBE"}
1
+ {"version":3,"file":"weights-fs.glsl.d.ts","sourceRoot":"","sources":["../../src/heatmap-layer/weights-fs.glsl.ts"],"names":[],"mappings":";AAIA,wBAoBE"}
@@ -1,3 +1,6 @@
1
+ // deck.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright (c) vis.gl contributors
1
4
  export default `\
2
5
  #version 300 es
3
6
  in vec4 weightsTexture;
@@ -15,3 +18,4 @@ fragColor = weightsTexture * gaussianKDE(2. * dist);
15
18
  DECKGL_FILTER_COLOR(fragColor, geometry);
16
19
  }
17
20
  `;
21
+ //# sourceMappingURL=weights-fs.glsl.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"weights-fs.glsl.js","sourceRoot":"","sources":["../../src/heatmap-layer/weights-fs.glsl.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,oCAAoC;AAEpC;;;;;;;;;;;;;;;;EAoBE"}
@@ -1,3 +1,3 @@
1
- declare const _default: "#version 300 es\nin vec3 positions;\nin vec3 positions64Low;\nin float weights;\nout vec4 weightsTexture;\nuniform float radiusPixels;\nuniform float textureWidth;\nuniform vec4 commonBounds;\nuniform float weightsScale;\n\nvoid main()\n{\n weightsTexture = vec4(weights * weightsScale, 0., 0., 1.);\n\n float radiusTexels = project_pixel_size(radiusPixels) * textureWidth / (commonBounds.z - commonBounds.x);\n gl_PointSize = radiusTexels * 2.;\n\n vec3 commonPosition = project_position(positions, positions64Low);\n\n // // map xy from commonBounds to [-1, 1]\n gl_Position.xy = (commonPosition.xy - commonBounds.xy) / (commonBounds.zw - commonBounds.xy) ;\n gl_Position.xy = (gl_Position.xy * 2.) - (1.);\n gl_Position.w = 1.0;\n}\n";
1
+ declare const _default: "#version 300 es\nin vec3 positions;\nin vec3 positions64Low;\nin float weights;\nout vec4 weightsTexture;\n\nvoid main()\n{\n weightsTexture = vec4(weights * weight.weightsScale, 0., 0., 1.);\n\n float radiusTexels = project_pixel_size(weight.radiusPixels) * weight.textureWidth / (weight.commonBounds.z - weight.commonBounds.x);\n gl_PointSize = radiusTexels * 2.;\n\n vec3 commonPosition = project_position(positions, positions64Low);\n\n // // map xy from commonBounds to [-1, 1]\n gl_Position.xy = (commonPosition.xy - weight.commonBounds.xy) / (weight.commonBounds.zw - weight.commonBounds.xy) ;\n gl_Position.xy = (gl_Position.xy * 2.) - (1.);\n gl_Position.w = 1.0;\n}\n";
2
2
  export default _default;
3
3
  //# sourceMappingURL=weights-vs.glsl.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"weights-vs.glsl.d.ts","sourceRoot":"","sources":["../../src/heatmap-layer/weights-vs.glsl.ts"],"names":[],"mappings":";AAAA,wBAyBE"}
1
+ {"version":3,"file":"weights-vs.glsl.d.ts","sourceRoot":"","sources":["../../src/heatmap-layer/weights-vs.glsl.ts"],"names":[],"mappings":";AAIA,wBAqBE"}
@@ -1,21 +1,21 @@
1
+ // deck.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright (c) vis.gl contributors
1
4
  export default `\
2
5
  #version 300 es
3
6
  in vec3 positions;
4
7
  in vec3 positions64Low;
5
8
  in float weights;
6
9
  out vec4 weightsTexture;
7
- uniform float radiusPixels;
8
- uniform float textureWidth;
9
- uniform vec4 commonBounds;
10
- uniform float weightsScale;
11
10
  void main()
12
11
  {
13
- weightsTexture = vec4(weights * weightsScale, 0., 0., 1.);
14
- float radiusTexels = project_pixel_size(radiusPixels) * textureWidth / (commonBounds.z - commonBounds.x);
12
+ weightsTexture = vec4(weights * weight.weightsScale, 0., 0., 1.);
13
+ float radiusTexels = project_pixel_size(weight.radiusPixels) * weight.textureWidth / (weight.commonBounds.z - weight.commonBounds.x);
15
14
  gl_PointSize = radiusTexels * 2.;
16
15
  vec3 commonPosition = project_position(positions, positions64Low);
17
- gl_Position.xy = (commonPosition.xy - commonBounds.xy) / (commonBounds.zw - commonBounds.xy) ;
16
+ gl_Position.xy = (commonPosition.xy - weight.commonBounds.xy) / (weight.commonBounds.zw - weight.commonBounds.xy) ;
18
17
  gl_Position.xy = (gl_Position.xy * 2.) - (1.);
19
18
  gl_Position.w = 1.0;
20
19
  }
21
20
  `;
21
+ //# sourceMappingURL=weights-vs.glsl.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"weights-vs.glsl.js","sourceRoot":"","sources":["../../src/heatmap-layer/weights-vs.glsl.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,oCAAoC;AAEpC;;;;;;;;;;;;;;;;EAqBE"}
@@ -0,0 +1,14 @@
1
+ import { NumberArray2 } from '@math.gl/core';
2
+ export type BinOptions = {
3
+ hexOriginCommon: NumberArray2;
4
+ radiusCommon: number;
5
+ };
6
+ export declare const binOptionsUniforms: {
7
+ readonly name: "binOptions";
8
+ readonly vs: "uniform binOptionsUniforms {\n vec2 hexOriginCommon;\n float radiusCommon;\n} binOptions;\n";
9
+ readonly uniformTypes: {
10
+ readonly hexOriginCommon: "vec2<f32>";
11
+ readonly radiusCommon: "f32";
12
+ };
13
+ };
14
+ //# sourceMappingURL=bin-options-uniforms.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bin-options-uniforms.d.ts","sourceRoot":"","sources":["../../src/hexagon-layer/bin-options-uniforms.ts"],"names":[],"mappings":"AAKA,OAAO,EAAC,YAAY,EAAC,MAAM,eAAe,CAAC;AAS3C,MAAM,MAAM,UAAU,GAAG;IACvB,eAAe,EAAE,YAAY,CAAC;IAC9B,YAAY,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,eAAO,MAAM,kBAAkB;;;;;;;CAOc,CAAC"}
@@ -0,0 +1,18 @@
1
+ // deck.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright (c) vis.gl contributors
4
+ const uniformBlock = /* glsl */ `\
5
+ uniform binOptionsUniforms {
6
+ vec2 hexOriginCommon;
7
+ float radiusCommon;
8
+ } binOptions;
9
+ `;
10
+ export const binOptionsUniforms = {
11
+ name: 'binOptions',
12
+ vs: uniformBlock,
13
+ uniformTypes: {
14
+ hexOriginCommon: 'vec2<f32>',
15
+ radiusCommon: 'f32'
16
+ }
17
+ };
18
+ //# sourceMappingURL=bin-options-uniforms.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bin-options-uniforms.js","sourceRoot":"","sources":["../../src/hexagon-layer/bin-options-uniforms.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,oCAAoC;AAKpC,MAAM,YAAY,GAAG,UAAU,CAAC;;;;;CAK/B,CAAC;AAOF,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,IAAI,EAAE,YAAY;IAClB,EAAE,EAAE,YAAY;IAChB,YAAY,EAAE;QACZ,eAAe,EAAE,WAAW;QAC5B,YAAY,EAAE,KAAK;KACpB;CAC0C,CAAC"}
@@ -0,0 +1,3 @@
1
+ declare const _default: string;
2
+ export default _default;
3
+ //# sourceMappingURL=hexagon-cell-layer-vertex.glsl.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hexagon-cell-layer-vertex.glsl.d.ts","sourceRoot":"","sources":["../../src/hexagon-layer/hexagon-cell-layer-vertex.glsl.ts"],"names":[],"mappings":";AAMA,wBAkEE"}
@@ -0,0 +1,56 @@
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
+ `;
56
+ //# sourceMappingURL=hexagon-cell-layer-vertex.glsl.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hexagon-cell-layer-vertex.glsl.js","sourceRoot":"","sources":["../../src/hexagon-layer/hexagon-cell-layer-vertex.glsl.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,oCAAoC;AAEpC,OAAO,EAAC,qBAAqB,EAAC,oBAAiB;AAE/C,eAAe,UAAU,CAAC;;;;;;;;;;;EAiBxB,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiDtB,CAAC"}
@@ -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,95 @@
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;
95
+ //# sourceMappingURL=hexagon-cell-layer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hexagon-cell-layer.js","sourceRoot":"","sources":["../../src/hexagon-layer/hexagon-cell-layer.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,oCAAoC;AAIpC,OAAO,EAAC,WAAW,EAAC,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAC,uBAAuB,EAAE,uBAAuB,EAAC,uCAAoC;AAC7F,OAAO,EAAE,4CAAyC;AAClD,OAAO,EAAe,eAAe,EAAC,oCAAiC;AAevE,MAAqB,gBAA8C,SAAQ,WAG1E;IAOC,UAAU;QACR,MAAM,OAAO,GAAG,KAAK,CAAC,UAAU,EAAE,CAAC;QACnC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;QACtC,OAAO,EAAC,GAAG,OAAO,EAAE,EAAE,EAAC,CAAC;IAC1B,CAAC;IAED,eAAe;QACb,KAAK,CAAC,eAAe,EAAE,CAAC;QAExB,MAAM,gBAAgB,GAAG,IAAI,CAAC,mBAAmB,EAAG,CAAC;QACrD,gBAAgB,CAAC,MAAM,CAAC;YACtB,oBAAoB;YACpB,oBAAoB;YACpB,oBAAoB;YACpB,sBAAsB;SACvB,CAAC,CAAC;QACH,gBAAgB,CAAC,YAAY,CAAC;YAC5B,iBAAiB,EAAE;gBACjB,IAAI,EAAE,CAAC;gBACP,IAAI,EAAE,SAAS;gBACf,QAAQ,EAAE,QAAQ;aACnB;YACD,mBAAmB,EAAE;gBACnB,IAAI,EAAE,CAAC;gBACP,IAAI,EAAE,SAAS;gBACf,QAAQ,EAAE,eAAe;aAC1B;YACD,uBAAuB,EAAE;gBACvB,IAAI,EAAE,CAAC;gBACP,IAAI,EAAE,SAAS;gBACf,QAAQ,EAAE,mBAAmB;aAC9B;SACF,CAAC,CAAC;IACL,CAAC;IAED,WAAW,CAAC,MAA8B;QACxC,KAAK,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;QAE1B,MAAM,EAAC,KAAK,EAAE,QAAQ,EAAC,GAAG,MAAM,CAAC;QACjC,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,SAAU,CAAC;QAEpC,IAAI,QAAQ,CAAC,UAAU,KAAK,KAAK,CAAC,UAAU,EAAE,CAAC;YAC7C,IAAI,CAAC,KAAK,CAAC,YAAY,EAAE,OAAO,EAAE,CAAC;YACnC,IAAI,CAAC,KAAK,CAAC,YAAY,GAAG,uBAAuB,CAC/C,IAAI,CAAC,OAAO,CAAC,MAAM,EACnB,KAAK,CAAC,UAAU,EAChB,KAAK,CAAC,cAAc,CACrB,CAAC;YACF,MAAM,YAAY,GAA0B,EAAC,UAAU,EAAE,IAAI,CAAC,KAAK,CAAC,YAAY,EAAC,CAAC;YAClF,KAAK,CAAC,YAAY,CAAC,QAAQ,CAAC,EAAC,OAAO,EAAE,YAAY,EAAC,CAAC,CAAC;QACvD,CAAC;aAAM,IAAI,QAAQ,CAAC,cAAc,KAAK,KAAK,CAAC,cAAc,EAAE,CAAC;YAC5D,uBAAuB,CAAC,IAAI,CAAC,KAAK,CAAC,YAAY,EAAE,KAAK,CAAC,cAAc,CAAC,CAAC;QACzE,CAAC;IACH,CAAC;IAED,aAAa,CAAC,OAAO;QACnB,KAAK,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;QAE7B,IAAI,CAAC,KAAK,CAAC,YAAY,EAAE,OAAO,EAAE,CAAC;IACrC,CAAC;IAED,IAAI,CAAC,EAAC,QAAQ,EAAC;QACb,MAAM,EACJ,MAAM,EACN,eAAe,EACf,cAAc,EACd,cAAc,EACd,QAAQ,EACR,QAAQ,EACR,WAAW,EACX,eAAe,EAChB,GAAG,IAAI,CAAC,KAAK,CAAC;QACf,MAAM,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,WAAW,IAAI,CAAC,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;QACpE,MAAM,eAAe,GAAG,IAAI,CAAC,KAAK,CAAC,eAAe,IAAI,CAAC,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;QAC5E,MAAM,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,SAAU,CAAC;QAExC,IAAI,SAAS,CAAC,WAAW,CAAC,WAAW,EAAE,CAAC;YACtC,kDAAkD;YAClD,gDAAgD;YAChD,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;QACjC,CAAC;QACD,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC;QAErD,MAAM,YAAY,GAAqC;YACrD,WAAW,EAAE;gBACX,IAAI,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,EAAE,gDAAgD;gBAC1F,IAAI,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,EAAE,oEAAoE;gBAC9G,IAAI,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,EAAE,oDAAoD;gBAClG,IAAI,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,uDAAuD;aACrG;YACD,eAAe,EAAE;gBACf,IAAI,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC,CAAC,EAAE,eAAe,CAAC,CAAC,CAAC,CAAC,EAAE,wDAAwD;gBAC1G,IAAI,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC,CAAC,EAAE,eAAe,CAAC,CAAC,CAAC,CAAC,EAAE,gFAAgF;gBAClI,IAAI,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,eAAe,CAAC,CAAC,CAAC,CAAC,EAAE,wDAAwD;gBAC9G,IAAI,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,eAAe,CAAC,CAAC,CAAC,CAAC,CAAC,2DAA2D;aACjH;YACD,cAAc,EAAE,CAAC,cAAc,CAAC,CAAC,CAAC,GAAG,cAAc,EAAE,cAAc,CAAC,CAAC,CAAC,GAAG,cAAc,CAAC;YACxF,YAAY,EAAE,eAAe;SAC9B,CAAC;QAEF,SAAS,CAAC,YAAY,CAAC,QAAQ,CAAC;YAC9B,MAAM,EAAE,EAAC,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAC;YACpC,OAAO,EAAE,YAAY;SACtB,CAAC,CAAC;QACH,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;IAC1C,CAAC;;AA/GM,0BAAS,GAAG,kBAAkB,CAAC;eAJnB,gBAAgB"}
@@ -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,22 @@
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
+ };
22
+ //# sourceMappingURL=hexagon-layer-uniforms.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hexagon-layer-uniforms.js","sourceRoot":"","sources":["../../src/hexagon-layer/hexagon-layer-uniforms.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,oCAAoC;AAKpC,MAAM,YAAY,GAAG,UAAU,CAAC;;;;;;;CAO/B,CAAC;AAUF,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,IAAI,EAAE,SAAS;IACf,EAAE,EAAE,YAAY;IAChB,YAAY,EAAE;QACZ,WAAW,EAAE,WAAW;QACxB,eAAe,EAAE,WAAW;QAC5B,cAAc,EAAE,WAAW;QAC3B,YAAY,EAAE,WAAW;KAC1B;CAC4C,CAAC"}
@@ -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 true
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