@deck.gl/aggregation-layers 9.0.0-beta.2 → 9.0.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 (323) hide show
  1. package/dist/aggregation-layer.js +153 -0
  2. package/dist/contour-layer/contour-layer.js +241 -0
  3. package/dist/contour-layer/contour-utils.js +64 -0
  4. package/dist/contour-layer/marching-squares-codes.js +337 -0
  5. package/dist/contour-layer/marching-squares.js +147 -0
  6. package/dist/cpu-grid-layer/cpu-grid-layer.js +130 -0
  7. package/dist/cpu-grid-layer/grid-aggregator.js +141 -0
  8. package/dist/dist.dev.js +1296 -13614
  9. package/dist/gpu-grid-layer/gpu-grid-cell-layer-fragment.glsl.js +34 -0
  10. package/dist/{esm/gpu-grid-layer → gpu-grid-layer}/gpu-grid-cell-layer-vertex.glsl.js +20 -1
  11. package/dist/gpu-grid-layer/gpu-grid-cell-layer.js +145 -0
  12. package/dist/gpu-grid-layer/gpu-grid-layer.js +288 -0
  13. package/dist/grid-aggregation-layer.js +172 -0
  14. package/dist/grid-layer/grid-layer.js +63 -0
  15. package/dist/heatmap-layer/heatmap-layer-utils.js +63 -0
  16. package/dist/heatmap-layer/heatmap-layer.js +471 -0
  17. package/dist/{esm/heatmap-layer → heatmap-layer}/max-fs.glsl.js +0 -1
  18. package/dist/{esm/heatmap-layer → heatmap-layer}/max-vs.glsl.js +0 -1
  19. package/dist/heatmap-layer/triangle-layer-fragment.glsl.js +61 -0
  20. package/dist/heatmap-layer/triangle-layer-vertex.glsl.js +52 -0
  21. package/dist/heatmap-layer/triangle-layer.js +59 -0
  22. package/dist/{esm/heatmap-layer → heatmap-layer}/weights-fs.glsl.js +0 -1
  23. package/dist/{esm/heatmap-layer → heatmap-layer}/weights-vs.glsl.js +0 -1
  24. package/dist/hexagon-layer/hexagon-aggregator.js +112 -0
  25. package/dist/hexagon-layer/hexagon-layer.js +174 -0
  26. package/dist/index.cjs +4494 -0
  27. package/dist/index.cjs.map +7 -0
  28. package/dist/index.js +32 -0
  29. package/dist/screen-grid-layer/screen-grid-cell-layer.js +166 -0
  30. package/dist/screen-grid-layer/screen-grid-layer-fragment.glsl.js +40 -0
  31. package/dist/{esm/screen-grid-layer → screen-grid-layer}/screen-grid-layer-vertex.glsl.js +19 -1
  32. package/dist/screen-grid-layer/screen-grid-layer.js +216 -0
  33. package/dist/types.js +1 -0
  34. package/dist/utils/aggregation-operation-utils.js +94 -0
  35. package/dist/utils/bin-sorter.js +167 -0
  36. package/dist/utils/color-utils.js +53 -0
  37. package/dist/utils/cpu-aggregator.js +421 -0
  38. package/dist/utils/gpu-grid-aggregation/aggregate-all-fs.glsl.js +39 -0
  39. package/dist/utils/gpu-grid-aggregation/aggregate-all-vs.glsl.js +53 -0
  40. package/dist/utils/gpu-grid-aggregation/aggregate-to-grid-fs.glsl.js +34 -0
  41. package/dist/{esm/utils → utils}/gpu-grid-aggregation/aggregate-to-grid-vs.glsl.js +19 -1
  42. package/dist/utils/gpu-grid-aggregation/gpu-grid-aggregator-constants.js +41 -0
  43. package/dist/utils/gpu-grid-aggregation/gpu-grid-aggregator-utils.js +1 -0
  44. package/{typed → dist}/utils/gpu-grid-aggregation/gpu-grid-aggregator.d.ts.map +1 -1
  45. package/dist/utils/gpu-grid-aggregation/gpu-grid-aggregator.js +566 -0
  46. package/dist/utils/gpu-grid-aggregation/transform-mean-vs.glsl.js +37 -0
  47. package/dist/utils/grid-aggregation-utils.js +114 -0
  48. package/dist/utils/prop-utils.js +28 -0
  49. package/dist/utils/resource-utils.js +38 -0
  50. package/dist/utils/scale-utils.js +184 -0
  51. package/dist.min.js +60 -174
  52. package/package.json +18 -11
  53. package/src/utils/gpu-grid-aggregation/gpu-grid-aggregator.ts +10 -13
  54. package/dist/es5/aggregation-layer.js +0 -215
  55. package/dist/es5/aggregation-layer.js.map +0 -1
  56. package/dist/es5/contour-layer/contour-layer.js +0 -353
  57. package/dist/es5/contour-layer/contour-layer.js.map +0 -1
  58. package/dist/es5/contour-layer/contour-utils.js +0 -110
  59. package/dist/es5/contour-layer/contour-utils.js.map +0 -1
  60. package/dist/es5/contour-layer/marching-squares-codes.js +0 -152
  61. package/dist/es5/contour-layer/marching-squares-codes.js.map +0 -1
  62. package/dist/es5/contour-layer/marching-squares.js +0 -168
  63. package/dist/es5/contour-layer/marching-squares.js.map +0 -1
  64. package/dist/es5/cpu-grid-layer/cpu-grid-layer.js +0 -235
  65. package/dist/es5/cpu-grid-layer/cpu-grid-layer.js.map +0 -1
  66. package/dist/es5/cpu-grid-layer/grid-aggregator.js +0 -180
  67. package/dist/es5/cpu-grid-layer/grid-aggregator.js.map +0 -1
  68. package/dist/es5/gpu-grid-layer/gpu-grid-cell-layer-fragment.glsl.js +0 -9
  69. package/dist/es5/gpu-grid-layer/gpu-grid-cell-layer-fragment.glsl.js.map +0 -1
  70. package/dist/es5/gpu-grid-layer/gpu-grid-cell-layer-vertex.glsl.js +0 -9
  71. package/dist/es5/gpu-grid-layer/gpu-grid-cell-layer-vertex.glsl.js.map +0 -1
  72. package/dist/es5/gpu-grid-layer/gpu-grid-cell-layer.js +0 -247
  73. package/dist/es5/gpu-grid-layer/gpu-grid-cell-layer.js.map +0 -1
  74. package/dist/es5/gpu-grid-layer/gpu-grid-layer.js +0 -424
  75. package/dist/es5/gpu-grid-layer/gpu-grid-layer.js.map +0 -1
  76. package/dist/es5/grid-aggregation-layer.js +0 -280
  77. package/dist/es5/grid-aggregation-layer.js.map +0 -1
  78. package/dist/es5/grid-layer/grid-layer.js +0 -125
  79. package/dist/es5/grid-layer/grid-layer.js.map +0 -1
  80. package/dist/es5/heatmap-layer/heatmap-layer-utils.js +0 -107
  81. package/dist/es5/heatmap-layer/heatmap-layer-utils.js.map +0 -1
  82. package/dist/es5/heatmap-layer/heatmap-layer.js +0 -678
  83. package/dist/es5/heatmap-layer/heatmap-layer.js.map +0 -1
  84. package/dist/es5/heatmap-layer/max-fs.glsl.js +0 -9
  85. package/dist/es5/heatmap-layer/max-fs.glsl.js.map +0 -1
  86. package/dist/es5/heatmap-layer/max-vs.glsl.js +0 -9
  87. package/dist/es5/heatmap-layer/max-vs.glsl.js.map +0 -1
  88. package/dist/es5/heatmap-layer/triangle-layer-fragment.glsl.js +0 -9
  89. package/dist/es5/heatmap-layer/triangle-layer-fragment.glsl.js.map +0 -1
  90. package/dist/es5/heatmap-layer/triangle-layer-vertex.glsl.js +0 -9
  91. package/dist/es5/heatmap-layer/triangle-layer-vertex.glsl.js.map +0 -1
  92. package/dist/es5/heatmap-layer/triangle-layer.js +0 -121
  93. package/dist/es5/heatmap-layer/triangle-layer.js.map +0 -1
  94. package/dist/es5/heatmap-layer/weights-fs.glsl.js +0 -9
  95. package/dist/es5/heatmap-layer/weights-fs.glsl.js.map +0 -1
  96. package/dist/es5/heatmap-layer/weights-vs.glsl.js +0 -9
  97. package/dist/es5/heatmap-layer/weights-vs.glsl.js.map +0 -1
  98. package/dist/es5/hexagon-layer/hexagon-aggregator.js +0 -118
  99. package/dist/es5/hexagon-layer/hexagon-aggregator.js.map +0 -1
  100. package/dist/es5/hexagon-layer/hexagon-layer.js +0 -289
  101. package/dist/es5/hexagon-layer/hexagon-layer.js.map +0 -1
  102. package/dist/es5/index.js +0 -104
  103. package/dist/es5/index.js.map +0 -1
  104. package/dist/es5/screen-grid-layer/screen-grid-cell-layer.js +0 -244
  105. package/dist/es5/screen-grid-layer/screen-grid-cell-layer.js.map +0 -1
  106. package/dist/es5/screen-grid-layer/screen-grid-layer-fragment.glsl.js +0 -9
  107. package/dist/es5/screen-grid-layer/screen-grid-layer-fragment.glsl.js.map +0 -1
  108. package/dist/es5/screen-grid-layer/screen-grid-layer-vertex.glsl.js +0 -9
  109. package/dist/es5/screen-grid-layer/screen-grid-layer-vertex.glsl.js.map +0 -1
  110. package/dist/es5/screen-grid-layer/screen-grid-layer.js +0 -317
  111. package/dist/es5/screen-grid-layer/screen-grid-layer.js.map +0 -1
  112. package/dist/es5/types.js +0 -2
  113. package/dist/es5/types.js.map +0 -1
  114. package/dist/es5/utils/aggregation-operation-utils.js +0 -123
  115. package/dist/es5/utils/aggregation-operation-utils.js.map +0 -1
  116. package/dist/es5/utils/bin-sorter.js +0 -248
  117. package/dist/es5/utils/bin-sorter.js.map +0 -1
  118. package/dist/es5/utils/color-utils.js +0 -39
  119. package/dist/es5/utils/color-utils.js.map +0 -1
  120. package/dist/es5/utils/cpu-aggregator.js +0 -496
  121. package/dist/es5/utils/cpu-aggregator.js.map +0 -1
  122. package/dist/es5/utils/gpu-grid-aggregation/aggregate-all-fs.glsl.js +0 -9
  123. package/dist/es5/utils/gpu-grid-aggregation/aggregate-all-fs.glsl.js.map +0 -1
  124. package/dist/es5/utils/gpu-grid-aggregation/aggregate-all-vs.glsl.js +0 -9
  125. package/dist/es5/utils/gpu-grid-aggregation/aggregate-all-vs.glsl.js.map +0 -1
  126. package/dist/es5/utils/gpu-grid-aggregation/aggregate-to-grid-fs.glsl.js +0 -9
  127. package/dist/es5/utils/gpu-grid-aggregation/aggregate-to-grid-fs.glsl.js.map +0 -1
  128. package/dist/es5/utils/gpu-grid-aggregation/aggregate-to-grid-vs.glsl.js +0 -9
  129. package/dist/es5/utils/gpu-grid-aggregation/aggregate-to-grid-vs.glsl.js.map +0 -1
  130. package/dist/es5/utils/gpu-grid-aggregation/gpu-grid-aggregator-constants.js +0 -63
  131. package/dist/es5/utils/gpu-grid-aggregation/gpu-grid-aggregator-constants.js.map +0 -1
  132. package/dist/es5/utils/gpu-grid-aggregation/gpu-grid-aggregator-utils.js +0 -2
  133. package/dist/es5/utils/gpu-grid-aggregation/gpu-grid-aggregator-utils.js.map +0 -1
  134. package/dist/es5/utils/gpu-grid-aggregation/gpu-grid-aggregator.js +0 -732
  135. package/dist/es5/utils/gpu-grid-aggregation/gpu-grid-aggregator.js.map +0 -1
  136. package/dist/es5/utils/gpu-grid-aggregation/gpu-grid-aggregator.md +0 -155
  137. package/dist/es5/utils/gpu-grid-aggregation/transform-mean-vs.glsl.js +0 -9
  138. package/dist/es5/utils/gpu-grid-aggregation/transform-mean-vs.glsl.js.map +0 -1
  139. package/dist/es5/utils/grid-aggregation-utils.js +0 -118
  140. package/dist/es5/utils/grid-aggregation-utils.js.map +0 -1
  141. package/dist/es5/utils/prop-utils.js +0 -19
  142. package/dist/es5/utils/prop-utils.js.map +0 -1
  143. package/dist/es5/utils/resource-utils.js +0 -59
  144. package/dist/es5/utils/resource-utils.js.map +0 -1
  145. package/dist/es5/utils/scale-utils.js +0 -254
  146. package/dist/es5/utils/scale-utils.js.map +0 -1
  147. package/dist/esm/aggregation-layer.js +0 -156
  148. package/dist/esm/aggregation-layer.js.map +0 -1
  149. package/dist/esm/contour-layer/contour-layer.js +0 -316
  150. package/dist/esm/contour-layer/contour-layer.js.map +0 -1
  151. package/dist/esm/contour-layer/contour-utils.js +0 -81
  152. package/dist/esm/contour-layer/contour-utils.js.map +0 -1
  153. package/dist/esm/contour-layer/marching-squares-codes.js +0 -219
  154. package/dist/esm/contour-layer/marching-squares-codes.js.map +0 -1
  155. package/dist/esm/contour-layer/marching-squares.js +0 -151
  156. package/dist/esm/contour-layer/marching-squares.js.map +0 -1
  157. package/dist/esm/cpu-grid-layer/cpu-grid-layer.js +0 -186
  158. package/dist/esm/cpu-grid-layer/cpu-grid-layer.js.map +0 -1
  159. package/dist/esm/cpu-grid-layer/grid-aggregator.js +0 -142
  160. package/dist/esm/cpu-grid-layer/grid-aggregator.js.map +0 -1
  161. package/dist/esm/gpu-grid-layer/gpu-grid-cell-layer-fragment.glsl.js +0 -16
  162. package/dist/esm/gpu-grid-layer/gpu-grid-cell-layer-fragment.glsl.js.map +0 -1
  163. package/dist/esm/gpu-grid-layer/gpu-grid-cell-layer-vertex.glsl.js.map +0 -1
  164. package/dist/esm/gpu-grid-layer/gpu-grid-cell-layer.js +0 -196
  165. package/dist/esm/gpu-grid-layer/gpu-grid-cell-layer.js.map +0 -1
  166. package/dist/esm/gpu-grid-layer/gpu-grid-layer.js +0 -399
  167. package/dist/esm/gpu-grid-layer/gpu-grid-layer.js.map +0 -1
  168. package/dist/esm/grid-aggregation-layer.js +0 -240
  169. package/dist/esm/grid-aggregation-layer.js.map +0 -1
  170. package/dist/esm/grid-layer/grid-layer.js +0 -80
  171. package/dist/esm/grid-layer/grid-layer.js.map +0 -1
  172. package/dist/esm/heatmap-layer/heatmap-layer-utils.js +0 -55
  173. package/dist/esm/heatmap-layer/heatmap-layer-utils.js.map +0 -1
  174. package/dist/esm/heatmap-layer/heatmap-layer.js +0 -638
  175. package/dist/esm/heatmap-layer/heatmap-layer.js.map +0 -1
  176. package/dist/esm/heatmap-layer/max-fs.glsl.js.map +0 -1
  177. package/dist/esm/heatmap-layer/max-vs.glsl.js.map +0 -1
  178. package/dist/esm/heatmap-layer/triangle-layer-fragment.glsl.js +0 -43
  179. package/dist/esm/heatmap-layer/triangle-layer-fragment.glsl.js.map +0 -1
  180. package/dist/esm/heatmap-layer/triangle-layer-vertex.glsl.js +0 -33
  181. package/dist/esm/heatmap-layer/triangle-layer-vertex.glsl.js.map +0 -1
  182. package/dist/esm/heatmap-layer/triangle-layer.js +0 -78
  183. package/dist/esm/heatmap-layer/triangle-layer.js.map +0 -1
  184. package/dist/esm/heatmap-layer/weights-fs.glsl.js.map +0 -1
  185. package/dist/esm/heatmap-layer/weights-vs.glsl.js.map +0 -1
  186. package/dist/esm/hexagon-layer/hexagon-aggregator.js +0 -87
  187. package/dist/esm/hexagon-layer/hexagon-aggregator.js.map +0 -1
  188. package/dist/esm/hexagon-layer/hexagon-layer.js +0 -232
  189. package/dist/esm/hexagon-layer/hexagon-layer.js.map +0 -1
  190. package/dist/esm/index.js +0 -13
  191. package/dist/esm/index.js.map +0 -1
  192. package/dist/esm/screen-grid-layer/screen-grid-cell-layer.js +0 -203
  193. package/dist/esm/screen-grid-layer/screen-grid-cell-layer.js.map +0 -1
  194. package/dist/esm/screen-grid-layer/screen-grid-layer-fragment.glsl.js +0 -21
  195. package/dist/esm/screen-grid-layer/screen-grid-layer-fragment.glsl.js.map +0 -1
  196. package/dist/esm/screen-grid-layer/screen-grid-layer-vertex.glsl.js.map +0 -1
  197. package/dist/esm/screen-grid-layer/screen-grid-layer.js +0 -285
  198. package/dist/esm/screen-grid-layer/screen-grid-layer.js.map +0 -1
  199. package/dist/esm/types.js +0 -2
  200. package/dist/esm/types.js.map +0 -1
  201. package/dist/esm/utils/aggregation-operation-utils.js +0 -91
  202. package/dist/esm/utils/aggregation-operation-utils.js.map +0 -1
  203. package/dist/esm/utils/bin-sorter.js +0 -165
  204. package/dist/esm/utils/bin-sorter.js.map +0 -1
  205. package/dist/esm/utils/color-utils.js +0 -28
  206. package/dist/esm/utils/color-utils.js.map +0 -1
  207. package/dist/esm/utils/cpu-aggregator.js +0 -487
  208. package/dist/esm/utils/cpu-aggregator.js.map +0 -1
  209. package/dist/esm/utils/gpu-grid-aggregation/aggregate-all-fs.glsl.js +0 -21
  210. package/dist/esm/utils/gpu-grid-aggregation/aggregate-all-fs.glsl.js.map +0 -1
  211. package/dist/esm/utils/gpu-grid-aggregation/aggregate-all-vs.glsl.js +0 -35
  212. package/dist/esm/utils/gpu-grid-aggregation/aggregate-all-vs.glsl.js.map +0 -1
  213. package/dist/esm/utils/gpu-grid-aggregation/aggregate-to-grid-fs.glsl.js +0 -16
  214. package/dist/esm/utils/gpu-grid-aggregation/aggregate-to-grid-fs.glsl.js.map +0 -1
  215. package/dist/esm/utils/gpu-grid-aggregation/aggregate-to-grid-vs.glsl.js.map +0 -1
  216. package/dist/esm/utils/gpu-grid-aggregation/gpu-grid-aggregator-constants.js +0 -42
  217. package/dist/esm/utils/gpu-grid-aggregation/gpu-grid-aggregator-constants.js.map +0 -1
  218. package/dist/esm/utils/gpu-grid-aggregation/gpu-grid-aggregator-utils.js +0 -2
  219. package/dist/esm/utils/gpu-grid-aggregation/gpu-grid-aggregator-utils.js.map +0 -1
  220. package/dist/esm/utils/gpu-grid-aggregation/gpu-grid-aggregator.js +0 -720
  221. package/dist/esm/utils/gpu-grid-aggregation/gpu-grid-aggregator.js.map +0 -1
  222. package/dist/esm/utils/gpu-grid-aggregation/gpu-grid-aggregator.md +0 -155
  223. package/dist/esm/utils/gpu-grid-aggregation/transform-mean-vs.glsl.js +0 -19
  224. package/dist/esm/utils/gpu-grid-aggregation/transform-mean-vs.glsl.js.map +0 -1
  225. package/dist/esm/utils/grid-aggregation-utils.js +0 -109
  226. package/dist/esm/utils/grid-aggregation-utils.js.map +0 -1
  227. package/dist/esm/utils/prop-utils.js +0 -12
  228. package/dist/esm/utils/prop-utils.js.map +0 -1
  229. package/dist/esm/utils/resource-utils.js +0 -44
  230. package/dist/esm/utils/resource-utils.js.map +0 -1
  231. package/dist/esm/utils/scale-utils.js +0 -192
  232. package/dist/esm/utils/scale-utils.js.map +0 -1
  233. /package/{typed → dist}/aggregation-layer.d.ts +0 -0
  234. /package/{typed → dist}/aggregation-layer.d.ts.map +0 -0
  235. /package/{typed → dist}/contour-layer/contour-layer.d.ts +0 -0
  236. /package/{typed → dist}/contour-layer/contour-layer.d.ts.map +0 -0
  237. /package/{typed → dist}/contour-layer/contour-utils.d.ts +0 -0
  238. /package/{typed → dist}/contour-layer/contour-utils.d.ts.map +0 -0
  239. /package/{typed → dist}/contour-layer/marching-squares-codes.d.ts +0 -0
  240. /package/{typed → dist}/contour-layer/marching-squares-codes.d.ts.map +0 -0
  241. /package/{typed → dist}/contour-layer/marching-squares.d.ts +0 -0
  242. /package/{typed → dist}/contour-layer/marching-squares.d.ts.map +0 -0
  243. /package/{typed → dist}/cpu-grid-layer/cpu-grid-layer.d.ts +0 -0
  244. /package/{typed → dist}/cpu-grid-layer/cpu-grid-layer.d.ts.map +0 -0
  245. /package/{typed → dist}/cpu-grid-layer/grid-aggregator.d.ts +0 -0
  246. /package/{typed → dist}/cpu-grid-layer/grid-aggregator.d.ts.map +0 -0
  247. /package/{typed → dist}/gpu-grid-layer/gpu-grid-cell-layer-fragment.glsl.d.ts +0 -0
  248. /package/{typed → dist}/gpu-grid-layer/gpu-grid-cell-layer-fragment.glsl.d.ts.map +0 -0
  249. /package/{typed → dist}/gpu-grid-layer/gpu-grid-cell-layer-vertex.glsl.d.ts +0 -0
  250. /package/{typed → dist}/gpu-grid-layer/gpu-grid-cell-layer-vertex.glsl.d.ts.map +0 -0
  251. /package/{typed → dist}/gpu-grid-layer/gpu-grid-cell-layer.d.ts +0 -0
  252. /package/{typed → dist}/gpu-grid-layer/gpu-grid-cell-layer.d.ts.map +0 -0
  253. /package/{typed → dist}/gpu-grid-layer/gpu-grid-layer.d.ts +0 -0
  254. /package/{typed → dist}/gpu-grid-layer/gpu-grid-layer.d.ts.map +0 -0
  255. /package/{typed → dist}/grid-aggregation-layer.d.ts +0 -0
  256. /package/{typed → dist}/grid-aggregation-layer.d.ts.map +0 -0
  257. /package/{typed → dist}/grid-layer/grid-layer.d.ts +0 -0
  258. /package/{typed → dist}/grid-layer/grid-layer.d.ts.map +0 -0
  259. /package/{typed → dist}/heatmap-layer/heatmap-layer-utils.d.ts +0 -0
  260. /package/{typed → dist}/heatmap-layer/heatmap-layer-utils.d.ts.map +0 -0
  261. /package/{typed → dist}/heatmap-layer/heatmap-layer.d.ts +0 -0
  262. /package/{typed → dist}/heatmap-layer/heatmap-layer.d.ts.map +0 -0
  263. /package/{typed → dist}/heatmap-layer/max-fs.glsl.d.ts +0 -0
  264. /package/{typed → dist}/heatmap-layer/max-fs.glsl.d.ts.map +0 -0
  265. /package/{typed → dist}/heatmap-layer/max-vs.glsl.d.ts +0 -0
  266. /package/{typed → dist}/heatmap-layer/max-vs.glsl.d.ts.map +0 -0
  267. /package/{typed → dist}/heatmap-layer/triangle-layer-fragment.glsl.d.ts +0 -0
  268. /package/{typed → dist}/heatmap-layer/triangle-layer-fragment.glsl.d.ts.map +0 -0
  269. /package/{typed → dist}/heatmap-layer/triangle-layer-vertex.glsl.d.ts +0 -0
  270. /package/{typed → dist}/heatmap-layer/triangle-layer-vertex.glsl.d.ts.map +0 -0
  271. /package/{typed → dist}/heatmap-layer/triangle-layer.d.ts +0 -0
  272. /package/{typed → dist}/heatmap-layer/triangle-layer.d.ts.map +0 -0
  273. /package/{typed → dist}/heatmap-layer/weights-fs.glsl.d.ts +0 -0
  274. /package/{typed → dist}/heatmap-layer/weights-fs.glsl.d.ts.map +0 -0
  275. /package/{typed → dist}/heatmap-layer/weights-vs.glsl.d.ts +0 -0
  276. /package/{typed → dist}/heatmap-layer/weights-vs.glsl.d.ts.map +0 -0
  277. /package/{typed → dist}/hexagon-layer/hexagon-aggregator.d.ts +0 -0
  278. /package/{typed → dist}/hexagon-layer/hexagon-aggregator.d.ts.map +0 -0
  279. /package/{typed → dist}/hexagon-layer/hexagon-layer.d.ts +0 -0
  280. /package/{typed → dist}/hexagon-layer/hexagon-layer.d.ts.map +0 -0
  281. /package/{typed → dist}/index.d.ts +0 -0
  282. /package/{typed → dist}/index.d.ts.map +0 -0
  283. /package/{typed → dist}/screen-grid-layer/screen-grid-cell-layer.d.ts +0 -0
  284. /package/{typed → dist}/screen-grid-layer/screen-grid-cell-layer.d.ts.map +0 -0
  285. /package/{typed → dist}/screen-grid-layer/screen-grid-layer-fragment.glsl.d.ts +0 -0
  286. /package/{typed → dist}/screen-grid-layer/screen-grid-layer-fragment.glsl.d.ts.map +0 -0
  287. /package/{typed → dist}/screen-grid-layer/screen-grid-layer-vertex.glsl.d.ts +0 -0
  288. /package/{typed → dist}/screen-grid-layer/screen-grid-layer-vertex.glsl.d.ts.map +0 -0
  289. /package/{typed → dist}/screen-grid-layer/screen-grid-layer.d.ts +0 -0
  290. /package/{typed → dist}/screen-grid-layer/screen-grid-layer.d.ts.map +0 -0
  291. /package/{typed → dist}/types.d.ts +0 -0
  292. /package/{typed → dist}/types.d.ts.map +0 -0
  293. /package/{typed → dist}/utils/aggregation-operation-utils.d.ts +0 -0
  294. /package/{typed → dist}/utils/aggregation-operation-utils.d.ts.map +0 -0
  295. /package/{typed → dist}/utils/bin-sorter.d.ts +0 -0
  296. /package/{typed → dist}/utils/bin-sorter.d.ts.map +0 -0
  297. /package/{typed → dist}/utils/color-utils.d.ts +0 -0
  298. /package/{typed → dist}/utils/color-utils.d.ts.map +0 -0
  299. /package/{typed → dist}/utils/cpu-aggregator.d.ts +0 -0
  300. /package/{typed → dist}/utils/cpu-aggregator.d.ts.map +0 -0
  301. /package/{typed → dist}/utils/gpu-grid-aggregation/aggregate-all-fs.glsl.d.ts +0 -0
  302. /package/{typed → dist}/utils/gpu-grid-aggregation/aggregate-all-fs.glsl.d.ts.map +0 -0
  303. /package/{typed → dist}/utils/gpu-grid-aggregation/aggregate-all-vs.glsl.d.ts +0 -0
  304. /package/{typed → dist}/utils/gpu-grid-aggregation/aggregate-all-vs.glsl.d.ts.map +0 -0
  305. /package/{typed → dist}/utils/gpu-grid-aggregation/aggregate-to-grid-fs.glsl.d.ts +0 -0
  306. /package/{typed → dist}/utils/gpu-grid-aggregation/aggregate-to-grid-fs.glsl.d.ts.map +0 -0
  307. /package/{typed → dist}/utils/gpu-grid-aggregation/aggregate-to-grid-vs.glsl.d.ts +0 -0
  308. /package/{typed → dist}/utils/gpu-grid-aggregation/aggregate-to-grid-vs.glsl.d.ts.map +0 -0
  309. /package/{typed → dist}/utils/gpu-grid-aggregation/gpu-grid-aggregator-constants.d.ts +0 -0
  310. /package/{typed → dist}/utils/gpu-grid-aggregation/gpu-grid-aggregator-constants.d.ts.map +0 -0
  311. /package/{typed → dist}/utils/gpu-grid-aggregation/gpu-grid-aggregator-utils.d.ts +0 -0
  312. /package/{typed → dist}/utils/gpu-grid-aggregation/gpu-grid-aggregator-utils.d.ts.map +0 -0
  313. /package/{typed → dist}/utils/gpu-grid-aggregation/gpu-grid-aggregator.d.ts +0 -0
  314. /package/{typed → dist}/utils/gpu-grid-aggregation/transform-mean-vs.glsl.d.ts +0 -0
  315. /package/{typed → dist}/utils/gpu-grid-aggregation/transform-mean-vs.glsl.d.ts.map +0 -0
  316. /package/{typed → dist}/utils/grid-aggregation-utils.d.ts +0 -0
  317. /package/{typed → dist}/utils/grid-aggregation-utils.d.ts.map +0 -0
  318. /package/{typed → dist}/utils/prop-utils.d.ts +0 -0
  319. /package/{typed → dist}/utils/prop-utils.d.ts.map +0 -0
  320. /package/{typed → dist}/utils/resource-utils.d.ts +0 -0
  321. /package/{typed → dist}/utils/resource-utils.d.ts.map +0 -0
  322. /package/{typed → dist}/utils/scale-utils.d.ts +0 -0
  323. /package/{typed → dist}/utils/scale-utils.d.ts.map +0 -0
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/gpu-grid-layer/gpu-grid-layer.ts"],"names":["GL","log","GPUGridAggregator","AGGREGATION_OPERATION","defaultColorRange","colorRangeToFlatArray","GPUGridCellLayer","pointToDensityGridDataCPU","GridAggregationLayer","getBoundingBox","getGridParams","defaultProps","colorDomain","colorRange","getColorWeight","type","value","colorAggregation","elevationDomain","elevationRange","getElevationWeight","elevationAggregation","elevationScale","min","cellSize","max","coverage","getPosition","x","position","extruded","material","DIMENSIONS","data","props","POSITION_ATTRIBUTE_NAME","GPUGridLayer","state","initializeState","device","isSupported","error","initializeAggregationLayer","dimensions","setState","gpuAggregation","projectPoints","weights","color","needMin","needMax","combineMaxMin","maxMinBuffer","createBuffer","byteLength","accessor","size","divisor","elevation","positionAttributeName","attributeManager","getAttributeManager","add","fp64","use64bitPositions","updateState","opts","aggregationDirty","gridHash","getHashKeyForIndex","index","numRow","numCol","boundingBox","gridOffset","gridSize","gridOrigin","xMin","yMin","xOffset","yOffset","yIndex","Math","floor","xIndex","latIdx","lonIdx","getPositionForIndex","yPos","xPos","getPickingInfo","info","mode","object","gpuGridAggregator","colorInfo","getAggregationData","pixelIndex","getData","elevationInfo","colorValue","cellWeight","elevationValue","count","cellCount","totalCount","translation","viewport","context","attributes","getAttributes","cpuAggregation","key","cpuAggregationData","Object","assign","picked","Boolean","renderLayers","cellSizeMeters","SubLayerClass","getSubLayerClass","getSubLayerProps","id","colors","aggregationBuffer","elevations","colorMaxMinBuffer","elevationMaxMinBuffer","numInstances","finalizeState","forEach","weight","destroy","updateAggregationState","oldProps","coordinateSystem","cellSizeChanged","positionsChanged","isAttributeChanged","attributesChanged","getNumInstances","width","height","allocateResources","aggregationDataDirty","isAggregationDirty","dimension","compareAll","_updateAccessors","operation","layerName"],"mappings":"AAoBA,SAAQA,EAAR,QAAiB,oBAAjB;AACA,SAOEC,GAPF,QAWO,eAXP;AAaA,OAAOC,iBAAP,MAA8B,mDAA9B;AACA,SAAQC,qBAAR,QAAoC,sCAApC;AACA,SAAQC,iBAAR,EAA2BC,qBAA3B,QAAuD,sBAAvD;AACA,OAAOC,gBAAP,MAA6B,uBAA7B;AACA,SAAQC,yBAAR,QAAkD,qCAAlD;AACA,OAAOC,oBAAP,MAA8D,2BAA9D;AACA,SAAQC,cAAR,EAAwBC,aAAxB,QAA4C,iCAA5C;AAEA,MAAMC,YAA6C,GAAG;AAEpDC,EAAAA,WAAW,EAAE,IAFuC;AAGpDC,EAAAA,UAAU,EAAET,iBAHwC;AAIpDU,EAAAA,cAAc,EAAE;AAACC,IAAAA,IAAI,EAAE,UAAP;AAAmBC,IAAAA,KAAK,EAAE;AAA1B,GAJoC;AAKpDC,EAAAA,gBAAgB,EAAE,KALkC;AAQpDC,EAAAA,eAAe,EAAE,IARmC;AASpDC,EAAAA,cAAc,EAAE,CAAC,CAAD,EAAI,IAAJ,CAToC;AAUpDC,EAAAA,kBAAkB,EAAE;AAACL,IAAAA,IAAI,EAAE,UAAP;AAAmBC,IAAAA,KAAK,EAAE;AAA1B,GAVgC;AAWpDK,EAAAA,oBAAoB,EAAE,KAX8B;AAYpDC,EAAAA,cAAc,EAAE;AAACP,IAAAA,IAAI,EAAE,QAAP;AAAiBQ,IAAAA,GAAG,EAAE,CAAtB;AAAyBP,IAAAA,KAAK,EAAE;AAAhC,GAZoC;AAepDQ,EAAAA,QAAQ,EAAE;AAACT,IAAAA,IAAI,EAAE,QAAP;AAAiBQ,IAAAA,GAAG,EAAE,CAAtB;AAAyBE,IAAAA,G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AAMZvE,QAAAA,MANY;AAOZD,QAAAA;AAPY,OAAd;AASD;;AAED,UAAM0E,oBAAoB,GACxBL,iBAAiB,IACjB,KAAKM,kBAAL,CAAwBhF,IAAxB,EAA8B;AAC5BiF,MAAAA,SAAS,EAAExG,UAAU,CAACV,IADM;AAE5BmH,MAAAA,UAAU,EAAE;AAFgB,KAA9B,CAFF;;AAOA,QAAIH,oBAAJ,EAA0B;AACxB,WAAKI,gBAAL,CAAsBnF,IAAtB;AACD;;AACD,SAAKtB,QAAL,CAAc;AACZqG,MAAAA;AADY,KAAd;AAGD;;AAIDI,EAAAA,gBAAgB,CAACnF,IAAD,EAAO;AACrB,UAAM;AAACjD,MAAAA,gBAAD;AAAmBI,MAAAA;AAAnB,QAA2C6C,IAAI,CAAChC,KAAtD;AACA,UAAM;AAACc,MAAAA,KAAD;AAAQU,MAAAA;AAAR,QAAqB,KAAKrB,KAAL,CAAWU,OAAtC;AACAC,IAAAA,KAAK,CAACsG,SAAN,GAAkBnJ,qBAAqB,CAACc,gBAAD,CAAvC;AACAyC,IAAAA,SAAS,CAAC4F,SAAV,GAAsBnJ,qBAAqB,CAACkB,oBAAD,CAA3C;AACD;;AAxRsF;AAHpEe,Y,CAIZmH,S,GAAY,c;AAJAnH,Y,CAKZzB,Y,GAAeA,Y","sourcesContent":["// Copyright (c) 2015 - 2017 Uber Technologies, Inc.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nimport {GL} from '@luma.gl/constants';\nimport {\n Accessor,\n AccessorFunction,\n Color,\n Material,\n GetPickingInfoParams,\n LayerContext,\n log,\n PickingInfo,\n Position,\n DefaultProps\n} from '@deck.gl/core';\n\nimport GPUGridAggregator from '../utils/gpu-grid-aggregation/gpu-grid-aggregator';\nimport {AGGREGATION_OPERATION} from '../utils/aggregation-operation-utils';\nimport {defaultColorRange, colorRangeToFlatArray} from '../utils/color-utils';\nimport GPUGridCellLayer from './gpu-grid-cell-layer';\nimport {pointToDensityGridDataCPU, GridHash} from './../cpu-grid-layer/grid-aggregator';\nimport GridAggregationLayer, {GridAggregationLayerProps} from '../grid-aggregation-layer';\nimport {getBoundingBox, getGridParams} from '../utils/grid-aggregation-utils';\n\nconst defaultProps: DefaultProps<GPUGridLayerProps> = {\n // color\n colorDomain: null,\n colorRange: defaultColorRange,\n getColorWeight: {type: 'accessor', value: 1},\n colorAggregation: 'SUM',\n\n // elevation\n elevationDomain: null,\n elevationRange: [0, 1000],\n getElevationWeight: {type: 'accessor', value: 1},\n elevationAggregation: 'SUM',\n elevationScale: {type: 'number', min: 0, value: 1},\n\n // grid\n cellSize: {type: 'number', min: 1, max: 1000, value: 1000},\n coverage: {type: 'number', min: 0, max: 1, value: 1},\n getPosition: {type: 'accessor', value: (x: any) => x.position},\n extruded: false,\n\n // Optional material for 'lighting' shader module\n material: true\n};\n\n// This layer only perform GPU aggregation, no need to seperate data and weight props\n// aggregation will be dirty when any of the props are changed.\n\nconst DIMENSIONS = {\n data: {\n props: ['cellSize', 'colorAggregation', 'elevationAggregation']\n }\n // rest of the changes are detected by `state.attributesChanged`\n};\nconst POSITION_ATTRIBUTE_NAME = 'positions';\n\n/** All properties supported by GPUGridLayer. */\nexport type GPUGridLayerProps<DataT = unknown> = _GPUGridLayerProps<DataT> &\n GridAggregationLayerProps<DataT>;\n\n/** Properties added by GPUGridLayer. */\nexport type _GPUGridLayerProps<DataT> = {\n /**\n * Size of each cell in meters.\n * @default 1000\n */\n cellSize?: number;\n\n /**\n * Color scale domain, default is set to the extent of aggregated weights in each cell.\n * @default [min(colorWeight), max(colorWeight)]\n */\n colorDomain?: [number, number] | null;\n\n /**\n * Default: [colorbrewer](http://colorbrewer2.org/#type=sequential&scheme=YlOrRd&n=6) `6-class YlOrRd`\n */\n colorRange?: Color[];\n\n /**\n * Cell size multiplier, clamped between 0 - 1.\n * @default 1\n */\n coverage?: number;\n\n /**\n * Elevation scale input domain, default is set to between 0 and the max of aggregated weights in each cell.\n * @default [0, max(elevationWeight)]\n */\n elevationDomain?: [number, number] | null;\n\n /**\n * Elevation scale output range.\n * @default [0, 1000]\n */\n elevationRange?: [number, number];\n\n /**\n * Cell elevation multiplier.\n * @default 1\n */\n elevationScale?: number;\n\n /**\n * Whether to enable cell elevation. If set to false, all cell will be flat.\n * @default true\n */\n extruded?: boolean;\n\n /**\n * Material settings for lighting effect. Applies if `extruded: true`.\n *\n * @default true\n * @see https://deck.gl/docs/developer-guide/using-lighting\n */\n material?: Material;\n\n /**\n * Defines the operation used to aggregate all data object weights to calculate a cell's color value.\n * @default 'SUM'\n */\n colorAggregation?: 'SUM' | 'MEAN' | 'MIN' | 'MAX';\n\n /**\n * Defines the operation used to aggregate all data object weights to calculate a cell's elevation value.\n * @default 'SUM'\n */\n elevationAggregation?: 'SUM' | 'MEAN' | 'MIN' | 'MAX';\n\n /**\n * Method called to retrieve the position of each object.\n * @default object => object.position\n */\n getPosition?: AccessorFunction<DataT, Position>;\n\n /**\n * The weight of a data object used to calculate the color value for a cell.\n * @default 1\n */\n getColorWeight?: Accessor<DataT, number>;\n\n /**\n * The weight of a data object used to calculate the elevation value for a cell.\n * @default 1\n */\n getElevationWeight?: Accessor<DataT, number>;\n};\n\n/** Aggregate data into a grid-based heatmap. Aggregation is performed on GPU (WebGL2 only). */\nexport default class GPUGridLayer<\n DataT = any,\n ExtraPropsT extends {} = {}\n> extends GridAggregationLayer<DataT, ExtraPropsT & Required<_GPUGridLayerProps<DataT>>> {\n static layerName = 'GPUGridLayer';\n static defaultProps = defaultProps;\n\n state!: GridAggregationLayer<DataT>['state'] & {\n isSupported: boolean;\n gridHash?: GridHash;\n };\n\n initializeState({device}: LayerContext): void {\n const isSupported = GPUGridAggregator.isSupported(device);\n if (!isSupported) {\n log.error('GPUGridLayer is not supported on this browser, use GridLayer instead')();\n }\n super.initializeAggregationLayer({\n dimensions: DIMENSIONS\n });\n this.setState({\n gpuAggregation: false, // TODO(v9): Re-enable GPU aggregation.\n projectPoints: false, // aggregation in world space\n isSupported,\n weights: {\n color: {\n needMin: true,\n needMax: true,\n combineMaxMin: true,\n maxMinBuffer: device.createBuffer({\n byteLength: 4 * 4,\n // @ts-expect-error webgl-legacy\n accessor: {size: 4, type: GL.FLOAT, divisor: 1}\n })\n },\n elevation: {\n needMin: true,\n needMax: true,\n combineMaxMin: true,\n maxMinBuffer: device.createBuffer({\n byteLength: 4 * 4,\n // @ts-expect-error\n accessor: {size: 4, type: GL.FLOAT, divisor: 1}\n })\n }\n },\n positionAttributeName: 'positions'\n });\n const attributeManager = this.getAttributeManager()!;\n attributeManager.add({\n [POSITION_ATTRIBUTE_NAME]: {\n size: 3,\n accessor: 'getPosition',\n type: GL.DOUBLE,\n fp64: this.use64bitPositions()\n },\n color: {size: 3, accessor: 'getColorWeight'},\n elevation: {size: 3, accessor: 'getElevationWeight'}\n });\n }\n\n updateState(opts) {\n if (this.state.isSupported === false) {\n // Skip update, layer not supported\n return;\n }\n super.updateState(opts);\n const {aggregationDirty} = this.state;\n if (aggregationDirty) {\n // reset cached CPU Aggregation results (used for picking)\n this.setState({\n gridHash: null\n });\n }\n }\n\n getHashKeyForIndex(index: number): string {\n const {numRow, numCol, boundingBox, gridOffset} = this.state;\n const gridSize = [numCol, numRow];\n const gridOrigin = [boundingBox.xMin, boundingBox.yMin];\n const cellSize = [gridOffset.xOffset, gridOffset.yOffset];\n\n const yIndex = Math.floor(index / gridSize[0]);\n const xIndex = index - yIndex * gridSize[0];\n // This will match the index to the hash-key to access aggregation data from CPU aggregation results.\n const latIdx = Math.floor(\n (yIndex * cellSize[1] + gridOrigin[1] + 90 + cellSize[1] / 2) / cellSize[1]\n );\n const lonIdx = Math.floor(\n (xIndex * cellSize[0] + gridOrigin[0] + 180 + cellSize[0] / 2) / cellSize[0]\n );\n return `${latIdx}-${lonIdx}`;\n }\n\n getPositionForIndex(index: number): Position {\n const {numRow, numCol, boundingBox, gridOffset} = this.state;\n const gridSize = [numCol, numRow];\n const gridOrigin = [boundingBox.xMin, boundingBox.yMin];\n const cellSize = [gridOffset.xOffset, gridOffset.yOffset];\n\n const yIndex = Math.floor(index / gridSize[0]);\n const xIndex = index - yIndex * gridSize[0];\n const yPos = yIndex * cellSize[1] + gridOrigin[1];\n const xPos = xIndex * cellSize[0] + gridOrigin[0];\n return [xPos, yPos];\n }\n\n getPickingInfo({info, mode}: GetPickingInfoParams): PickingInfo {\n const {index} = info;\n let object: any = null;\n if (index >= 0) {\n const gpuGridAggregator = this.state.gpuGridAggregator!;\n const position = this.getPositionForIndex(index);\n const colorInfo = GPUGridAggregator.getAggregationData({\n pixelIndex: index,\n ...gpuGridAggregator.getData('color')\n });\n const elevationInfo = GPUGridAggregator.getAggregationData({\n pixelIndex: index,\n ...gpuGridAggregator.getData('elevation')\n });\n\n object = {\n colorValue: colorInfo.cellWeight,\n elevationValue: elevationInfo.cellWeight,\n count: colorInfo.cellCount || elevationInfo.cellCount,\n position,\n totalCount: colorInfo.totalCount || elevationInfo.totalCount\n };\n if (mode !== 'hover') {\n // perform CPU aggregation for full list of points for each cell\n const {props} = this;\n let {gridHash} = this.state;\n if (!gridHash) {\n const {gridOffset, translation, boundingBox} = this.state;\n const {viewport} = this.context;\n const attributes = this.getAttributes();\n const cpuAggregation = pointToDensityGridDataCPU(props as any, {\n gridOffset,\n attributes,\n viewport,\n translation,\n boundingBox\n });\n gridHash = cpuAggregation.gridHash;\n this.setState({gridHash});\n }\n const key = this.getHashKeyForIndex(index);\n const cpuAggregationData = gridHash[key];\n Object.assign(object, cpuAggregationData);\n }\n }\n\n // override object with picked cell\n info.picked = Boolean(object);\n info.object = object;\n\n return info;\n }\n\n renderLayers() {\n if (!this.state.isSupported) {\n return null;\n }\n const {\n elevationScale,\n extruded,\n cellSize: cellSizeMeters,\n coverage,\n material,\n elevationRange,\n colorDomain,\n elevationDomain\n } = this.props;\n\n const {weights, numRow, numCol, gridOrigin, gridOffset} = this.state;\n const {color, elevation} = weights;\n const colorRange = colorRangeToFlatArray(this.props.colorRange);\n\n const SubLayerClass = this.getSubLayerClass('gpu-grid-cell', GPUGridCellLayer);\n\n return new SubLayerClass(\n {\n gridSize: [numCol, numRow],\n gridOrigin,\n gridOffset: [gridOffset.xOffset, gridOffset.yOffset],\n colorRange,\n elevationRange,\n colorDomain,\n elevationDomain,\n\n cellSize: cellSizeMeters,\n coverage,\n material,\n elevationScale,\n extruded\n },\n this.getSubLayerProps({\n id: 'gpu-grid-cell'\n }),\n {\n data: {\n attributes: {\n colors: color.aggregationBuffer,\n elevations: elevation.aggregationBuffer\n }\n },\n colorMaxMinBuffer: color.maxMinBuffer,\n elevationMaxMinBuffer: elevation.maxMinBuffer,\n numInstances: numCol * numRow\n }\n );\n }\n\n finalizeState(context: LayerContext) {\n const {color, elevation} = this.state.weights;\n [color, elevation].forEach(weight => {\n const {aggregationBuffer, maxMinBuffer} = weight;\n maxMinBuffer?.destroy();\n aggregationBuffer?.destroy();\n });\n super.finalizeState(context);\n }\n\n // Aggregation Overrides\n\n updateAggregationState(opts) {\n const {props, oldProps} = opts;\n const {cellSize, coordinateSystem} = props;\n const {viewport} = this.context;\n const cellSizeChanged = oldProps.cellSize !== cellSize;\n const {dimensions} = this.state;\n\n const positionsChanged = this.isAttributeChanged(POSITION_ATTRIBUTE_NAME);\n // any attribute changed\n const attributesChanged = positionsChanged || this.isAttributeChanged();\n\n let {boundingBox} = this.state;\n if (positionsChanged) {\n boundingBox = getBoundingBox(this.getAttributes(), this.getNumInstances());\n this.setState({boundingBox});\n }\n if (positionsChanged || cellSizeChanged) {\n const {gridOffset, translation, width, height, numCol, numRow} = getGridParams(\n boundingBox,\n cellSize,\n viewport,\n coordinateSystem\n );\n this.allocateResources(numRow, numCol);\n this.setState({\n gridOffset,\n translation,\n gridOrigin: [-1 * translation[0], -1 * translation[1]],\n width,\n height,\n numCol,\n numRow\n });\n }\n\n const aggregationDataDirty =\n attributesChanged ||\n this.isAggregationDirty(opts, {\n dimension: dimensions.data,\n compareAll: true\n });\n\n if (aggregationDataDirty) {\n this._updateAccessors(opts);\n }\n this.setState({\n aggregationDataDirty\n });\n }\n\n // Private\n\n _updateAccessors(opts) {\n const {colorAggregation, elevationAggregation} = opts.props;\n const {color, elevation} = this.state.weights;\n color.operation = AGGREGATION_OPERATION[colorAggregation];\n elevation.operation = AGGREGATION_OPERATION[elevationAggregation];\n }\n}\n"],"file":"gpu-grid-layer.js"}
@@ -1,240 +0,0 @@
1
- import { GL } from '@luma.gl/constants';
2
- import { log } from '@deck.gl/core';
3
- import AggregationLayer from './aggregation-layer';
4
- import GPUGridAggregator from './utils/gpu-grid-aggregation/gpu-grid-aggregator';
5
- import BinSorter from './utils/bin-sorter';
6
- import { pointToDensityGridDataCPU } from './cpu-grid-layer/grid-aggregator';
7
- export default class GridAggregationLayer extends AggregationLayer {
8
- constructor(...args) {
9
- super(...args);
10
- this.state = void 0;
11
- }
12
-
13
- initializeAggregationLayer({
14
- dimensions
15
- }) {
16
- super.initializeAggregationLayer(dimensions);
17
- this.setState({
18
- layerData: {},
19
- gpuGridAggregator: new GPUGridAggregator(this.context.device, {
20
- id: `${this.id}-gpu-aggregator`
21
- }),
22
- cpuGridAggregator: pointToDensityGridDataCPU
23
- });
24
- }
25
-
26
- updateState(opts) {
27
- super.updateState(opts);
28
- this.updateAggregationState(opts);
29
- const {
30
- aggregationDataDirty,
31
- aggregationWeightsDirty,
32
- gpuAggregation
33
- } = this.state;
34
-
35
- if (this.getNumInstances() <= 0) {
36
- return;
37
- }
38
-
39
- let aggregationDirty = false;
40
-
41
- if (aggregationDataDirty || gpuAggregation && aggregationWeightsDirty) {
42
- this._updateAggregation(opts);
43
-
44
- aggregationDirty = true;
45
- }
46
-
47
- if (!gpuAggregation && (aggregationDataDirty || aggregationWeightsDirty)) {
48
- this._updateWeightBins();
49
-
50
- this._uploadAggregationResults();
51
-
52
- aggregationDirty = true;
53
- }
54
-
55
- this.setState({
56
- aggregationDirty
57
- });
58
- }
59
-
60
- finalizeState(context) {
61
- var _this$state$gpuGridAg;
62
-
63
- const {
64
- count
65
- } = this.state.weights;
66
-
67
- if (count && count.aggregationBuffer) {
68
- count.aggregationBuffer.delete();
69
- }
70
-
71
- (_this$state$gpuGridAg = this.state.gpuGridAggregator) === null || _this$state$gpuGridAg === void 0 ? void 0 : _this$state$gpuGridAg.delete();
72
- super.finalizeState(context);
73
- }
74
-
75
- updateShaders(shaders) {
76
- if (this.state.gpuAggregation) {
77
- this.state.gpuGridAggregator.updateShaders(shaders);
78
- }
79
- }
80
-
81
- updateAggregationState(opts) {
82
- log.assert(false);
83
- }
84
-
85
- allocateResources(numRow, numCol) {
86
- if (this.state.numRow !== numRow || this.state.numCol !== numCol) {
87
- const dataBytes = numCol * numRow * 4 * 4;
88
- const {
89
- weights
90
- } = this.state;
91
-
92
- for (const name in weights) {
93
- const weight = weights[name];
94
-
95
- if (weight.aggregationBuffer) {
96
- weight.aggregationBuffer.delete();
97
- }
98
-
99
- weight.aggregationBuffer = this.context.device.createBuffer({
100
- byteLength: dataBytes,
101
- accessor: {
102
- size: 4,
103
- type: 5126,
104
- divisor: 1
105
- }
106
- });
107
- }
108
- }
109
- }
110
-
111
- updateResults({
112
- aggregationData,
113
- maxMinData,
114
- maxData,
115
- minData
116
- }) {
117
- const {
118
- count
119
- } = this.state.weights;
120
-
121
- if (count) {
122
- count.aggregationData = aggregationData;
123
- count.maxMinData = maxMinData;
124
- count.maxData = maxData;
125
- count.minData = minData;
126
- }
127
- }
128
-
129
- _updateAggregation(opts) {
130
- const {
131
- cpuGridAggregator,
132
- gpuGridAggregator,
133
- gridOffset,
134
- posOffset,
135
- translation = [0, 0],
136
- scaling = [0, 0, 0],
137
- boundingBox,
138
- projectPoints,
139
- gpuAggregation,
140
- numCol,
141
- numRow
142
- } = this.state;
143
- const {
144
- props
145
- } = opts;
146
- const {
147
- viewport
148
- } = this.context;
149
- const attributes = this.getAttributes();
150
- const vertexCount = this.getNumInstances();
151
-
152
- if (!gpuAggregation) {
153
- const result = cpuGridAggregator(props, {
154
- gridOffset,
155
- projectPoints,
156
- attributes,
157
- viewport,
158
- posOffset,
159
- boundingBox
160
- });
161
- this.setState({
162
- layerData: result
163
- });
164
- } else {
165
- const {
166
- weights
167
- } = this.state;
168
- gpuGridAggregator.run({
169
- weights,
170
- cellSize: [gridOffset.xOffset, gridOffset.yOffset],
171
- numCol,
172
- numRow,
173
- translation,
174
- scaling,
175
- vertexCount,
176
- projectPoints,
177
- attributes,
178
- moduleSettings: this.getModuleSettings()
179
- });
180
- }
181
- }
182
-
183
- _updateWeightBins() {
184
- const {
185
- getValue
186
- } = this.state;
187
- const sortedBins = new BinSorter(this.state.layerData.data || [], {
188
- getValue
189
- });
190
- this.setState({
191
- sortedBins
192
- });
193
- }
194
-
195
- _uploadAggregationResults() {
196
- const {
197
- numCol,
198
- numRow
199
- } = this.state;
200
- const {
201
- data
202
- } = this.state.layerData;
203
- const {
204
- aggregatedBins,
205
- minValue,
206
- maxValue,
207
- totalCount
208
- } = this.state.sortedBins;
209
- const ELEMENTCOUNT = 4;
210
- const aggregationSize = numCol * numRow * ELEMENTCOUNT;
211
- const aggregationData = new Float32Array(aggregationSize).fill(0);
212
-
213
- for (const bin of aggregatedBins) {
214
- const {
215
- lonIdx,
216
- latIdx
217
- } = data[bin.i];
218
- const {
219
- value,
220
- counts
221
- } = bin;
222
- const cellIndex = (lonIdx + latIdx * numCol) * ELEMENTCOUNT;
223
- aggregationData[cellIndex] = value;
224
- aggregationData[cellIndex + ELEMENTCOUNT - 1] = counts;
225
- }
226
-
227
- const maxMinData = new Float32Array([maxValue, 0, 0, minValue]);
228
- const maxData = new Float32Array([maxValue, 0, 0, totalCount]);
229
- const minData = new Float32Array([minValue, 0, 0, totalCount]);
230
- this.updateResults({
231
- aggregationData,
232
- maxMinData,
233
- maxData,
234
- minData
235
- });
236
- }
237
-
238
- }
239
- GridAggregationLayer.layerName = 'GridAggregationLayer';
240
- //# sourceMappingURL=grid-aggregation-layer.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/grid-aggregation-layer.ts"],"names":["GL","log","AggregationLayer","GPUGridAggregator","BinSorter","pointToDensityGridDataCPU","GridAggregationLayer","state","initializeAggregationLayer","dimensions","setState","layerData","gpuGridAggregator","context","device","id","cpuGridAggregator","updateState","opts","updateAggregationState","aggregationDataDirty","aggregationWeightsDirty","gpuAggregation","getNumInstances","aggregationDirty","_updateAggregation","_updateWeightBins","_uploadAggregationResults","finalizeState","count","weights","aggregationBuffer","delete","updateShaders","shaders","assert","allocateResources","numRow","numCol","dataBytes","name","weight","createBuffer","byteLength","accessor","size","type","divisor","updateResults","aggregationData","maxMinData","maxData","minData","gridOffset","posOffset","translation","scaling","boundingBox","projectPoints","props","viewport","attributes","getAttributes","vertexCount","result","run","cellSize","xOffset","yOffset","moduleSettings","getModuleSettings","getValue","sortedBins","data","aggregatedBins","minValue","maxValue","totalCount","ELEMENTCOUNT","aggregationSize","Float32Array","fill","bin","lonIdx","latIdx","i","value","counts","cellIndex","layerName"],"mappings":"AAoBA,SAAQA,EAAR,QAAiB,oBAAjB;AACA,SAAsBC,GAA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ted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nimport {GL} from '@luma.gl/constants';\nimport {LayerContext, log, UpdateParameters, Accessor} from '@deck.gl/core';\nimport AggregationLayer, {AggregationLayerProps} from './aggregation-layer';\nimport GPUGridAggregator from './utils/gpu-grid-aggregation/gpu-grid-aggregator';\nimport BinSorter from './utils/bin-sorter';\nimport {pointToDensityGridDataCPU} from './cpu-grid-layer/grid-aggregator';\nimport type {Buffer} from '@luma.gl/core';\n\nexport type GridAggregationLayerProps<DataT> = AggregationLayerProps<DataT>;\n\nexport default abstract class GridAggregationLayer<\n DataT,\n ExtraPropsT extends {} = {}\n> extends AggregationLayer<DataT, ExtraPropsT> {\n static layerName = 'GridAggregationLayer';\n\n state!: AggregationLayer<DataT>['state'] & {\n aggregationDataDirty?: boolean;\n aggregationWeightsDirty?: boolean;\n aggregationDirty?: boolean;\n gpuAggregation?: any;\n getValue?: () => any;\n sortedBins?: BinSorter;\n weights: {\n [key: string]: {\n aggregationBuffer?: Buffer;\n maxMinBuffer?: Buffer;\n aggregationData: Float32Array | null;\n maxMinData: Float32Array;\n maxData: Float32Array;\n minData: Float32Array;\n getWeight: Accessor<DataT, number>;\n operation: number;\n };\n };\n cpuGridAggregator?: Function;\n gpuGridAggregator?: GPUGridAggregator;\n layerData: any;\n numRow: number;\n numCol: number;\n gridOffset: {xOffset: number; yOffset: number};\n posOffset: number[];\n gridOrigin: number[];\n translation: number[];\n scaling: number[];\n boundingBox: {xMin: number; yMin: number; xMax: number; yMax: number};\n projectPoints?: (p: [number, number]) => [number, number];\n };\n\n initializeAggregationLayer({dimensions}) {\n super.initializeAggregationLayer(dimensions);\n this.setState({\n // CPU aggregation results\n layerData: {},\n gpuGridAggregator: new GPUGridAggregator(this.context.device, {\n id: `${this.id}-gpu-aggregator`\n }),\n cpuGridAggregator: pointToDensityGridDataCPU\n });\n }\n\n updateState(opts: UpdateParameters<this>) {\n // get current attributes\n super.updateState(opts);\n\n this.updateAggregationState(opts);\n\n const {aggregationDataDirty, aggregationWeightsDirty, gpuAggregation} = this.state;\n if (this.getNumInstances() <= 0) {\n return;\n }\n let aggregationDirty = false;\n // CPU aggregation is two steps\n // 1. Create bins (based on cellSize and position) 2. Aggregate weights for each bin\n // For GPU aggregation both above steps are combined into one step\n\n // step-1\n if (aggregationDataDirty || (gpuAggregation && aggregationWeightsDirty)) {\n this._updateAggregation(opts);\n aggregationDirty = true;\n }\n // step-2 (Applicalbe for CPU aggregation only)\n if (!gpuAggregation && (aggregationDataDirty || aggregationWeightsDirty)) {\n this._updateWeightBins();\n this._uploadAggregationResults();\n aggregationDirty = true;\n }\n\n this.setState({aggregationDirty});\n }\n\n finalizeState(context: LayerContext) {\n const {count} = this.state.weights;\n if (count && count.aggregationBuffer) {\n count.aggregationBuffer.delete();\n }\n this.state.gpuGridAggregator?.delete();\n super.finalizeState(context);\n }\n\n updateShaders(shaders: any): void {\n if (this.state.gpuAggregation) {\n this.state.gpuGridAggregator!.updateShaders(shaders);\n }\n }\n\n // Methods that can be overriden by subclasses for customizations\n\n updateAggregationState(opts: UpdateParameters<this>) {\n // Sublayers should implement this method.\n log.assert(false);\n }\n\n allocateResources(numRow, numCol) {\n if (this.state.numRow !== numRow || this.state.numCol !== numCol) {\n const dataBytes = numCol * numRow * 4 * 4;\n const {weights} = this.state;\n for (const name in weights) {\n const weight = weights[name];\n if (weight.aggregationBuffer) {\n weight.aggregationBuffer.delete();\n }\n weight.aggregationBuffer = this.context.device.createBuffer({\n byteLength: dataBytes,\n // @ts-expect-error legacy\n accessor: {\n size: 4,\n type: GL.FLOAT,\n divisor: 1\n }\n });\n }\n }\n }\n\n updateResults({aggregationData, maxMinData, maxData, minData}) {\n const {count} = this.state.weights;\n if (count) {\n count.aggregationData = aggregationData;\n count.maxMinData = maxMinData;\n count.maxData = maxData;\n count.minData = minData;\n }\n }\n\n // Private\n\n _updateAggregation(opts) {\n const {\n cpuGridAggregator,\n gpuGridAggregator,\n gridOffset,\n posOffset,\n translation = [0, 0],\n scaling = [0, 0, 0],\n boundingBox,\n projectPoints,\n gpuAggregation,\n numCol,\n numRow\n } = this.state;\n const {props} = opts;\n const {viewport} = this.context;\n const attributes = this.getAttributes();\n const vertexCount = this.getNumInstances();\n\n if (!gpuAggregation) {\n const result = cpuGridAggregator!(props, {\n gridOffset,\n projectPoints,\n attributes,\n viewport,\n posOffset,\n boundingBox\n });\n this.setState({\n layerData: result\n });\n } else {\n const {weights} = this.state;\n gpuGridAggregator!.run({\n weights,\n cellSize: [gridOffset.xOffset, gridOffset.yOffset],\n numCol,\n numRow,\n translation,\n scaling,\n vertexCount,\n projectPoints,\n attributes,\n moduleSettings: this.getModuleSettings()\n });\n }\n }\n\n _updateWeightBins() {\n const {getValue} = this.state;\n\n const sortedBins = new BinSorter(this.state.layerData.data || [], {getValue});\n this.setState({sortedBins});\n }\n\n _uploadAggregationResults(): void {\n const {numCol, numRow} = this.state;\n const {data} = this.state.layerData;\n const {aggregatedBins, minValue, maxValue, totalCount} = this.state.sortedBins!;\n\n const ELEMENTCOUNT = 4;\n const aggregationSize = numCol * numRow * ELEMENTCOUNT;\n const aggregationData = new Float32Array(aggregationSize).fill(0);\n for (const bin of aggregatedBins) {\n const {lonIdx, latIdx} = data[bin.i];\n const {value, counts} = bin;\n const cellIndex = (lonIdx + latIdx * numCol) * ELEMENTCOUNT;\n aggregationData[cellIndex] = value;\n aggregationData[cellIndex + ELEMENTCOUNT - 1] = counts;\n }\n const maxMinData = new Float32Array([maxValue, 0, 0, minValue]);\n const maxData = new Float32Array([maxValue, 0, 0, totalCount]);\n const minData = new Float32Array([minValue, 0, 0, totalCount]);\n this.updateResults({aggregationData, maxMinData, maxData, minData});\n }\n}\n"],"file":"grid-aggregation-layer.js"}
@@ -1,80 +0,0 @@
1
- import { CompositeLayer } from '@deck.gl/core';
2
- import GPUGridAggregator from '../utils/gpu-grid-aggregation/gpu-grid-aggregator';
3
- import GPUGridLayer from '../gpu-grid-layer/gpu-grid-layer';
4
- import CPUGridLayer from '../cpu-grid-layer/cpu-grid-layer';
5
- const defaultProps = { ...GPUGridLayer.defaultProps,
6
- ...CPUGridLayer.defaultProps,
7
- gpuAggregation: false
8
- };
9
- export default class GridLayer extends CompositeLayer {
10
- constructor(...args) {
11
- super(...args);
12
- this.state = void 0;
13
- }
14
-
15
- initializeState() {
16
- this.state = {
17
- useGPUAggregation: false
18
- };
19
- }
20
-
21
- updateState({
22
- props
23
- }) {
24
- this.setState({
25
- useGPUAggregation: false
26
- });
27
- }
28
-
29
- renderLayers() {
30
- const {
31
- data,
32
- updateTriggers
33
- } = this.props;
34
- const id = this.state.useGPUAggregation ? 'GPU' : 'CPU';
35
- const LayerType = this.state.useGPUAggregation ? this.getSubLayerClass('GPU', GPUGridLayer) : this.getSubLayerClass('CPU', CPUGridLayer);
36
- return new LayerType(this.props, this.getSubLayerProps({
37
- id,
38
- updateTriggers
39
- }), {
40
- data
41
- });
42
- }
43
-
44
- canUseGPUAggregation(props) {
45
- const {
46
- gpuAggregation,
47
- lowerPercentile,
48
- upperPercentile,
49
- getColorValue,
50
- getElevationValue,
51
- colorScaleType
52
- } = props;
53
-
54
- if (!gpuAggregation) {
55
- return false;
56
- }
57
-
58
- if (!GPUGridAggregator.isSupported(this.context.device)) {
59
- return false;
60
- }
61
-
62
- if (lowerPercentile !== 0 || upperPercentile !== 100) {
63
- return false;
64
- }
65
-
66
- if (getColorValue !== null || getElevationValue !== null) {
67
- return false;
68
- }
69
-
70
- if (colorScaleType === 'quantile' || colorScaleType === 'ordinal') {
71
- return false;
72
- }
73
-
74
- return true;
75
- }
76
-
77
- }
78
- GridLayer.layerName = 'GridLayer';
79
- GridLayer.defaultProps = defaultProps;
80
- //# sourceMappingURL=grid-layer.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/grid-layer/grid-layer.ts"],"names":["CompositeLayer","GPUGridAggregator","GPUGridLayer","CPUGridLayer","defaultProps","gpuAggregation","GridLayer","state","initializeState","useGPUAggregation","updateState","props","setState","renderLayers","data","updateTriggers","id","LayerType","getSubLayerClass","getSubLayerProps","canUseGPUAggregation","lowerPercentile","upperPercentile","getColorValue","getElevationValue","colorScaleType","isSupported","context","device","layerName"],"mappings":"AAAA,SACEA,cADF,QAMO,eANP;AAOA,OAAOC,iBAAP,MAA8B,mDAA9B;AACA,OAAOC,YAAP,MAA8C,kCAA9C;AACA,OAAOC,YAAP,MAA8C,kCAA9C;AAEA,MAAMC,YAA0C,GAAG,EACjD,GAAGF,YAAY,CAACE,YADiC;AAEjD,KAAGD,YAAY,CAACC,YAFiC;AAGjDC,EAAAA,cAAc,EAAE;AAHiC,CAAnD;AA0BA,eAAe,MAAMC,SAAN,SAAkEN,cAAlE,CAEb;AAAA;AAAA;AAAA,SAIAO,KAJA;AAAA;;AAQAC,EAAAA,eAAe,GAAG;AAChB,SAAKD,KAAL,GAAa;AACXE,MAAAA,iBAAiB,EAAE;AADR,KAAb;AAGD;;AAEDC,EAAAA,WAAW,CAAC;AAACC,IAAAA;AAAD,GAAD,EAAkC;AAC3C,SAAKC,Q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;AAvED;AAFmBnB,S,CAGZuB,S,GAAY,W;AAHAvB,S,CAIZF,Y,GAAeA,Y","sourcesContent":["import {\n CompositeLayer,\n CompositeLayerProps,\n Layer,\n UpdateParameters,\n DefaultProps\n} from '@deck.gl/core';\nimport GPUGridAggregator from '../utils/gpu-grid-aggregation/gpu-grid-aggregator';\nimport GPUGridLayer, {GPUGridLayerProps} from '../gpu-grid-layer/gpu-grid-layer';\nimport CPUGridLayer, {CPUGridLayerProps} from '../cpu-grid-layer/cpu-grid-layer';\n\nconst defaultProps: DefaultProps<GridLayerProps> = {\n ...GPUGridLayer.defaultProps,\n ...CPUGridLayer.defaultProps,\n gpuAggregation: false\n};\n\n/** All properties supported by GridLayer. */\nexport type GridLayerProps<DataT = unknown> = _GridLayerProps<DataT> & CompositeLayerProps;\n\n/** Properties added by GridLayer. */\ntype _GridLayerProps<DataT> = CPUGridLayerProps<DataT> &\n GPUGridLayerProps<DataT> & {\n /**\n * Whether the aggregation should be performed in high-precision 64-bit mode.\n * @default false\n */\n fp64?: boolean;\n\n /**\n * When set to true, aggregation is performed on GPU, provided other conditions are met.\n * @default false\n */\n gpuAggregation?: boolean;\n };\n\n/** Aggregate data into a grid-based heatmap. The color and height of a cell are determined based on the objects it contains. */\nexport default class GridLayer<DataT = any, ExtraPropsT extends {} = {}> extends CompositeLayer<\n ExtraPropsT & Required<_GridLayerProps<DataT>>\n> {\n static layerName = 'GridLayer';\n static defaultProps = defaultProps;\n\n state!: CompositeLayer['state'] & {\n useGPUAggregation: boolean;\n };\n\n initializeState() {\n this.state = {\n useGPUAggregation: false // TODO(v9): Re-enable GPU aggregation.\n };\n }\n\n updateState({props}: UpdateParameters<this>) {\n this.setState({\n // TODO(v9): Re-enable GPU aggregation.\n // useGPUAggregation: this.canUseGPUAggregation(props)\n useGPUAggregation: false\n });\n }\n\n renderLayers(): Layer {\n const {data, updateTriggers} = this.props;\n const id = this.state.useGPUAggregation ? 'GPU' : 'CPU';\n const LayerType = this.state.useGPUAggregation\n ? this.getSubLayerClass('GPU', GPUGridLayer)\n : this.getSubLayerClass('CPU', CPUGridLayer);\n return new LayerType(\n this.props,\n this.getSubLayerProps({\n id,\n updateTriggers\n }),\n {\n data\n }\n );\n }\n\n // Private methods\n\n canUseGPUAggregation(props: GridLayer['props']) {\n const {\n gpuAggregation,\n lowerPercentile,\n upperPercentile,\n getColorValue,\n getElevationValue,\n colorScaleType\n } = props;\n if (!gpuAggregation) {\n // cpu aggregation is requested\n return false;\n }\n if (!GPUGridAggregator.isSupported(this.context.device)) {\n return false;\n }\n if (lowerPercentile !== 0 || upperPercentile !== 100) {\n // percentile calculations requires sorting not supported on GPU\n return false;\n }\n if (getColorValue !== null || getElevationValue !== null) {\n // accessor for custom color or elevation calculation is specified\n return false;\n }\n if (colorScaleType === 'quantile' || colorScaleType === 'ordinal') {\n // quantile and ordinal scales are not supported on GPU\n return false;\n }\n return true;\n }\n}\n"],"file":"grid-layer.js"}
@@ -1,55 +0,0 @@
1
- export function getBounds(points) {
2
- const x = points.map(p => p[0]);
3
- const y = points.map(p => p[1]);
4
- const xMin = Math.min.apply(null, x);
5
- const xMax = Math.max.apply(null, x);
6
- const yMin = Math.min.apply(null, y);
7
- const yMax = Math.max.apply(null, y);
8
- return [xMin, yMin, xMax, yMax];
9
- }
10
- export function boundsContain(currentBounds, targetBounds) {
11
- if (targetBounds[0] >= currentBounds[0] && targetBounds[2] <= currentBounds[2] && targetBounds[1] >= currentBounds[1] && targetBounds[3] <= currentBounds[3]) {
12
- return true;
13
- }
14
-
15
- return false;
16
- }
17
- const scratchArray = new Float32Array(12);
18
- export function packVertices(points, dimensions = 2) {
19
- let index = 0;
20
-
21
- for (const point of points) {
22
- for (let i = 0; i < dimensions; i++) {
23
- scratchArray[index++] = point[i] || 0;
24
- }
25
- }
26
-
27
- return scratchArray;
28
- }
29
- export function scaleToAspectRatio(boundingBox, width, height) {
30
- const [xMin, yMin, xMax, yMax] = boundingBox;
31
- const currentWidth = xMax - xMin;
32
- const currentHeight = yMax - yMin;
33
- let newWidth = currentWidth;
34
- let newHeight = currentHeight;
35
-
36
- if (currentWidth / currentHeight < width / height) {
37
- newWidth = width / height * currentHeight;
38
- } else {
39
- newHeight = height / width * currentWidth;
40
- }
41
-
42
- if (newWidth < width) {
43
- newWidth = width;
44
- newHeight = height;
45
- }
46
-
47
- const xCenter = (xMax + xMin) / 2;
48
- const yCenter = (yMax + yMin) / 2;
49
- return [xCenter - newWidth / 2, yCenter - newHeight / 2, xCenter + newWidth / 2, yCenter + newHeight / 2];
50
- }
51
- export function getTextureCoordinates(point, bounds) {
52
- const [xMin, yMin, xMax, yMax] = bounds;
53
- return [(point[0] - xMin) / (xMax - xMin), (point[1] - yMin) / (yMax - yMin)];
54
- }
55
- //# sourceMappingURL=heatmap-layer-utils.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/heatmap-layer/heatmap-layer-utils.ts"],"names":["getBounds","points","x","map","p","y","xMin","Math","min","apply","xMax","max","yMin","yMax","boundsContain","currentBounds","targetBounds","scratchArray","Float32Array","packVertices","dimensions","index","point","i","scaleToAspectRatio","boundingBox","width","height","currentWidth","currentHeight","newWidth","newHeight","xCenter","yCenter","getTextureCoordinates","bounds"],"mappings":"AAAA,OAAO,SAASA,SAAT,CAAmBC,MAAnB,EAAiD;AAEtD,QAAMC,CAAC,GAAGD,MAAM,CAACE,GAAP,CAAWC,CAAC,IAAIA,CAAC,CAAC,CAAD,CAAjB,CAAV;AACA,QAAMC,CAAC,GAAGJ,MAAM,CAACE,GAAP,CAAWC,CAAC,IAAIA,CAAC,CAAC,CAAD,CAAjB,CAAV;AAEA,QAAME,IAAI,GAAGC,IAAI,CAACC,GAAL,CAASC,KAAT,CAAe,IAAf,EAAqBP,CAArB,CAAb;AACA,QAAMQ,IAAI,GAAGH,IAAI,CAACI,GAAL,CAASF,KAAT,CAAe,IAAf,EAAqBP,CAArB,CAAb;AACA,QAAMU,IAAI,GAAGL,IAAI,CAACC,GAAL,CAASC,KA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AACA,QAAMuB,aAAa,GAAGhB,IAAI,GAAGD,IAA7B;AAEA,MAAIkB,QAAQ,GAAGF,YAAf;AACA,MAAIG,SAAS,GAAGF,aAAhB;;AACA,MAAID,YAAY,GAAGC,aAAf,GAA+BH,KAAK,GAAGC,MAA3C,EAAmD;AAEjDG,IAAAA,QAAQ,GAAIJ,KAAK,GAAGC,MAAT,GAAmBE,aAA9B;AACD,GAHD,MAGO;AACLE,IAAAA,SAAS,GAAIJ,MAAM,GAAGD,KAAV,GAAmBE,YAA/B;AACD;;AAED,MAAIE,QAAQ,GAAGJ,KAAf,EAAsB;AACpBI,IAAAA,QAAQ,GAAGJ,KAAX;AACAK,IAAAA,SAAS,GAAGJ,MAAZ;AACD;;AAED,QAAMK,OAAO,GAAG,CAACtB,IAAI,GAAGJ,IAAR,IAAgB,CAAhC;AACA,QAAM2B,OAAO,GAAG,CAACpB,IAAI,GAAGD,IAAR,IAAgB,CAAhC;AAEA,SAAO,CACLoB,OAAO,GAAGF,QAAQ,GAAG,CADhB,EAELG,OAAO,GAAGF,SAAS,GAAG,CAFjB,EAGLC,OAAO,GAAGF,QAAQ,GAAG,CAHhB,EAILG,OAAO,GAAGF,SAAS,GAAG,CAJjB,CAAP;AAMD;AAGD,OAAO,SAASG,qBAAT,CAA+BZ,KAA/B,EAAgDa,MAAhD,EAAkE;AACvE,QAAM,CAAC7B,IAAD,EAAOM,IAAP,EAAaF,IAAb,EAAmBG,IAAnB,IAA2BsB,MAAjC;AACA,SAAO,CAAC,CAACb,KAAK,CAAC,CAAD,CAAL,GAAWhB,IAAZ,KAAqBI,IAAI,GAAGJ,IAA5B,CAAD,EAAoC,CAACgB,KAAK,CAAC,CAAD,CAAL,GAAWV,IAAZ,KAAqBC,IAAI,GAAGD,IAA5B,CAApC,CAAP;AACD","sourcesContent":["export function getBounds(points: number[][]): number[] {\n // Now build bounding box in world space (aligned to world coordiante system)\n const x = points.map(p => p[0]);\n const y = points.map(p => p[1]);\n\n const xMin = Math.min.apply(null, x);\n const xMax = Math.max.apply(null, x);\n const yMin = Math.min.apply(null, y);\n const yMax = Math.max.apply(null, y);\n\n return [xMin, yMin, xMax, yMax];\n}\n\n// true if currentBounds contains targetBounds, false otherwise\nexport function boundsContain(currentBounds: number[], targetBounds: number[]): boolean {\n if (\n targetBounds[0] >= currentBounds[0] &&\n targetBounds[2] <= currentBounds[2] &&\n targetBounds[1] >= currentBounds[1] &&\n targetBounds[3] <= currentBounds[3]\n ) {\n return true;\n }\n return false;\n}\n\nconst scratchArray = new Float32Array(12);\n\n// For given rectangle bounds generates two triangles vertices that coverit completely\nexport function packVertices(points: number[][], dimensions: number = 2): Float32Array {\n let index = 0;\n for (const point of points) {\n for (let i = 0; i < dimensions; i++) {\n scratchArray[index++] = point[i] || 0;\n }\n }\n return scratchArray;\n}\n\n// Expands boundingBox:[xMin, yMin, xMax, yMax] to match aspect ratio of given width and height\nexport function scaleToAspectRatio(boundingBox: number[], width: number, height: number): number[] {\n const [xMin, yMin, xMax, yMax] = boundingBox;\n\n const currentWidth = xMax - xMin;\n const currentHeight = yMax - yMin;\n\n let newWidth = currentWidth;\n let newHeight = currentHeight;\n if (currentWidth / currentHeight < width / height) {\n // expand bounding box width\n newWidth = (width / height) * currentHeight;\n } else {\n newHeight = (height / width) * currentWidth;\n }\n\n if (newWidth < width) {\n newWidth = width;\n newHeight = height;\n }\n\n const xCenter = (xMax + xMin) / 2;\n const yCenter = (yMax + yMin) / 2;\n\n return [\n xCenter - newWidth / 2,\n yCenter - newHeight / 2,\n xCenter + newWidth / 2,\n yCenter + newHeight / 2\n ];\n}\n\n// Get texture coordiante of point inside a bounding box\nexport function getTextureCoordinates(point: number[], bounds: number[]) {\n const [xMin, yMin, xMax, yMax] = bounds;\n return [(point[0] - xMin) / (xMax - xMin), (point[1] - yMin) / (yMax - yMin)];\n}\n"],"file":"heatmap-layer-utils.js"}