@deck.gl/aggregation-layers 9.0.0-alpha.7 → 9.0.0-beta.10

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 (364) hide show
  1. package/{typed → dist}/aggregation-layer.d.ts.map +1 -1
  2. package/dist/aggregation-layer.js +153 -0
  3. package/{typed → dist}/contour-layer/contour-layer.d.ts +1 -1
  4. package/dist/contour-layer/contour-layer.d.ts.map +1 -0
  5. package/dist/contour-layer/contour-layer.js +240 -0
  6. package/dist/contour-layer/contour-utils.js +64 -0
  7. package/dist/contour-layer/marching-squares-codes.js +337 -0
  8. package/dist/contour-layer/marching-squares.js +147 -0
  9. package/{typed → dist}/cpu-grid-layer/cpu-grid-layer.d.ts +3 -3
  10. package/dist/cpu-grid-layer/cpu-grid-layer.d.ts.map +1 -0
  11. package/dist/cpu-grid-layer/cpu-grid-layer.js +129 -0
  12. package/dist/cpu-grid-layer/grid-aggregator.js +141 -0
  13. package/dist/dist.dev.js +1447 -10846
  14. package/dist/gpu-grid-layer/gpu-grid-cell-layer-fragment.glsl.js +30 -0
  15. package/dist/gpu-grid-layer/gpu-grid-cell-layer-vertex.glsl.js +112 -0
  16. package/{typed → dist}/gpu-grid-layer/gpu-grid-cell-layer.d.ts +1 -1
  17. package/dist/gpu-grid-layer/gpu-grid-cell-layer.d.ts.map +1 -0
  18. package/dist/gpu-grid-layer/gpu-grid-cell-layer.js +145 -0
  19. package/{typed → dist}/gpu-grid-layer/gpu-grid-layer.d.ts +4 -4
  20. package/dist/gpu-grid-layer/gpu-grid-layer.d.ts.map +1 -0
  21. package/dist/gpu-grid-layer/gpu-grid-layer.js +288 -0
  22. package/{typed → dist}/grid-aggregation-layer.d.ts +3 -3
  23. package/dist/grid-aggregation-layer.d.ts.map +1 -0
  24. package/dist/grid-aggregation-layer.js +172 -0
  25. package/{typed → dist}/grid-layer/grid-layer.d.ts +2 -2
  26. package/dist/grid-layer/grid-layer.d.ts.map +1 -0
  27. package/dist/grid-layer/grid-layer.js +63 -0
  28. package/{typed → dist}/heatmap-layer/heatmap-layer-utils.d.ts +0 -9
  29. package/dist/heatmap-layer/heatmap-layer-utils.d.ts.map +1 -0
  30. package/dist/heatmap-layer/heatmap-layer-utils.js +63 -0
  31. package/{typed → dist}/heatmap-layer/heatmap-layer.d.ts +5 -6
  32. package/dist/heatmap-layer/heatmap-layer.d.ts.map +1 -0
  33. package/dist/heatmap-layer/heatmap-layer.js +455 -0
  34. package/dist/heatmap-layer/max-fs.glsl.js +9 -0
  35. package/dist/heatmap-layer/max-vs.glsl.d.ts +3 -0
  36. package/{typed → dist}/heatmap-layer/max-vs.glsl.d.ts.map +1 -1
  37. package/dist/heatmap-layer/max-vs.glsl.js +15 -0
  38. package/dist/heatmap-layer/triangle-layer-fragment.glsl.d.ts +3 -0
  39. package/dist/heatmap-layer/triangle-layer-fragment.glsl.js +51 -0
  40. package/dist/heatmap-layer/triangle-layer-vertex.glsl.js +47 -0
  41. package/{typed → dist}/heatmap-layer/triangle-layer.d.ts +10 -2
  42. package/dist/heatmap-layer/triangle-layer.d.ts.map +1 -0
  43. package/dist/heatmap-layer/triangle-layer.js +59 -0
  44. package/dist/heatmap-layer/weights-fs.glsl.js +17 -0
  45. package/dist/heatmap-layer/weights-vs.glsl.d.ts +3 -0
  46. package/{typed → dist}/heatmap-layer/weights-vs.glsl.d.ts.map +1 -1
  47. package/dist/heatmap-layer/weights-vs.glsl.js +21 -0
  48. package/dist/hexagon-layer/hexagon-aggregator.js +112 -0
  49. package/{typed → dist}/hexagon-layer/hexagon-layer.d.ts +4 -4
  50. package/dist/hexagon-layer/hexagon-layer.d.ts.map +1 -0
  51. package/dist/hexagon-layer/hexagon-layer.js +173 -0
  52. package/dist/index.cjs +4327 -0
  53. package/dist/index.cjs.map +7 -0
  54. package/dist/index.d.ts +20 -0
  55. package/dist/index.d.ts.map +1 -0
  56. package/dist/index.js +32 -0
  57. package/{typed → dist}/screen-grid-layer/screen-grid-cell-layer.d.ts +2 -3
  58. package/dist/screen-grid-layer/screen-grid-cell-layer.d.ts.map +1 -0
  59. package/dist/screen-grid-layer/screen-grid-cell-layer.js +163 -0
  60. package/dist/screen-grid-layer/screen-grid-layer-fragment.glsl.js +35 -0
  61. package/dist/screen-grid-layer/screen-grid-layer-vertex.glsl.js +72 -0
  62. package/{typed → dist}/screen-grid-layer/screen-grid-layer.d.ts +1 -4
  63. package/dist/screen-grid-layer/screen-grid-layer.d.ts.map +1 -0
  64. package/dist/screen-grid-layer/screen-grid-layer.js +209 -0
  65. package/dist/types.js +1 -0
  66. package/dist/utils/aggregation-operation-utils.js +94 -0
  67. package/{typed → dist}/utils/bin-sorter.d.ts +1 -1
  68. package/dist/utils/bin-sorter.js +167 -0
  69. package/dist/utils/color-utils.js +53 -0
  70. package/dist/utils/cpu-aggregator.js +421 -0
  71. package/dist/utils/gpu-grid-aggregation/aggregate-all-fs.glsl.js +36 -0
  72. package/dist/utils/gpu-grid-aggregation/aggregate-all-vs.glsl.js +42 -0
  73. package/dist/utils/gpu-grid-aggregation/aggregate-to-grid-fs.glsl.js +30 -0
  74. package/dist/utils/gpu-grid-aggregation/aggregate-to-grid-vs.glsl.js +61 -0
  75. package/dist/utils/gpu-grid-aggregation/gpu-grid-aggregator-constants.js +41 -0
  76. package/dist/utils/gpu-grid-aggregation/gpu-grid-aggregator-utils.js +1 -0
  77. package/{typed → dist}/utils/gpu-grid-aggregation/gpu-grid-aggregator.d.ts.map +1 -1
  78. package/dist/utils/gpu-grid-aggregation/gpu-grid-aggregator.js +555 -0
  79. package/dist/utils/gpu-grid-aggregation/transform-mean-vs.glsl.js +32 -0
  80. package/dist/utils/grid-aggregation-utils.js +114 -0
  81. package/dist/utils/prop-utils.js +28 -0
  82. package/{typed → dist}/utils/resource-utils.d.ts.map +1 -1
  83. package/dist/utils/resource-utils.js +38 -0
  84. package/dist/utils/scale-utils.js +184 -0
  85. package/dist.min.js +299 -555
  86. package/package.json +19 -14
  87. package/src/aggregation-layer.ts +3 -1
  88. package/src/contour-layer/contour-layer.ts +4 -5
  89. package/src/cpu-grid-layer/cpu-grid-layer.ts +1 -2
  90. package/src/gpu-grid-layer/gpu-grid-cell-layer.ts +1 -1
  91. package/src/gpu-grid-layer/gpu-grid-layer.ts +3 -3
  92. package/src/grid-layer/grid-layer.ts +4 -2
  93. package/src/heatmap-layer/heatmap-layer-utils.ts +0 -23
  94. package/src/heatmap-layer/heatmap-layer.ts +92 -128
  95. package/src/heatmap-layer/max-vs.glsl.ts +11 -5
  96. package/src/heatmap-layer/triangle-layer-fragment.glsl.ts +2 -2
  97. package/src/heatmap-layer/triangle-layer.ts +17 -24
  98. package/src/heatmap-layer/weights-vs.glsl.ts +4 -2
  99. package/src/hexagon-layer/hexagon-layer.ts +2 -3
  100. package/src/screen-grid-layer/screen-grid-cell-layer.ts +0 -4
  101. package/src/screen-grid-layer/screen-grid-layer.ts +2 -12
  102. package/src/utils/cpu-aggregator.ts +1 -1
  103. package/src/utils/gpu-grid-aggregation/gpu-grid-aggregator.ts +14 -28
  104. package/src/utils/resource-utils.ts +2 -8
  105. package/dist/es5/aggregation-layer.js +0 -213
  106. package/dist/es5/aggregation-layer.js.map +0 -1
  107. package/dist/es5/contour-layer/contour-layer.js +0 -353
  108. package/dist/es5/contour-layer/contour-layer.js.map +0 -1
  109. package/dist/es5/contour-layer/contour-utils.js +0 -110
  110. package/dist/es5/contour-layer/contour-utils.js.map +0 -1
  111. package/dist/es5/contour-layer/marching-squares-codes.js +0 -152
  112. package/dist/es5/contour-layer/marching-squares-codes.js.map +0 -1
  113. package/dist/es5/contour-layer/marching-squares.js +0 -168
  114. package/dist/es5/contour-layer/marching-squares.js.map +0 -1
  115. package/dist/es5/cpu-grid-layer/cpu-grid-layer.js +0 -235
  116. package/dist/es5/cpu-grid-layer/cpu-grid-layer.js.map +0 -1
  117. package/dist/es5/cpu-grid-layer/grid-aggregator.js +0 -180
  118. package/dist/es5/cpu-grid-layer/grid-aggregator.js.map +0 -1
  119. package/dist/es5/gpu-grid-layer/gpu-grid-cell-layer-fragment.glsl.js +0 -9
  120. package/dist/es5/gpu-grid-layer/gpu-grid-cell-layer-fragment.glsl.js.map +0 -1
  121. package/dist/es5/gpu-grid-layer/gpu-grid-cell-layer-vertex.glsl.js +0 -9
  122. package/dist/es5/gpu-grid-layer/gpu-grid-cell-layer-vertex.glsl.js.map +0 -1
  123. package/dist/es5/gpu-grid-layer/gpu-grid-cell-layer.js +0 -247
  124. package/dist/es5/gpu-grid-layer/gpu-grid-cell-layer.js.map +0 -1
  125. package/dist/es5/gpu-grid-layer/gpu-grid-layer.js +0 -424
  126. package/dist/es5/gpu-grid-layer/gpu-grid-layer.js.map +0 -1
  127. package/dist/es5/grid-aggregation-layer.js +0 -280
  128. package/dist/es5/grid-aggregation-layer.js.map +0 -1
  129. package/dist/es5/grid-layer/grid-layer.js +0 -125
  130. package/dist/es5/grid-layer/grid-layer.js.map +0 -1
  131. package/dist/es5/heatmap-layer/heatmap-layer-utils.js +0 -122
  132. package/dist/es5/heatmap-layer/heatmap-layer-utils.js.map +0 -1
  133. package/dist/es5/heatmap-layer/heatmap-layer.js +0 -672
  134. package/dist/es5/heatmap-layer/heatmap-layer.js.map +0 -1
  135. package/dist/es5/heatmap-layer/max-fs.glsl.js +0 -9
  136. package/dist/es5/heatmap-layer/max-fs.glsl.js.map +0 -1
  137. package/dist/es5/heatmap-layer/max-vs.glsl.js +0 -9
  138. package/dist/es5/heatmap-layer/max-vs.glsl.js.map +0 -1
  139. package/dist/es5/heatmap-layer/triangle-layer-fragment.glsl.js +0 -9
  140. package/dist/es5/heatmap-layer/triangle-layer-fragment.glsl.js.map +0 -1
  141. package/dist/es5/heatmap-layer/triangle-layer-vertex.glsl.js +0 -9
  142. package/dist/es5/heatmap-layer/triangle-layer-vertex.glsl.js.map +0 -1
  143. package/dist/es5/heatmap-layer/triangle-layer.js +0 -122
  144. package/dist/es5/heatmap-layer/triangle-layer.js.map +0 -1
  145. package/dist/es5/heatmap-layer/weights-fs.glsl.js +0 -9
  146. package/dist/es5/heatmap-layer/weights-fs.glsl.js.map +0 -1
  147. package/dist/es5/heatmap-layer/weights-vs.glsl.js +0 -9
  148. package/dist/es5/heatmap-layer/weights-vs.glsl.js.map +0 -1
  149. package/dist/es5/hexagon-layer/hexagon-aggregator.js +0 -118
  150. package/dist/es5/hexagon-layer/hexagon-aggregator.js.map +0 -1
  151. package/dist/es5/hexagon-layer/hexagon-layer.js +0 -289
  152. package/dist/es5/hexagon-layer/hexagon-layer.js.map +0 -1
  153. package/dist/es5/index.js +0 -104
  154. package/dist/es5/index.js.map +0 -1
  155. package/dist/es5/screen-grid-layer/screen-grid-cell-layer.js +0 -244
  156. package/dist/es5/screen-grid-layer/screen-grid-cell-layer.js.map +0 -1
  157. package/dist/es5/screen-grid-layer/screen-grid-layer-fragment.glsl.js +0 -9
  158. package/dist/es5/screen-grid-layer/screen-grid-layer-fragment.glsl.js.map +0 -1
  159. package/dist/es5/screen-grid-layer/screen-grid-layer-vertex.glsl.js +0 -9
  160. package/dist/es5/screen-grid-layer/screen-grid-layer-vertex.glsl.js.map +0 -1
  161. package/dist/es5/screen-grid-layer/screen-grid-layer.js +0 -317
  162. package/dist/es5/screen-grid-layer/screen-grid-layer.js.map +0 -1
  163. package/dist/es5/types.js +0 -2
  164. package/dist/es5/types.js.map +0 -1
  165. package/dist/es5/utils/aggregation-operation-utils.js +0 -123
  166. package/dist/es5/utils/aggregation-operation-utils.js.map +0 -1
  167. package/dist/es5/utils/bin-sorter.js +0 -248
  168. package/dist/es5/utils/bin-sorter.js.map +0 -1
  169. package/dist/es5/utils/color-utils.js +0 -39
  170. package/dist/es5/utils/color-utils.js.map +0 -1
  171. package/dist/es5/utils/cpu-aggregator.js +0 -496
  172. package/dist/es5/utils/cpu-aggregator.js.map +0 -1
  173. package/dist/es5/utils/gpu-grid-aggregation/aggregate-all-fs.glsl.js +0 -9
  174. package/dist/es5/utils/gpu-grid-aggregation/aggregate-all-fs.glsl.js.map +0 -1
  175. package/dist/es5/utils/gpu-grid-aggregation/aggregate-all-vs.glsl.js +0 -9
  176. package/dist/es5/utils/gpu-grid-aggregation/aggregate-all-vs.glsl.js.map +0 -1
  177. package/dist/es5/utils/gpu-grid-aggregation/aggregate-to-grid-fs.glsl.js +0 -9
  178. package/dist/es5/utils/gpu-grid-aggregation/aggregate-to-grid-fs.glsl.js.map +0 -1
  179. package/dist/es5/utils/gpu-grid-aggregation/aggregate-to-grid-vs.glsl.js +0 -9
  180. package/dist/es5/utils/gpu-grid-aggregation/aggregate-to-grid-vs.glsl.js.map +0 -1
  181. package/dist/es5/utils/gpu-grid-aggregation/gpu-grid-aggregator-constants.js +0 -63
  182. package/dist/es5/utils/gpu-grid-aggregation/gpu-grid-aggregator-constants.js.map +0 -1
  183. package/dist/es5/utils/gpu-grid-aggregation/gpu-grid-aggregator-utils.js +0 -2
  184. package/dist/es5/utils/gpu-grid-aggregation/gpu-grid-aggregator-utils.js.map +0 -1
  185. package/dist/es5/utils/gpu-grid-aggregation/gpu-grid-aggregator.js +0 -732
  186. package/dist/es5/utils/gpu-grid-aggregation/gpu-grid-aggregator.js.map +0 -1
  187. package/dist/es5/utils/gpu-grid-aggregation/gpu-grid-aggregator.md +0 -155
  188. package/dist/es5/utils/gpu-grid-aggregation/transform-mean-vs.glsl.js +0 -9
  189. package/dist/es5/utils/gpu-grid-aggregation/transform-mean-vs.glsl.js.map +0 -1
  190. package/dist/es5/utils/grid-aggregation-utils.js +0 -118
  191. package/dist/es5/utils/grid-aggregation-utils.js.map +0 -1
  192. package/dist/es5/utils/prop-utils.js +0 -19
  193. package/dist/es5/utils/prop-utils.js.map +0 -1
  194. package/dist/es5/utils/resource-utils.js +0 -61
  195. package/dist/es5/utils/resource-utils.js.map +0 -1
  196. package/dist/es5/utils/scale-utils.js +0 -254
  197. package/dist/es5/utils/scale-utils.js.map +0 -1
  198. package/dist/esm/aggregation-layer.js +0 -154
  199. package/dist/esm/aggregation-layer.js.map +0 -1
  200. package/dist/esm/contour-layer/contour-layer.js +0 -316
  201. package/dist/esm/contour-layer/contour-layer.js.map +0 -1
  202. package/dist/esm/contour-layer/contour-utils.js +0 -81
  203. package/dist/esm/contour-layer/contour-utils.js.map +0 -1
  204. package/dist/esm/contour-layer/marching-squares-codes.js +0 -219
  205. package/dist/esm/contour-layer/marching-squares-codes.js.map +0 -1
  206. package/dist/esm/contour-layer/marching-squares.js +0 -151
  207. package/dist/esm/contour-layer/marching-squares.js.map +0 -1
  208. package/dist/esm/cpu-grid-layer/cpu-grid-layer.js +0 -186
  209. package/dist/esm/cpu-grid-layer/cpu-grid-layer.js.map +0 -1
  210. package/dist/esm/cpu-grid-layer/grid-aggregator.js +0 -142
  211. package/dist/esm/cpu-grid-layer/grid-aggregator.js.map +0 -1
  212. package/dist/esm/gpu-grid-layer/gpu-grid-cell-layer-fragment.glsl.js +0 -16
  213. package/dist/esm/gpu-grid-layer/gpu-grid-cell-layer-fragment.glsl.js.map +0 -1
  214. package/dist/esm/gpu-grid-layer/gpu-grid-cell-layer-vertex.glsl.js +0 -122
  215. package/dist/esm/gpu-grid-layer/gpu-grid-cell-layer-vertex.glsl.js.map +0 -1
  216. package/dist/esm/gpu-grid-layer/gpu-grid-cell-layer.js +0 -196
  217. package/dist/esm/gpu-grid-layer/gpu-grid-cell-layer.js.map +0 -1
  218. package/dist/esm/gpu-grid-layer/gpu-grid-layer.js +0 -399
  219. package/dist/esm/gpu-grid-layer/gpu-grid-layer.js.map +0 -1
  220. package/dist/esm/grid-aggregation-layer.js +0 -240
  221. package/dist/esm/grid-aggregation-layer.js.map +0 -1
  222. package/dist/esm/grid-layer/grid-layer.js +0 -80
  223. package/dist/esm/grid-layer/grid-layer.js.map +0 -1
  224. package/dist/esm/heatmap-layer/heatmap-layer-utils.js +0 -68
  225. package/dist/esm/heatmap-layer/heatmap-layer-utils.js.map +0 -1
  226. package/dist/esm/heatmap-layer/heatmap-layer.js +0 -626
  227. package/dist/esm/heatmap-layer/heatmap-layer.js.map +0 -1
  228. package/dist/esm/heatmap-layer/max-fs.glsl.js +0 -10
  229. package/dist/esm/heatmap-layer/max-fs.glsl.js.map +0 -1
  230. package/dist/esm/heatmap-layer/max-vs.glsl.js +0 -14
  231. package/dist/esm/heatmap-layer/max-vs.glsl.js.map +0 -1
  232. package/dist/esm/heatmap-layer/triangle-layer-fragment.glsl.js +0 -43
  233. package/dist/esm/heatmap-layer/triangle-layer-fragment.glsl.js.map +0 -1
  234. package/dist/esm/heatmap-layer/triangle-layer-vertex.glsl.js +0 -33
  235. package/dist/esm/heatmap-layer/triangle-layer-vertex.glsl.js.map +0 -1
  236. package/dist/esm/heatmap-layer/triangle-layer.js +0 -80
  237. package/dist/esm/heatmap-layer/triangle-layer.js.map +0 -1
  238. package/dist/esm/heatmap-layer/weights-fs.glsl.js +0 -22
  239. package/dist/esm/heatmap-layer/weights-fs.glsl.js.map +0 -1
  240. package/dist/esm/heatmap-layer/weights-vs.glsl.js +0 -25
  241. package/dist/esm/heatmap-layer/weights-vs.glsl.js.map +0 -1
  242. package/dist/esm/hexagon-layer/hexagon-aggregator.js +0 -87
  243. package/dist/esm/hexagon-layer/hexagon-aggregator.js.map +0 -1
  244. package/dist/esm/hexagon-layer/hexagon-layer.js +0 -232
  245. package/dist/esm/hexagon-layer/hexagon-layer.js.map +0 -1
  246. package/dist/esm/index.js +0 -13
  247. package/dist/esm/index.js.map +0 -1
  248. package/dist/esm/screen-grid-layer/screen-grid-cell-layer.js +0 -203
  249. package/dist/esm/screen-grid-layer/screen-grid-cell-layer.js.map +0 -1
  250. package/dist/esm/screen-grid-layer/screen-grid-layer-fragment.glsl.js +0 -21
  251. package/dist/esm/screen-grid-layer/screen-grid-layer-fragment.glsl.js.map +0 -1
  252. package/dist/esm/screen-grid-layer/screen-grid-layer-vertex.glsl.js +0 -66
  253. package/dist/esm/screen-grid-layer/screen-grid-layer-vertex.glsl.js.map +0 -1
  254. package/dist/esm/screen-grid-layer/screen-grid-layer.js +0 -285
  255. package/dist/esm/screen-grid-layer/screen-grid-layer.js.map +0 -1
  256. package/dist/esm/types.js +0 -2
  257. package/dist/esm/types.js.map +0 -1
  258. package/dist/esm/utils/aggregation-operation-utils.js +0 -91
  259. package/dist/esm/utils/aggregation-operation-utils.js.map +0 -1
  260. package/dist/esm/utils/bin-sorter.js +0 -165
  261. package/dist/esm/utils/bin-sorter.js.map +0 -1
  262. package/dist/esm/utils/color-utils.js +0 -28
  263. package/dist/esm/utils/color-utils.js.map +0 -1
  264. package/dist/esm/utils/cpu-aggregator.js +0 -487
  265. package/dist/esm/utils/cpu-aggregator.js.map +0 -1
  266. package/dist/esm/utils/gpu-grid-aggregation/aggregate-all-fs.glsl.js +0 -21
  267. package/dist/esm/utils/gpu-grid-aggregation/aggregate-all-fs.glsl.js.map +0 -1
  268. package/dist/esm/utils/gpu-grid-aggregation/aggregate-all-vs.glsl.js +0 -35
  269. package/dist/esm/utils/gpu-grid-aggregation/aggregate-all-vs.glsl.js.map +0 -1
  270. package/dist/esm/utils/gpu-grid-aggregation/aggregate-to-grid-fs.glsl.js +0 -16
  271. package/dist/esm/utils/gpu-grid-aggregation/aggregate-to-grid-fs.glsl.js.map +0 -1
  272. package/dist/esm/utils/gpu-grid-aggregation/aggregate-to-grid-vs.glsl.js +0 -60
  273. package/dist/esm/utils/gpu-grid-aggregation/aggregate-to-grid-vs.glsl.js.map +0 -1
  274. package/dist/esm/utils/gpu-grid-aggregation/gpu-grid-aggregator-constants.js +0 -42
  275. package/dist/esm/utils/gpu-grid-aggregation/gpu-grid-aggregator-constants.js.map +0 -1
  276. package/dist/esm/utils/gpu-grid-aggregation/gpu-grid-aggregator-utils.js +0 -2
  277. package/dist/esm/utils/gpu-grid-aggregation/gpu-grid-aggregator-utils.js.map +0 -1
  278. package/dist/esm/utils/gpu-grid-aggregation/gpu-grid-aggregator.js +0 -720
  279. package/dist/esm/utils/gpu-grid-aggregation/gpu-grid-aggregator.js.map +0 -1
  280. package/dist/esm/utils/gpu-grid-aggregation/gpu-grid-aggregator.md +0 -155
  281. package/dist/esm/utils/gpu-grid-aggregation/transform-mean-vs.glsl.js +0 -19
  282. package/dist/esm/utils/gpu-grid-aggregation/transform-mean-vs.glsl.js.map +0 -1
  283. package/dist/esm/utils/grid-aggregation-utils.js +0 -109
  284. package/dist/esm/utils/grid-aggregation-utils.js.map +0 -1
  285. package/dist/esm/utils/prop-utils.js +0 -12
  286. package/dist/esm/utils/prop-utils.js.map +0 -1
  287. package/dist/esm/utils/resource-utils.js +0 -45
  288. package/dist/esm/utils/resource-utils.js.map +0 -1
  289. package/dist/esm/utils/scale-utils.js +0 -192
  290. package/dist/esm/utils/scale-utils.js.map +0 -1
  291. package/typed/contour-layer/contour-layer.d.ts.map +0 -1
  292. package/typed/cpu-grid-layer/cpu-grid-layer.d.ts.map +0 -1
  293. package/typed/gpu-grid-layer/gpu-grid-cell-layer.d.ts.map +0 -1
  294. package/typed/gpu-grid-layer/gpu-grid-layer.d.ts.map +0 -1
  295. package/typed/grid-aggregation-layer.d.ts.map +0 -1
  296. package/typed/grid-layer/grid-layer.d.ts.map +0 -1
  297. package/typed/heatmap-layer/heatmap-layer-utils.d.ts.map +0 -1
  298. package/typed/heatmap-layer/heatmap-layer.d.ts.map +0 -1
  299. package/typed/heatmap-layer/max-vs.glsl.d.ts +0 -3
  300. package/typed/heatmap-layer/triangle-layer-fragment.glsl.d.ts +0 -3
  301. package/typed/heatmap-layer/triangle-layer.d.ts.map +0 -1
  302. package/typed/heatmap-layer/weights-vs.glsl.d.ts +0 -3
  303. package/typed/hexagon-layer/hexagon-layer.d.ts.map +0 -1
  304. package/typed/index.d.ts +0 -20
  305. package/typed/index.d.ts.map +0 -1
  306. package/typed/screen-grid-layer/screen-grid-cell-layer.d.ts.map +0 -1
  307. package/typed/screen-grid-layer/screen-grid-layer.d.ts.map +0 -1
  308. /package/{typed → dist}/aggregation-layer.d.ts +0 -0
  309. /package/{typed → dist}/contour-layer/contour-utils.d.ts +0 -0
  310. /package/{typed → dist}/contour-layer/contour-utils.d.ts.map +0 -0
  311. /package/{typed → dist}/contour-layer/marching-squares-codes.d.ts +0 -0
  312. /package/{typed → dist}/contour-layer/marching-squares-codes.d.ts.map +0 -0
  313. /package/{typed → dist}/contour-layer/marching-squares.d.ts +0 -0
  314. /package/{typed → dist}/contour-layer/marching-squares.d.ts.map +0 -0
  315. /package/{typed → dist}/cpu-grid-layer/grid-aggregator.d.ts +0 -0
  316. /package/{typed → dist}/cpu-grid-layer/grid-aggregator.d.ts.map +0 -0
  317. /package/{typed → dist}/gpu-grid-layer/gpu-grid-cell-layer-fragment.glsl.d.ts +0 -0
  318. /package/{typed → dist}/gpu-grid-layer/gpu-grid-cell-layer-fragment.glsl.d.ts.map +0 -0
  319. /package/{typed → dist}/gpu-grid-layer/gpu-grid-cell-layer-vertex.glsl.d.ts +0 -0
  320. /package/{typed → dist}/gpu-grid-layer/gpu-grid-cell-layer-vertex.glsl.d.ts.map +0 -0
  321. /package/{typed → dist}/heatmap-layer/max-fs.glsl.d.ts +0 -0
  322. /package/{typed → dist}/heatmap-layer/max-fs.glsl.d.ts.map +0 -0
  323. /package/{typed → dist}/heatmap-layer/triangle-layer-fragment.glsl.d.ts.map +0 -0
  324. /package/{typed → dist}/heatmap-layer/triangle-layer-vertex.glsl.d.ts +0 -0
  325. /package/{typed → dist}/heatmap-layer/triangle-layer-vertex.glsl.d.ts.map +0 -0
  326. /package/{typed → dist}/heatmap-layer/weights-fs.glsl.d.ts +0 -0
  327. /package/{typed → dist}/heatmap-layer/weights-fs.glsl.d.ts.map +0 -0
  328. /package/{typed → dist}/hexagon-layer/hexagon-aggregator.d.ts +0 -0
  329. /package/{typed → dist}/hexagon-layer/hexagon-aggregator.d.ts.map +0 -0
  330. /package/{typed → dist}/screen-grid-layer/screen-grid-layer-fragment.glsl.d.ts +0 -0
  331. /package/{typed → dist}/screen-grid-layer/screen-grid-layer-fragment.glsl.d.ts.map +0 -0
  332. /package/{typed → dist}/screen-grid-layer/screen-grid-layer-vertex.glsl.d.ts +0 -0
  333. /package/{typed → dist}/screen-grid-layer/screen-grid-layer-vertex.glsl.d.ts.map +0 -0
  334. /package/{typed → dist}/types.d.ts +0 -0
  335. /package/{typed → dist}/types.d.ts.map +0 -0
  336. /package/{typed → dist}/utils/aggregation-operation-utils.d.ts +0 -0
  337. /package/{typed → dist}/utils/aggregation-operation-utils.d.ts.map +0 -0
  338. /package/{typed → dist}/utils/bin-sorter.d.ts.map +0 -0
  339. /package/{typed → dist}/utils/color-utils.d.ts +0 -0
  340. /package/{typed → dist}/utils/color-utils.d.ts.map +0 -0
  341. /package/{typed → dist}/utils/cpu-aggregator.d.ts +0 -0
  342. /package/{typed → dist}/utils/cpu-aggregator.d.ts.map +0 -0
  343. /package/{typed → dist}/utils/gpu-grid-aggregation/aggregate-all-fs.glsl.d.ts +0 -0
  344. /package/{typed → dist}/utils/gpu-grid-aggregation/aggregate-all-fs.glsl.d.ts.map +0 -0
  345. /package/{typed → dist}/utils/gpu-grid-aggregation/aggregate-all-vs.glsl.d.ts +0 -0
  346. /package/{typed → dist}/utils/gpu-grid-aggregation/aggregate-all-vs.glsl.d.ts.map +0 -0
  347. /package/{typed → dist}/utils/gpu-grid-aggregation/aggregate-to-grid-fs.glsl.d.ts +0 -0
  348. /package/{typed → dist}/utils/gpu-grid-aggregation/aggregate-to-grid-fs.glsl.d.ts.map +0 -0
  349. /package/{typed → dist}/utils/gpu-grid-aggregation/aggregate-to-grid-vs.glsl.d.ts +0 -0
  350. /package/{typed → dist}/utils/gpu-grid-aggregation/aggregate-to-grid-vs.glsl.d.ts.map +0 -0
  351. /package/{typed → dist}/utils/gpu-grid-aggregation/gpu-grid-aggregator-constants.d.ts +0 -0
  352. /package/{typed → dist}/utils/gpu-grid-aggregation/gpu-grid-aggregator-constants.d.ts.map +0 -0
  353. /package/{typed → dist}/utils/gpu-grid-aggregation/gpu-grid-aggregator-utils.d.ts +0 -0
  354. /package/{typed → dist}/utils/gpu-grid-aggregation/gpu-grid-aggregator-utils.d.ts.map +0 -0
  355. /package/{typed → dist}/utils/gpu-grid-aggregation/gpu-grid-aggregator.d.ts +0 -0
  356. /package/{typed → dist}/utils/gpu-grid-aggregation/transform-mean-vs.glsl.d.ts +0 -0
  357. /package/{typed → dist}/utils/gpu-grid-aggregation/transform-mean-vs.glsl.d.ts.map +0 -0
  358. /package/{typed → dist}/utils/grid-aggregation-utils.d.ts +0 -0
  359. /package/{typed → dist}/utils/grid-aggregation-utils.d.ts.map +0 -0
  360. /package/{typed → dist}/utils/prop-utils.d.ts +0 -0
  361. /package/{typed → dist}/utils/prop-utils.d.ts.map +0 -0
  362. /package/{typed → dist}/utils/resource-utils.d.ts +0 -0
  363. /package/{typed → dist}/utils/scale-utils.d.ts +0 -0
  364. /package/{typed → dist}/utils/scale-utils.d.ts.map +0 -0
package/package.json CHANGED
@@ -2,7 +2,8 @@
2
2
  "name": "@deck.gl/aggregation-layers",
3
3
  "description": "deck.gl layers that aggregate the input data into alternative representations",
4
4
  "license": "MIT",
5
- "version": "9.0.0-alpha.7",
5
+ "type": "module",
6
+ "version": "9.0.0-beta.10",
6
7
  "publishConfig": {
7
8
  "access": "public"
8
9
  },
@@ -16,13 +17,19 @@
16
17
  "type": "git",
17
18
  "url": "https://github.com/visgl/deck.gl.git"
18
19
  },
19
- "main": "dist/es5/index.js",
20
- "module": "dist/esm/index.js",
21
- "types": "typed/index.d.ts",
20
+ "types": "dist/index.d.ts",
21
+ "main": "dist/index.cjs",
22
+ "module": "dist/index.js",
23
+ "exports": {
24
+ ".": {
25
+ "types": "./dist/index.d.ts",
26
+ "import": "./dist/index.js",
27
+ "require": "./dist/index.cjs"
28
+ }
29
+ },
22
30
  "files": [
23
31
  "dist",
24
32
  "src",
25
- "typed",
26
33
  "dist.min.js"
27
34
  ],
28
35
  "sideEffects": false,
@@ -31,18 +38,16 @@
31
38
  "prepublishOnly": "npm run build-bundle && npm run build-bundle -- --env=dev"
32
39
  },
33
40
  "dependencies": {
34
- "@babel/runtime": "^7.0.0",
35
- "@luma.gl/constants": "9.0.0-alpha.53",
36
- "@luma.gl/core": "9.0.0-alpha.53",
37
- "@luma.gl/shadertools": "9.0.0-alpha.53",
41
+ "@luma.gl/constants": "^9.0.4",
42
+ "@luma.gl/shadertools": "^9.0.4",
38
43
  "@math.gl/web-mercator": "^4.0.0",
39
44
  "d3-hexbin": "^0.2.1"
40
45
  },
41
46
  "peerDependencies": {
42
- "@deck.gl/core": "^9.0.0-alpha",
43
- "@deck.gl/layers": "^9.0.0-alpha",
44
- "@luma.gl/core": "9.0.0-alpha.53",
45
- "@luma.gl/engine": "9.0.0-alpha.53"
47
+ "@deck.gl/core": "^9.0.0-beta",
48
+ "@deck.gl/layers": "^9.0.0-beta",
49
+ "@luma.gl/core": "^9.0.4",
50
+ "@luma.gl/engine": "^9.0.4"
46
51
  },
47
- "gitHead": "de061268077ab74e163792162efbc07be95d10f5"
52
+ "gitHead": "6c44f602069374cd21268ff279c5bf818c905ff7"
48
53
  }
@@ -87,7 +87,9 @@ export default abstract class AggregationLayer<
87
87
  const moduleSettings = Object.assign(Object.create(this.props), {
88
88
  viewport,
89
89
  mousePosition,
90
- pickingActive: 0,
90
+ picking: {
91
+ isActive: 0
92
+ },
91
93
  // @ts-expect-error TODO - assuming WebGL context
92
94
  devicePixelRatio: device.canvasContext.cssToDeviceRatio()
93
95
  });
@@ -18,14 +18,12 @@
18
18
  // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
19
  // THE SOFTWARE.
20
20
 
21
- import {GL} from '@luma.gl/constants';
22
21
  import {LineLayer, SolidPolygonLayer} from '@deck.gl/layers';
23
22
  import {generateContours} from './contour-utils';
24
23
  import {
25
24
  Accessor,
26
25
  AccessorFunction,
27
26
  Color,
28
- Layer,
29
27
  log,
30
28
  Position,
31
29
  UpdateParameters,
@@ -47,7 +45,7 @@ const defaultProps: DefaultProps<ContourLayerProps> = {
47
45
  cellSize: {type: 'number', min: 1, max: 1000, value: 1000},
48
46
  getPosition: {type: 'accessor', value: (x: any) => x.position},
49
47
  getWeight: {type: 'accessor', value: 1},
50
- gpuAggregation: true,
48
+ gpuAggregation: false, // TODO(v9): Re-enable GPU aggregation.
51
49
  aggregation: 'SUM',
52
50
 
53
51
  // contour lines
@@ -186,7 +184,7 @@ export default class ContourLayer<
186
184
  [POSITION_ATTRIBUTE_NAME]: {
187
185
  size: 3,
188
186
  accessor: 'getPosition',
189
- type: GL.DOUBLE,
187
+ type: 'float64',
190
188
  fp64: this.use64bitPositions()
191
189
  },
192
190
  // this attribute is used in gpu aggregation path only
@@ -351,7 +349,8 @@ export default class ContourLayer<
351
349
  const {count} = this.state.weights;
352
350
  let {aggregationData} = count;
353
351
  if (!aggregationData) {
354
- aggregationData = count.aggregationBuffer!.getData() as Float32Array;
352
+ // @ts-ignore
353
+ aggregationData = count.aggregationBuffer!.readSyncWebGL() as Float32Array;
355
354
  count.aggregationData = aggregationData;
356
355
  }
357
356
 
@@ -18,7 +18,6 @@
18
18
  // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
19
  // THE SOFTWARE.
20
20
 
21
- import {GL} from '@luma.gl/constants';
22
21
  import {GridCellLayer} from '@deck.gl/layers';
23
22
  import {Accessor, AccessorFunction, Color, Position, Material, DefaultProps} from '@deck.gl/core';
24
23
 
@@ -261,7 +260,7 @@ export default class CPUGridLayer<
261
260
  };
262
261
  const attributeManager = this.getAttributeManager()!;
263
262
  attributeManager.add({
264
- positions: {size: 3, type: GL.DOUBLE, accessor: 'getPosition'}
263
+ positions: {size: 3, type: 'float64', accessor: 'getPosition'}
265
264
  });
266
265
  // color and elevation attributes can't be added as attributes
267
266
  // they are calcualted using 'getValue' accessor that takes an array of pints.
@@ -192,7 +192,7 @@ export default class GPUGridCellLayer extends Layer<_GPUGridCellLayerProps> {
192
192
  // @ts-expect-error TODO v9 This code is not portable to WebGPU
193
193
  const programHandle = model.pipeline.handle;
194
194
 
195
- const gl = this.context.gl as WebGL2RenderingContext;
195
+ const gl = this.context.gl;
196
196
  const colorIndex = gl.getUniformBlockIndex(programHandle, 'ColorData');
197
197
  const elevationIndex = gl.getUniformBlockIndex(programHandle, 'ElevationData');
198
198
  gl.uniformBlockBinding(programHandle, colorIndex, COLOR_DATA_UBO_INDEX);
@@ -167,7 +167,7 @@ export type _GPUGridLayerProps<DataT> = {
167
167
  getElevationWeight?: Accessor<DataT, number>;
168
168
  };
169
169
 
170
- /** Aggregate data into a grid-based heatmap. Aggregation is performed on GPU (WebGL2 only). */
170
+ /** Aggregate data into a grid-based heatmap. Aggregation is performed on GPU. */
171
171
  export default class GPUGridLayer<
172
172
  DataT = any,
173
173
  ExtraPropsT extends {} = {}
@@ -189,7 +189,7 @@ export default class GPUGridLayer<
189
189
  dimensions: DIMENSIONS
190
190
  });
191
191
  this.setState({
192
- gpuAggregation: true,
192
+ gpuAggregation: false, // TODO(v9): Re-enable GPU aggregation.
193
193
  projectPoints: false, // aggregation in world space
194
194
  isSupported,
195
195
  weights: {
@@ -221,7 +221,7 @@ export default class GPUGridLayer<
221
221
  [POSITION_ATTRIBUTE_NAME]: {
222
222
  size: 3,
223
223
  accessor: 'getPosition',
224
- type: GL.DOUBLE,
224
+ type: 'float64',
225
225
  fp64: this.use64bitPositions()
226
226
  },
227
227
  color: {size: 3, accessor: 'getColorWeight'},
@@ -47,13 +47,15 @@ export default class GridLayer<DataT = any, ExtraPropsT extends {} = {}> extends
47
47
 
48
48
  initializeState() {
49
49
  this.state = {
50
- useGPUAggregation: true
50
+ useGPUAggregation: false // TODO(v9): Re-enable GPU aggregation.
51
51
  };
52
52
  }
53
53
 
54
54
  updateState({props}: UpdateParameters<this>) {
55
55
  this.setState({
56
- useGPUAggregation: this.canUseGPUAggregation(props)
56
+ // TODO(v9): Re-enable GPU aggregation.
57
+ // useGPUAggregation: this.canUseGPUAggregation(props)
58
+ useGPUAggregation: false
57
59
  });
58
60
  }
59
61
 
@@ -1,6 +1,3 @@
1
- import {Device} from '@luma.gl/core';
2
- import {GL} from '@luma.gl/constants';
3
-
4
1
  export function getBounds(points: number[][]): number[] {
5
2
  // Now build bounding box in world space (aligned to world coordiante system)
6
3
  const x = points.map(p => p[0]);
@@ -77,23 +74,3 @@ export function getTextureCoordinates(point: number[], bounds: number[]) {
77
74
  const [xMin, yMin, xMax, yMax] = bounds;
78
75
  return [(point[0] - xMin) / (xMax - xMin), (point[1] - yMin) / (yMax - yMin)];
79
76
  }
80
-
81
- // Returns format and type for creating texture objects
82
- export function getTextureParams({
83
- device,
84
- floatTargetSupport
85
- }: {
86
- device: Device;
87
- floatTargetSupport?: boolean;
88
- }) {
89
- return floatTargetSupport
90
- ? {
91
- // format: should be RGBA32F on WebGL2 (float textures), RGBA in WebGL1 for float or non float textures
92
- format: device.info.type === 'webgl2' ? GL.RGBA32F : GL.RGBA,
93
- type: GL.FLOAT
94
- }
95
- : {
96
- format: GL.RGBA,
97
- type: GL.UNSIGNED_BYTE
98
- };
99
- }
@@ -24,13 +24,10 @@ import {
24
24
  boundsContain,
25
25
  packVertices,
26
26
  scaleToAspectRatio,
27
- getTextureCoordinates,
28
- getTextureParams
27
+ getTextureCoordinates
29
28
  } from './heatmap-layer-utils';
30
29
  import {Buffer, DeviceFeature, Texture, TextureProps, TextureFormat} from '@luma.gl/core';
31
- import {GL} from '@luma.gl/constants';
32
30
  import {TextureTransform, TextureTransformProps} from '@luma.gl/engine';
33
- import {withGLParameters} from '@luma.gl/webgl';
34
31
  import {
35
32
  Accessor,
36
33
  AccessorFunction,
@@ -51,16 +48,16 @@ import AggregationLayer, {AggregationLayerProps} from '../aggregation-layer';
51
48
  import {defaultColorRange, colorRangeToFlatArray} from '../utils/color-utils';
52
49
  import weightsVs from './weights-vs.glsl';
53
50
  import weightsFs from './weights-fs.glsl';
54
- import vsMax from './max-vs.glsl';
55
- import fsMax from './max-fs.glsl';
51
+ import maxVs from './max-vs.glsl';
52
+ import maxFs from './max-fs.glsl';
56
53
 
57
54
  const RESOLUTION = 2; // (number of common space pixels) / (number texels)
58
55
  const TEXTURE_PROPS: TextureProps = {
59
56
  format: 'rgba8unorm',
60
57
  mipmaps: false,
61
58
  sampler: {
62
- minFilter: 'nearest',
63
- magFilter: 'nearest',
59
+ minFilter: 'linear',
60
+ magFilter: 'linear',
64
61
  addressModeU: 'clamp-to-edge',
65
62
  addressModeV: 'clamp-to-edge'
66
63
  }
@@ -85,14 +82,9 @@ const defaultProps: DefaultProps<HeatmapLayerProps> = {
85
82
  debounceTimeout: {type: 'number', min: 0, max: 1000, value: 500}
86
83
  };
87
84
 
88
- const REQUIRED_FEATURES: DeviceFeature[] = [
89
- 'blend-minmax-webgl1', // max weight calculation
90
- 'texture-formats-float32-webgl1' // weight-map as texture
91
- ];
92
-
93
85
  const FLOAT_TARGET_FEATURES: DeviceFeature[] = [
94
- 'texture-renderable-float32-webgl', // ability to render to float texture
95
- 'texture-blend-float-webgl1' // ability to blend when rendering to float texture
86
+ 'float32-renderable-webgl', // ability to render to float texture
87
+ 'texture-blend-float-webgl' // ability to blend when rendering to float texture
96
88
  ];
97
89
 
98
90
  const DIMENSIONS = {
@@ -189,7 +181,6 @@ export default class HeatmapLayer<
189
181
  static defaultProps = defaultProps;
190
182
 
191
183
  state!: AggregationLayer<DataT>['state'] & {
192
- supported: boolean;
193
184
  colorDomain?: number[];
194
185
  isWeightMapDirty?: boolean;
195
186
  weightsTexture?: Texture;
@@ -205,20 +196,14 @@ export default class HeatmapLayer<
205
196
  maxWeightTransform?: TextureTransform;
206
197
  textureSize: number;
207
198
  format: TextureFormat;
208
- type: GL;
209
199
  weightsScale: number;
210
200
  visibleWorldBounds: number[];
211
201
  viewportCorners: number[][];
212
202
  };
213
203
 
214
204
  initializeState() {
215
- if (!REQUIRED_FEATURES.every(feature => this.context.device.features.has(feature))) {
216
- this.setState({supported: false});
217
- log.error(`HeatmapLayer: ${this.id} is not supported on this browser`)();
218
- return;
219
- }
220
205
  super.initializeAggregationLayer(DIMENSIONS);
221
- this.setState({supported: true, colorDomain: DEFAULT_COLOR_DOMAIN});
206
+ this.setState({colorDomain: DEFAULT_COLOR_DOMAIN});
222
207
  this._setupTextureParams();
223
208
  this._setupAttributes();
224
209
  this._setupResources();
@@ -231,9 +216,6 @@ export default class HeatmapLayer<
231
216
 
232
217
  /* eslint-disable max-statements,complexity */
233
218
  updateState(opts: UpdateParameters<this>) {
234
- if (!this.state.supported) {
235
- return;
236
- }
237
219
  super.updateState(opts);
238
220
  this._updateHeatmapState(opts);
239
221
  }
@@ -269,9 +251,6 @@ export default class HeatmapLayer<
269
251
  }
270
252
 
271
253
  renderLayers(): LayersList | Layer {
272
- if (!this.state.supported) {
273
- return [];
274
- }
275
254
  const {
276
255
  weightsTexture,
277
256
  triPositionBuffer,
@@ -303,7 +282,7 @@ export default class HeatmapLayer<
303
282
  maxTexture: maxWeightsTexture,
304
283
  colorTexture,
305
284
  aggregationMode: AGGREGATION_MODE[aggregation] || 0,
306
- texture: weightsTexture,
285
+ weightsTexture,
307
286
  intensity,
308
287
  threshold,
309
288
  colorDomain
@@ -369,24 +348,28 @@ export default class HeatmapLayer<
369
348
  }
370
349
 
371
350
  _createTextures() {
372
- const {textureSize, format, type} = this.state;
351
+ const {textureSize, format} = this.state;
373
352
 
374
353
  this.setState({
375
354
  weightsTexture: this.context.device.createTexture({
355
+ ...TEXTURE_PROPS,
376
356
  width: textureSize,
377
357
  height: textureSize,
378
- format,
379
- type,
380
- ...TEXTURE_PROPS
358
+ format
381
359
  }),
382
- maxWeightsTexture: this.context.device.createTexture({format, type, ...TEXTURE_PROPS}) // 1 X 1 texture,
360
+ maxWeightsTexture: this.context.device.createTexture({
361
+ ...TEXTURE_PROPS,
362
+ width: 1,
363
+ height: 1,
364
+ format
365
+ })
383
366
  });
384
367
  }
385
368
 
386
369
  _setupAttributes() {
387
370
  const attributeManager = this.getAttributeManager()!;
388
371
  attributeManager.add({
389
- positions: {size: 3, type: GL.DOUBLE, accessor: 'getPosition'},
372
+ positions: {size: 3, type: 'float64', accessor: 'getPosition'},
390
373
  weights: {size: 1, accessor: 'getWeight'}
391
374
  });
392
375
  this.setState({positionAttributeName: 'positions'});
@@ -396,63 +379,73 @@ export default class HeatmapLayer<
396
379
  const {device} = this.context;
397
380
  const {weightsTextureSize} = this.props;
398
381
 
399
- const textureSize = Math.min(weightsTextureSize, device.limits.maxTextureDimension2D as number);
382
+ const textureSize = Math.min(weightsTextureSize, device.limits.maxTextureDimension2D);
400
383
  const floatTargetSupport = FLOAT_TARGET_FEATURES.every(feature => device.features.has(feature));
401
- const {format, type} = getTextureParams({device, floatTargetSupport});
384
+ const format: TextureFormat = floatTargetSupport ? 'rgba32float' : 'rgba8unorm';
402
385
  const weightsScale = floatTargetSupport ? 1 : 1 / 255;
403
- this.setState({textureSize, format, type, weightsScale});
386
+ this.setState({textureSize, format, weightsScale});
404
387
  if (!floatTargetSupport) {
405
388
  log.warn(
406
- `HeatmapLayer: ${this.id} rendering to float texture not supported, fallingback to low precession format`
389
+ `HeatmapLayer: ${this.id} rendering to float texture not supported, falling back to low precision format`
407
390
  )();
408
391
  }
409
392
  }
410
393
 
411
- getShaders(type) {
412
- return super.getShaders(
413
- type === 'max-weights-transform'
414
- ? {
415
- vs: vsMax,
416
- _fs: fsMax
417
- }
418
- : {
419
- vs: weightsVs,
420
- _fs: weightsFs
421
- }
422
- );
423
- }
424
-
425
- _createWeightsTransform(shaders = {}) {
394
+ _createWeightsTransform(shaders: {vs: string; fs?: string}) {
426
395
  let {weightsTransform} = this.state;
427
- weightsTransform?.delete();
396
+ const {weightsTexture} = this.state;
397
+ const attributeManager = this.getAttributeManager()!;
428
398
 
399
+ weightsTransform?.destroy();
429
400
  weightsTransform = new TextureTransform(this.context.device, {
430
401
  id: `${this.id}-weights-transform`,
402
+ bufferLayout: attributeManager.getBufferLayouts(),
431
403
  vertexCount: 1,
432
- targetTexture: this.state.weightsTexture!,
433
- targetTextureVarying: 'weightsTexture',
404
+ targetTexture: weightsTexture!,
405
+ parameters: {
406
+ depthWriteEnabled: false,
407
+ blendColorOperation: 'add',
408
+ blendColorSrcFactor: 'one',
409
+ blendColorDstFactor: 'one',
410
+ blendAlphaSrcFactor: 'one',
411
+ blendAlphaDstFactor: 'one'
412
+ },
413
+ topology: 'point-list',
434
414
  ...shaders
435
415
  } as TextureTransformProps);
416
+
436
417
  this.setState({weightsTransform});
437
418
  }
438
419
 
439
420
  _setupResources() {
440
421
  this._createTextures();
422
+ const {device} = this.context;
441
423
  const {textureSize, weightsTexture, maxWeightsTexture} = this.state;
442
424
 
443
- const weightsTransformShaders = this.getShaders('weights-transform');
425
+ const weightsTransformShaders = this.getShaders({
426
+ vs: weightsVs,
427
+ fs: weightsFs
428
+ });
444
429
  this._createWeightsTransform(weightsTransformShaders);
445
430
 
446
- const maxWeightsTransformShaders = this.getShaders('max-weights-transform');
447
- const maxWeightTransform = new TextureTransform(this.context.device, {
431
+ const maxWeightsTransformShaders = this.getShaders({vs: maxVs, fs: maxFs});
432
+ const maxWeightTransform = new TextureTransform(device, {
448
433
  id: `${this.id}-max-weights-transform`,
449
- _sourceTextures: {
450
- inTexture: weightsTexture
451
- },
452
- _targetTexture: maxWeightsTexture,
453
- _targetTextureVarying: 'outTexture',
434
+ bindings: {inTexture: weightsTexture},
435
+ uniforms: {textureSize},
436
+ targetTexture: maxWeightsTexture,
454
437
  ...maxWeightsTransformShaders,
455
- elementCount: textureSize * textureSize
438
+ vertexCount: textureSize * textureSize,
439
+ topology: 'point-list',
440
+ parameters: {
441
+ depthWriteEnabled: false,
442
+ blendColorOperation: 'max',
443
+ blendAlphaOperation: 'max',
444
+ blendColorSrcFactor: 'one',
445
+ blendColorDstFactor: 'one',
446
+ blendAlphaSrcFactor: 'one',
447
+ blendAlphaDstFactor: 'one'
448
+ }
456
449
  });
457
450
 
458
451
  this.setState({
@@ -460,35 +453,27 @@ export default class HeatmapLayer<
460
453
  maxWeightsTexture,
461
454
  maxWeightTransform,
462
455
  zoom: null,
463
- triPositionBuffer: this.context.device.createBuffer({
464
- byteLength: 48,
465
- // @ts-expect-error
466
- accessor: {size: 3}
467
- }),
468
- triTexCoordBuffer: this.context.device.createBuffer({
469
- byteLength: 48,
470
- // @ts-expect-error
471
- accessor: {size: 2}
472
- })
456
+ triPositionBuffer: device.createBuffer({byteLength: 48}),
457
+ triTexCoordBuffer: device.createBuffer({byteLength: 48})
473
458
  });
474
459
  }
475
460
 
476
461
  // overwrite super class method to update transform model
477
462
  updateShaders(shaderOptions) {
478
- // sahder params (modules, injects) changed, update model object
479
- this._createWeightsTransform(shaderOptions);
463
+ // shader params (modules, injects) changed, update model object
464
+ this._createWeightsTransform({
465
+ vs: weightsVs,
466
+ fs: weightsFs,
467
+ ...shaderOptions
468
+ });
480
469
  }
481
470
 
482
471
  _updateMaxWeightValue() {
483
- const {maxWeightTransform} = this.state;
472
+ const {maxWeightTransform, textureSize} = this.state;
473
+
484
474
  maxWeightTransform!.run({
485
- parameters: {
486
- // @ts-expect-error TODO(v9): Resolve errors.
487
- blend: true,
488
- depthTest: false,
489
- blendFunc: [GL.ONE, GL.ONE],
490
- blendEquation: GL.MAX
491
- }
475
+ parameters: {viewport: [0, 0, 1, 1]},
476
+ clearColor: [0, 0, 0, 0]
492
477
  });
493
478
  }
494
479
 
@@ -563,18 +548,16 @@ export default class HeatmapLayer<
563
548
  let {colorTexture} = this.state;
564
549
  const colors = colorRangeToFlatArray(colorRange, false, Uint8Array as any);
565
550
 
566
- if (colorTexture) {
567
- // @ts-expect-error TODO - no longer supported in v9?
568
- colorTexture.setImageData({
569
- data: colors,
570
- width: colorRange.length
571
- });
551
+ if (colorTexture && colorTexture?.width === colorRange.length) {
552
+ // TODO(v9): Unclear whether `setSubImageData` is a public API, or what to use if not.
553
+ (colorTexture as any).setSubImageData({data: colors});
572
554
  } else {
555
+ colorTexture?.destroy();
573
556
  colorTexture = this.context.device.createTexture({
557
+ ...TEXTURE_PROPS,
574
558
  data: colors,
575
559
  width: colorRange.length,
576
- height: 1,
577
- ...TEXTURE_PROPS
560
+ height: 1
578
561
  });
579
562
  }
580
563
  this.setState({colorTexture});
@@ -602,41 +585,22 @@ export default class HeatmapLayer<
602
585
  this.state.colorDomain = colorDomain || DEFAULT_COLOR_DOMAIN;
603
586
  }
604
587
 
605
- const uniforms = {
606
- radiusPixels,
607
- commonBounds,
608
- textureWidth: textureSize,
609
- weightsScale
610
- };
611
- // Attribute manager sets data array count as instaceCount on model
612
- // we need to set that as elementCount on 'weightsTransform'
613
- weightsTransform.update({
614
- elementCount: this.getNumInstances()
615
- });
616
- // Need to explictly specify clearColor as external context may have modified it
617
- withGLParameters(this.context.gl, {clearColor: [0, 0, 0, 0]}, () => {
618
- weightsTransform.run({
619
- uniforms,
620
- parameters: {
621
- // @ts-expect-error TODO(v9): Resolve errors.
622
- blend: true,
623
- depthTest: false,
624
- blendFunc: [GL.ONE, GL.ONE],
625
- blendEquation: GL.FUNC_ADD
626
- },
627
- clearRenderTarget: true,
628
- attributes: this.getAttributes(),
629
- moduleSettings: this.getModuleSettings()
630
- });
588
+ const attributeManager = this.getAttributeManager()!;
589
+ const attributes = attributeManager.getAttributes();
590
+ const moduleSettings = this.getModuleSettings();
591
+ const positions = attributes.positions.buffer;
592
+ const uniforms = {radiusPixels, commonBounds, textureWidth: textureSize, weightsScale};
593
+ const weights = attributes.weights.buffer;
594
+ weightsTransform.model.setAttributes({positions, weights});
595
+ weightsTransform.model.setVertexCount(this.getNumInstances());
596
+ weightsTransform.model.setUniforms(uniforms);
597
+ weightsTransform.model.updateModuleSettings(moduleSettings);
598
+ weightsTransform.run({
599
+ parameters: {viewport: [0, 0, textureSize, textureSize]},
600
+ clearColor: [0, 0, 0, 0]
631
601
  });
632
- this._updateMaxWeightValue();
633
602
 
634
- // reset filtering parameters (TODO: remove once luma issue#1193 is fixed)
635
- // TODO v9 sampler support in luma.gl needs to improve
636
- // weightsTexture.setSampler({
637
- // magFilter: 'linear',
638
- // minFilter: 'linear'
639
- // });
603
+ this._updateMaxWeightValue();
640
604
  }
641
605
 
642
606
  _debouncedUpdateWeightmap(fromTimer = false) {
@@ -1,13 +1,19 @@
1
1
  export default `\
2
2
  #version 300 es
3
- in vec4 inTexture;
3
+ uniform sampler2D inTexture;
4
+ uniform float textureSize;
4
5
  out vec4 outTexture;
5
6
 
6
7
  void main()
7
8
  {
8
- outTexture = inTexture;
9
- gl_Position = vec4(0, 0, 0, 1.);
10
- // Enforce default value for ANGLE issue (https://bugs.chromium.org/p/angleproject/issues/detail?id=3941)
11
- gl_PointSize = 1.0;
9
+ // Sample every pixel in texture
10
+ int yIndex = gl_VertexID / int(textureSize);
11
+ int xIndex = gl_VertexID - (yIndex * int(textureSize));
12
+ vec2 uv = (0.5 + vec2(float(xIndex), float(yIndex))) / textureSize;
13
+ outTexture = texture(inTexture, uv);
14
+
15
+ gl_Position = vec4(0.0, 0.0, 0.0, 1.0);
16
+ // Enforce default value for ANGLE issue (https://bugs.chromium.org/p/angleproject/issues/detail?id=3941)
17
+ gl_PointSize = 1.0;
12
18
  }
13
19
  `;
@@ -25,7 +25,7 @@ export default `\
25
25
  precision highp float;
26
26
 
27
27
  uniform float opacity;
28
- uniform sampler2D texture;
28
+ uniform sampler2D weightsTexture;
29
29
  uniform sampler2D colorTexture;
30
30
  uniform float aggregationMode;
31
31
 
@@ -43,7 +43,7 @@ vec4 getLinearColor(float value) {
43
43
  }
44
44
 
45
45
  void main(void) {
46
- vec4 weights = texture(texture, vTexCoords);
46
+ vec4 weights = texture(weightsTexture, vTexCoords);
47
47
  float weight = weights.r;
48
48
 
49
49
  if (aggregationMode > 0.5) {