@deck.gl/aggregation-layers 9.0.0-beta.1 → 9.0.0-beta.11

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 (362) hide show
  1. package/{typed → dist}/aggregation-layer.d.ts +2 -2
  2. package/dist/aggregation-layer.d.ts.map +1 -0
  3. package/dist/aggregation-layer.js +153 -0
  4. package/{typed → dist}/contour-layer/contour-layer.d.ts +1 -1
  5. package/dist/contour-layer/contour-layer.d.ts.map +1 -0
  6. package/dist/contour-layer/contour-layer.js +240 -0
  7. package/dist/contour-layer/contour-utils.js +64 -0
  8. package/dist/contour-layer/marching-squares-codes.js +337 -0
  9. package/dist/contour-layer/marching-squares.js +147 -0
  10. package/{typed → dist}/cpu-grid-layer/cpu-grid-layer.d.ts +3 -3
  11. package/dist/cpu-grid-layer/cpu-grid-layer.d.ts.map +1 -0
  12. package/dist/cpu-grid-layer/cpu-grid-layer.js +129 -0
  13. package/dist/cpu-grid-layer/grid-aggregator.js +141 -0
  14. package/dist/dist.dev.js +1442 -10868
  15. package/dist/gpu-grid-layer/gpu-grid-cell-layer-fragment.glsl.js +30 -0
  16. package/dist/gpu-grid-layer/gpu-grid-cell-layer-vertex.glsl.js +112 -0
  17. package/{typed → dist}/gpu-grid-layer/gpu-grid-cell-layer.d.ts +1 -1
  18. package/dist/gpu-grid-layer/gpu-grid-cell-layer.d.ts.map +1 -0
  19. package/dist/gpu-grid-layer/gpu-grid-cell-layer.js +145 -0
  20. package/{typed → dist}/gpu-grid-layer/gpu-grid-layer.d.ts +4 -4
  21. package/dist/gpu-grid-layer/gpu-grid-layer.d.ts.map +1 -0
  22. package/dist/gpu-grid-layer/gpu-grid-layer.js +288 -0
  23. package/{typed → dist}/grid-aggregation-layer.d.ts +3 -3
  24. package/dist/grid-aggregation-layer.d.ts.map +1 -0
  25. package/dist/grid-aggregation-layer.js +172 -0
  26. package/{typed → dist}/grid-layer/grid-layer.d.ts +2 -2
  27. package/dist/grid-layer/grid-layer.d.ts.map +1 -0
  28. package/dist/grid-layer/grid-layer.js +63 -0
  29. package/{typed → dist}/heatmap-layer/heatmap-layer-utils.d.ts +0 -9
  30. package/dist/heatmap-layer/heatmap-layer-utils.d.ts.map +1 -0
  31. package/dist/heatmap-layer/heatmap-layer-utils.js +63 -0
  32. package/{typed → dist}/heatmap-layer/heatmap-layer.d.ts +5 -6
  33. package/dist/heatmap-layer/heatmap-layer.d.ts.map +1 -0
  34. package/dist/heatmap-layer/heatmap-layer.js +455 -0
  35. package/dist/heatmap-layer/max-fs.glsl.js +9 -0
  36. package/dist/heatmap-layer/max-vs.glsl.d.ts +3 -0
  37. package/{typed → dist}/heatmap-layer/max-vs.glsl.d.ts.map +1 -1
  38. package/dist/heatmap-layer/max-vs.glsl.js +15 -0
  39. package/dist/heatmap-layer/triangle-layer-fragment.glsl.d.ts +3 -0
  40. package/dist/heatmap-layer/triangle-layer-fragment.glsl.js +51 -0
  41. package/dist/heatmap-layer/triangle-layer-vertex.glsl.js +47 -0
  42. package/{typed → dist}/heatmap-layer/triangle-layer.d.ts +10 -2
  43. package/dist/heatmap-layer/triangle-layer.d.ts.map +1 -0
  44. package/dist/heatmap-layer/triangle-layer.js +59 -0
  45. package/dist/heatmap-layer/weights-fs.glsl.js +17 -0
  46. package/dist/heatmap-layer/weights-vs.glsl.d.ts +3 -0
  47. package/{typed → dist}/heatmap-layer/weights-vs.glsl.d.ts.map +1 -1
  48. package/dist/heatmap-layer/weights-vs.glsl.js +21 -0
  49. package/dist/hexagon-layer/hexagon-aggregator.js +112 -0
  50. package/{typed → dist}/hexagon-layer/hexagon-layer.d.ts +4 -4
  51. package/dist/hexagon-layer/hexagon-layer.d.ts.map +1 -0
  52. package/dist/hexagon-layer/hexagon-layer.js +173 -0
  53. package/dist/index.cjs +4328 -0
  54. package/dist/index.cjs.map +7 -0
  55. package/dist/index.d.ts +20 -0
  56. package/dist/index.d.ts.map +1 -0
  57. package/dist/index.js +32 -0
  58. package/{typed → dist}/screen-grid-layer/screen-grid-cell-layer.d.ts +2 -3
  59. package/dist/screen-grid-layer/screen-grid-cell-layer.d.ts.map +1 -0
  60. package/dist/screen-grid-layer/screen-grid-cell-layer.js +164 -0
  61. package/dist/screen-grid-layer/screen-grid-layer-fragment.glsl.js +35 -0
  62. package/dist/screen-grid-layer/screen-grid-layer-vertex.glsl.js +72 -0
  63. package/{typed → dist}/screen-grid-layer/screen-grid-layer.d.ts +1 -4
  64. package/dist/screen-grid-layer/screen-grid-layer.d.ts.map +1 -0
  65. package/dist/screen-grid-layer/screen-grid-layer.js +209 -0
  66. package/dist/types.js +1 -0
  67. package/dist/utils/aggregation-operation-utils.js +94 -0
  68. package/{typed → dist}/utils/bin-sorter.d.ts +1 -1
  69. package/dist/utils/bin-sorter.js +167 -0
  70. package/dist/utils/color-utils.js +53 -0
  71. package/dist/utils/cpu-aggregator.js +421 -0
  72. package/dist/utils/gpu-grid-aggregation/aggregate-all-fs.glsl.js +36 -0
  73. package/dist/utils/gpu-grid-aggregation/aggregate-all-vs.glsl.js +42 -0
  74. package/dist/utils/gpu-grid-aggregation/aggregate-to-grid-fs.glsl.js +30 -0
  75. package/dist/utils/gpu-grid-aggregation/aggregate-to-grid-vs.glsl.js +61 -0
  76. package/dist/utils/gpu-grid-aggregation/gpu-grid-aggregator-constants.js +41 -0
  77. package/dist/utils/gpu-grid-aggregation/gpu-grid-aggregator-utils.js +1 -0
  78. package/{typed → dist}/utils/gpu-grid-aggregation/gpu-grid-aggregator.d.ts.map +1 -1
  79. package/dist/utils/gpu-grid-aggregation/gpu-grid-aggregator.js +555 -0
  80. package/dist/utils/gpu-grid-aggregation/transform-mean-vs.glsl.js +32 -0
  81. package/dist/utils/grid-aggregation-utils.js +114 -0
  82. package/dist/utils/prop-utils.js +28 -0
  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 -2
  88. package/src/contour-layer/contour-layer.ts +2 -3
  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 +2 -2
  92. package/src/heatmap-layer/heatmap-layer-utils.ts +0 -23
  93. package/src/heatmap-layer/heatmap-layer.ts +91 -127
  94. package/src/heatmap-layer/max-vs.glsl.ts +11 -5
  95. package/src/heatmap-layer/triangle-layer-fragment.glsl.ts +2 -2
  96. package/src/heatmap-layer/triangle-layer.ts +17 -23
  97. package/src/heatmap-layer/weights-vs.glsl.ts +4 -2
  98. package/src/hexagon-layer/hexagon-layer.ts +2 -3
  99. package/src/screen-grid-layer/screen-grid-cell-layer.ts +3 -6
  100. package/src/screen-grid-layer/screen-grid-layer.ts +1 -11
  101. package/src/utils/gpu-grid-aggregation/gpu-grid-aggregator.ts +16 -30
  102. package/dist/es5/aggregation-layer.js +0 -215
  103. package/dist/es5/aggregation-layer.js.map +0 -1
  104. package/dist/es5/contour-layer/contour-layer.js +0 -353
  105. package/dist/es5/contour-layer/contour-layer.js.map +0 -1
  106. package/dist/es5/contour-layer/contour-utils.js +0 -110
  107. package/dist/es5/contour-layer/contour-utils.js.map +0 -1
  108. package/dist/es5/contour-layer/marching-squares-codes.js +0 -152
  109. package/dist/es5/contour-layer/marching-squares-codes.js.map +0 -1
  110. package/dist/es5/contour-layer/marching-squares.js +0 -168
  111. package/dist/es5/contour-layer/marching-squares.js.map +0 -1
  112. package/dist/es5/cpu-grid-layer/cpu-grid-layer.js +0 -235
  113. package/dist/es5/cpu-grid-layer/cpu-grid-layer.js.map +0 -1
  114. package/dist/es5/cpu-grid-layer/grid-aggregator.js +0 -180
  115. package/dist/es5/cpu-grid-layer/grid-aggregator.js.map +0 -1
  116. package/dist/es5/gpu-grid-layer/gpu-grid-cell-layer-fragment.glsl.js +0 -9
  117. package/dist/es5/gpu-grid-layer/gpu-grid-cell-layer-fragment.glsl.js.map +0 -1
  118. package/dist/es5/gpu-grid-layer/gpu-grid-cell-layer-vertex.glsl.js +0 -9
  119. package/dist/es5/gpu-grid-layer/gpu-grid-cell-layer-vertex.glsl.js.map +0 -1
  120. package/dist/es5/gpu-grid-layer/gpu-grid-cell-layer.js +0 -247
  121. package/dist/es5/gpu-grid-layer/gpu-grid-cell-layer.js.map +0 -1
  122. package/dist/es5/gpu-grid-layer/gpu-grid-layer.js +0 -424
  123. package/dist/es5/gpu-grid-layer/gpu-grid-layer.js.map +0 -1
  124. package/dist/es5/grid-aggregation-layer.js +0 -280
  125. package/dist/es5/grid-aggregation-layer.js.map +0 -1
  126. package/dist/es5/grid-layer/grid-layer.js +0 -125
  127. package/dist/es5/grid-layer/grid-layer.js.map +0 -1
  128. package/dist/es5/heatmap-layer/heatmap-layer-utils.js +0 -122
  129. package/dist/es5/heatmap-layer/heatmap-layer-utils.js.map +0 -1
  130. package/dist/es5/heatmap-layer/heatmap-layer.js +0 -672
  131. package/dist/es5/heatmap-layer/heatmap-layer.js.map +0 -1
  132. package/dist/es5/heatmap-layer/max-fs.glsl.js +0 -9
  133. package/dist/es5/heatmap-layer/max-fs.glsl.js.map +0 -1
  134. package/dist/es5/heatmap-layer/max-vs.glsl.js +0 -9
  135. package/dist/es5/heatmap-layer/max-vs.glsl.js.map +0 -1
  136. package/dist/es5/heatmap-layer/triangle-layer-fragment.glsl.js +0 -9
  137. package/dist/es5/heatmap-layer/triangle-layer-fragment.glsl.js.map +0 -1
  138. package/dist/es5/heatmap-layer/triangle-layer-vertex.glsl.js +0 -9
  139. package/dist/es5/heatmap-layer/triangle-layer-vertex.glsl.js.map +0 -1
  140. package/dist/es5/heatmap-layer/triangle-layer.js +0 -122
  141. package/dist/es5/heatmap-layer/triangle-layer.js.map +0 -1
  142. package/dist/es5/heatmap-layer/weights-fs.glsl.js +0 -9
  143. package/dist/es5/heatmap-layer/weights-fs.glsl.js.map +0 -1
  144. package/dist/es5/heatmap-layer/weights-vs.glsl.js +0 -9
  145. package/dist/es5/heatmap-layer/weights-vs.glsl.js.map +0 -1
  146. package/dist/es5/hexagon-layer/hexagon-aggregator.js +0 -118
  147. package/dist/es5/hexagon-layer/hexagon-aggregator.js.map +0 -1
  148. package/dist/es5/hexagon-layer/hexagon-layer.js +0 -289
  149. package/dist/es5/hexagon-layer/hexagon-layer.js.map +0 -1
  150. package/dist/es5/index.js +0 -104
  151. package/dist/es5/index.js.map +0 -1
  152. package/dist/es5/screen-grid-layer/screen-grid-cell-layer.js +0 -244
  153. package/dist/es5/screen-grid-layer/screen-grid-cell-layer.js.map +0 -1
  154. package/dist/es5/screen-grid-layer/screen-grid-layer-fragment.glsl.js +0 -9
  155. package/dist/es5/screen-grid-layer/screen-grid-layer-fragment.glsl.js.map +0 -1
  156. package/dist/es5/screen-grid-layer/screen-grid-layer-vertex.glsl.js +0 -9
  157. package/dist/es5/screen-grid-layer/screen-grid-layer-vertex.glsl.js.map +0 -1
  158. package/dist/es5/screen-grid-layer/screen-grid-layer.js +0 -317
  159. package/dist/es5/screen-grid-layer/screen-grid-layer.js.map +0 -1
  160. package/dist/es5/types.js +0 -2
  161. package/dist/es5/types.js.map +0 -1
  162. package/dist/es5/utils/aggregation-operation-utils.js +0 -123
  163. package/dist/es5/utils/aggregation-operation-utils.js.map +0 -1
  164. package/dist/es5/utils/bin-sorter.js +0 -248
  165. package/dist/es5/utils/bin-sorter.js.map +0 -1
  166. package/dist/es5/utils/color-utils.js +0 -39
  167. package/dist/es5/utils/color-utils.js.map +0 -1
  168. package/dist/es5/utils/cpu-aggregator.js +0 -496
  169. package/dist/es5/utils/cpu-aggregator.js.map +0 -1
  170. package/dist/es5/utils/gpu-grid-aggregation/aggregate-all-fs.glsl.js +0 -9
  171. package/dist/es5/utils/gpu-grid-aggregation/aggregate-all-fs.glsl.js.map +0 -1
  172. package/dist/es5/utils/gpu-grid-aggregation/aggregate-all-vs.glsl.js +0 -9
  173. package/dist/es5/utils/gpu-grid-aggregation/aggregate-all-vs.glsl.js.map +0 -1
  174. package/dist/es5/utils/gpu-grid-aggregation/aggregate-to-grid-fs.glsl.js +0 -9
  175. package/dist/es5/utils/gpu-grid-aggregation/aggregate-to-grid-fs.glsl.js.map +0 -1
  176. package/dist/es5/utils/gpu-grid-aggregation/aggregate-to-grid-vs.glsl.js +0 -9
  177. package/dist/es5/utils/gpu-grid-aggregation/aggregate-to-grid-vs.glsl.js.map +0 -1
  178. package/dist/es5/utils/gpu-grid-aggregation/gpu-grid-aggregator-constants.js +0 -63
  179. package/dist/es5/utils/gpu-grid-aggregation/gpu-grid-aggregator-constants.js.map +0 -1
  180. package/dist/es5/utils/gpu-grid-aggregation/gpu-grid-aggregator-utils.js +0 -2
  181. package/dist/es5/utils/gpu-grid-aggregation/gpu-grid-aggregator-utils.js.map +0 -1
  182. package/dist/es5/utils/gpu-grid-aggregation/gpu-grid-aggregator.js +0 -732
  183. package/dist/es5/utils/gpu-grid-aggregation/gpu-grid-aggregator.js.map +0 -1
  184. package/dist/es5/utils/gpu-grid-aggregation/gpu-grid-aggregator.md +0 -155
  185. package/dist/es5/utils/gpu-grid-aggregation/transform-mean-vs.glsl.js +0 -9
  186. package/dist/es5/utils/gpu-grid-aggregation/transform-mean-vs.glsl.js.map +0 -1
  187. package/dist/es5/utils/grid-aggregation-utils.js +0 -118
  188. package/dist/es5/utils/grid-aggregation-utils.js.map +0 -1
  189. package/dist/es5/utils/prop-utils.js +0 -19
  190. package/dist/es5/utils/prop-utils.js.map +0 -1
  191. package/dist/es5/utils/resource-utils.js +0 -59
  192. package/dist/es5/utils/resource-utils.js.map +0 -1
  193. package/dist/es5/utils/scale-utils.js +0 -254
  194. package/dist/es5/utils/scale-utils.js.map +0 -1
  195. package/dist/esm/aggregation-layer.js +0 -156
  196. package/dist/esm/aggregation-layer.js.map +0 -1
  197. package/dist/esm/contour-layer/contour-layer.js +0 -316
  198. package/dist/esm/contour-layer/contour-layer.js.map +0 -1
  199. package/dist/esm/contour-layer/contour-utils.js +0 -81
  200. package/dist/esm/contour-layer/contour-utils.js.map +0 -1
  201. package/dist/esm/contour-layer/marching-squares-codes.js +0 -219
  202. package/dist/esm/contour-layer/marching-squares-codes.js.map +0 -1
  203. package/dist/esm/contour-layer/marching-squares.js +0 -151
  204. package/dist/esm/contour-layer/marching-squares.js.map +0 -1
  205. package/dist/esm/cpu-grid-layer/cpu-grid-layer.js +0 -186
  206. package/dist/esm/cpu-grid-layer/cpu-grid-layer.js.map +0 -1
  207. package/dist/esm/cpu-grid-layer/grid-aggregator.js +0 -142
  208. package/dist/esm/cpu-grid-layer/grid-aggregator.js.map +0 -1
  209. package/dist/esm/gpu-grid-layer/gpu-grid-cell-layer-fragment.glsl.js +0 -16
  210. package/dist/esm/gpu-grid-layer/gpu-grid-cell-layer-fragment.glsl.js.map +0 -1
  211. package/dist/esm/gpu-grid-layer/gpu-grid-cell-layer-vertex.glsl.js +0 -122
  212. package/dist/esm/gpu-grid-layer/gpu-grid-cell-layer-vertex.glsl.js.map +0 -1
  213. package/dist/esm/gpu-grid-layer/gpu-grid-cell-layer.js +0 -196
  214. package/dist/esm/gpu-grid-layer/gpu-grid-cell-layer.js.map +0 -1
  215. package/dist/esm/gpu-grid-layer/gpu-grid-layer.js +0 -399
  216. package/dist/esm/gpu-grid-layer/gpu-grid-layer.js.map +0 -1
  217. package/dist/esm/grid-aggregation-layer.js +0 -240
  218. package/dist/esm/grid-aggregation-layer.js.map +0 -1
  219. package/dist/esm/grid-layer/grid-layer.js +0 -80
  220. package/dist/esm/grid-layer/grid-layer.js.map +0 -1
  221. package/dist/esm/heatmap-layer/heatmap-layer-utils.js +0 -68
  222. package/dist/esm/heatmap-layer/heatmap-layer-utils.js.map +0 -1
  223. package/dist/esm/heatmap-layer/heatmap-layer.js +0 -626
  224. package/dist/esm/heatmap-layer/heatmap-layer.js.map +0 -1
  225. package/dist/esm/heatmap-layer/max-fs.glsl.js +0 -10
  226. package/dist/esm/heatmap-layer/max-fs.glsl.js.map +0 -1
  227. package/dist/esm/heatmap-layer/max-vs.glsl.js +0 -14
  228. package/dist/esm/heatmap-layer/max-vs.glsl.js.map +0 -1
  229. package/dist/esm/heatmap-layer/triangle-layer-fragment.glsl.js +0 -43
  230. package/dist/esm/heatmap-layer/triangle-layer-fragment.glsl.js.map +0 -1
  231. package/dist/esm/heatmap-layer/triangle-layer-vertex.glsl.js +0 -33
  232. package/dist/esm/heatmap-layer/triangle-layer-vertex.glsl.js.map +0 -1
  233. package/dist/esm/heatmap-layer/triangle-layer.js +0 -80
  234. package/dist/esm/heatmap-layer/triangle-layer.js.map +0 -1
  235. package/dist/esm/heatmap-layer/weights-fs.glsl.js +0 -22
  236. package/dist/esm/heatmap-layer/weights-fs.glsl.js.map +0 -1
  237. package/dist/esm/heatmap-layer/weights-vs.glsl.js +0 -25
  238. package/dist/esm/heatmap-layer/weights-vs.glsl.js.map +0 -1
  239. package/dist/esm/hexagon-layer/hexagon-aggregator.js +0 -87
  240. package/dist/esm/hexagon-layer/hexagon-aggregator.js.map +0 -1
  241. package/dist/esm/hexagon-layer/hexagon-layer.js +0 -232
  242. package/dist/esm/hexagon-layer/hexagon-layer.js.map +0 -1
  243. package/dist/esm/index.js +0 -13
  244. package/dist/esm/index.js.map +0 -1
  245. package/dist/esm/screen-grid-layer/screen-grid-cell-layer.js +0 -203
  246. package/dist/esm/screen-grid-layer/screen-grid-cell-layer.js.map +0 -1
  247. package/dist/esm/screen-grid-layer/screen-grid-layer-fragment.glsl.js +0 -21
  248. package/dist/esm/screen-grid-layer/screen-grid-layer-fragment.glsl.js.map +0 -1
  249. package/dist/esm/screen-grid-layer/screen-grid-layer-vertex.glsl.js +0 -66
  250. package/dist/esm/screen-grid-layer/screen-grid-layer-vertex.glsl.js.map +0 -1
  251. package/dist/esm/screen-grid-layer/screen-grid-layer.js +0 -285
  252. package/dist/esm/screen-grid-layer/screen-grid-layer.js.map +0 -1
  253. package/dist/esm/types.js +0 -2
  254. package/dist/esm/types.js.map +0 -1
  255. package/dist/esm/utils/aggregation-operation-utils.js +0 -91
  256. package/dist/esm/utils/aggregation-operation-utils.js.map +0 -1
  257. package/dist/esm/utils/bin-sorter.js +0 -165
  258. package/dist/esm/utils/bin-sorter.js.map +0 -1
  259. package/dist/esm/utils/color-utils.js +0 -28
  260. package/dist/esm/utils/color-utils.js.map +0 -1
  261. package/dist/esm/utils/cpu-aggregator.js +0 -487
  262. package/dist/esm/utils/cpu-aggregator.js.map +0 -1
  263. package/dist/esm/utils/gpu-grid-aggregation/aggregate-all-fs.glsl.js +0 -21
  264. package/dist/esm/utils/gpu-grid-aggregation/aggregate-all-fs.glsl.js.map +0 -1
  265. package/dist/esm/utils/gpu-grid-aggregation/aggregate-all-vs.glsl.js +0 -35
  266. package/dist/esm/utils/gpu-grid-aggregation/aggregate-all-vs.glsl.js.map +0 -1
  267. package/dist/esm/utils/gpu-grid-aggregation/aggregate-to-grid-fs.glsl.js +0 -16
  268. package/dist/esm/utils/gpu-grid-aggregation/aggregate-to-grid-fs.glsl.js.map +0 -1
  269. package/dist/esm/utils/gpu-grid-aggregation/aggregate-to-grid-vs.glsl.js +0 -60
  270. package/dist/esm/utils/gpu-grid-aggregation/aggregate-to-grid-vs.glsl.js.map +0 -1
  271. package/dist/esm/utils/gpu-grid-aggregation/gpu-grid-aggregator-constants.js +0 -42
  272. package/dist/esm/utils/gpu-grid-aggregation/gpu-grid-aggregator-constants.js.map +0 -1
  273. package/dist/esm/utils/gpu-grid-aggregation/gpu-grid-aggregator-utils.js +0 -2
  274. package/dist/esm/utils/gpu-grid-aggregation/gpu-grid-aggregator-utils.js.map +0 -1
  275. package/dist/esm/utils/gpu-grid-aggregation/gpu-grid-aggregator.js +0 -720
  276. package/dist/esm/utils/gpu-grid-aggregation/gpu-grid-aggregator.js.map +0 -1
  277. package/dist/esm/utils/gpu-grid-aggregation/gpu-grid-aggregator.md +0 -155
  278. package/dist/esm/utils/gpu-grid-aggregation/transform-mean-vs.glsl.js +0 -19
  279. package/dist/esm/utils/gpu-grid-aggregation/transform-mean-vs.glsl.js.map +0 -1
  280. package/dist/esm/utils/grid-aggregation-utils.js +0 -109
  281. package/dist/esm/utils/grid-aggregation-utils.js.map +0 -1
  282. package/dist/esm/utils/prop-utils.js +0 -12
  283. package/dist/esm/utils/prop-utils.js.map +0 -1
  284. package/dist/esm/utils/resource-utils.js +0 -44
  285. package/dist/esm/utils/resource-utils.js.map +0 -1
  286. package/dist/esm/utils/scale-utils.js +0 -192
  287. package/dist/esm/utils/scale-utils.js.map +0 -1
  288. package/typed/aggregation-layer.d.ts.map +0 -1
  289. package/typed/contour-layer/contour-layer.d.ts.map +0 -1
  290. package/typed/cpu-grid-layer/cpu-grid-layer.d.ts.map +0 -1
  291. package/typed/gpu-grid-layer/gpu-grid-cell-layer.d.ts.map +0 -1
  292. package/typed/gpu-grid-layer/gpu-grid-layer.d.ts.map +0 -1
  293. package/typed/grid-aggregation-layer.d.ts.map +0 -1
  294. package/typed/grid-layer/grid-layer.d.ts.map +0 -1
  295. package/typed/heatmap-layer/heatmap-layer-utils.d.ts.map +0 -1
  296. package/typed/heatmap-layer/heatmap-layer.d.ts.map +0 -1
  297. package/typed/heatmap-layer/max-vs.glsl.d.ts +0 -3
  298. package/typed/heatmap-layer/triangle-layer-fragment.glsl.d.ts +0 -3
  299. package/typed/heatmap-layer/triangle-layer.d.ts.map +0 -1
  300. package/typed/heatmap-layer/weights-vs.glsl.d.ts +0 -3
  301. package/typed/hexagon-layer/hexagon-layer.d.ts.map +0 -1
  302. package/typed/index.d.ts +0 -20
  303. package/typed/index.d.ts.map +0 -1
  304. package/typed/screen-grid-layer/screen-grid-cell-layer.d.ts.map +0 -1
  305. package/typed/screen-grid-layer/screen-grid-layer.d.ts.map +0 -1
  306. /package/{typed → dist}/contour-layer/contour-utils.d.ts +0 -0
  307. /package/{typed → dist}/contour-layer/contour-utils.d.ts.map +0 -0
  308. /package/{typed → dist}/contour-layer/marching-squares-codes.d.ts +0 -0
  309. /package/{typed → dist}/contour-layer/marching-squares-codes.d.ts.map +0 -0
  310. /package/{typed → dist}/contour-layer/marching-squares.d.ts +0 -0
  311. /package/{typed → dist}/contour-layer/marching-squares.d.ts.map +0 -0
  312. /package/{typed → dist}/cpu-grid-layer/grid-aggregator.d.ts +0 -0
  313. /package/{typed → dist}/cpu-grid-layer/grid-aggregator.d.ts.map +0 -0
  314. /package/{typed → dist}/gpu-grid-layer/gpu-grid-cell-layer-fragment.glsl.d.ts +0 -0
  315. /package/{typed → dist}/gpu-grid-layer/gpu-grid-cell-layer-fragment.glsl.d.ts.map +0 -0
  316. /package/{typed → dist}/gpu-grid-layer/gpu-grid-cell-layer-vertex.glsl.d.ts +0 -0
  317. /package/{typed → dist}/gpu-grid-layer/gpu-grid-cell-layer-vertex.glsl.d.ts.map +0 -0
  318. /package/{typed → dist}/heatmap-layer/max-fs.glsl.d.ts +0 -0
  319. /package/{typed → dist}/heatmap-layer/max-fs.glsl.d.ts.map +0 -0
  320. /package/{typed → dist}/heatmap-layer/triangle-layer-fragment.glsl.d.ts.map +0 -0
  321. /package/{typed → dist}/heatmap-layer/triangle-layer-vertex.glsl.d.ts +0 -0
  322. /package/{typed → dist}/heatmap-layer/triangle-layer-vertex.glsl.d.ts.map +0 -0
  323. /package/{typed → dist}/heatmap-layer/weights-fs.glsl.d.ts +0 -0
  324. /package/{typed → dist}/heatmap-layer/weights-fs.glsl.d.ts.map +0 -0
  325. /package/{typed → dist}/hexagon-layer/hexagon-aggregator.d.ts +0 -0
  326. /package/{typed → dist}/hexagon-layer/hexagon-aggregator.d.ts.map +0 -0
  327. /package/{typed → dist}/screen-grid-layer/screen-grid-layer-fragment.glsl.d.ts +0 -0
  328. /package/{typed → dist}/screen-grid-layer/screen-grid-layer-fragment.glsl.d.ts.map +0 -0
  329. /package/{typed → dist}/screen-grid-layer/screen-grid-layer-vertex.glsl.d.ts +0 -0
  330. /package/{typed → dist}/screen-grid-layer/screen-grid-layer-vertex.glsl.d.ts.map +0 -0
  331. /package/{typed → dist}/types.d.ts +0 -0
  332. /package/{typed → dist}/types.d.ts.map +0 -0
  333. /package/{typed → dist}/utils/aggregation-operation-utils.d.ts +0 -0
  334. /package/{typed → dist}/utils/aggregation-operation-utils.d.ts.map +0 -0
  335. /package/{typed → dist}/utils/bin-sorter.d.ts.map +0 -0
  336. /package/{typed → dist}/utils/color-utils.d.ts +0 -0
  337. /package/{typed → dist}/utils/color-utils.d.ts.map +0 -0
  338. /package/{typed → dist}/utils/cpu-aggregator.d.ts +0 -0
  339. /package/{typed → dist}/utils/cpu-aggregator.d.ts.map +0 -0
  340. /package/{typed → dist}/utils/gpu-grid-aggregation/aggregate-all-fs.glsl.d.ts +0 -0
  341. /package/{typed → dist}/utils/gpu-grid-aggregation/aggregate-all-fs.glsl.d.ts.map +0 -0
  342. /package/{typed → dist}/utils/gpu-grid-aggregation/aggregate-all-vs.glsl.d.ts +0 -0
  343. /package/{typed → dist}/utils/gpu-grid-aggregation/aggregate-all-vs.glsl.d.ts.map +0 -0
  344. /package/{typed → dist}/utils/gpu-grid-aggregation/aggregate-to-grid-fs.glsl.d.ts +0 -0
  345. /package/{typed → dist}/utils/gpu-grid-aggregation/aggregate-to-grid-fs.glsl.d.ts.map +0 -0
  346. /package/{typed → dist}/utils/gpu-grid-aggregation/aggregate-to-grid-vs.glsl.d.ts +0 -0
  347. /package/{typed → dist}/utils/gpu-grid-aggregation/aggregate-to-grid-vs.glsl.d.ts.map +0 -0
  348. /package/{typed → dist}/utils/gpu-grid-aggregation/gpu-grid-aggregator-constants.d.ts +0 -0
  349. /package/{typed → dist}/utils/gpu-grid-aggregation/gpu-grid-aggregator-constants.d.ts.map +0 -0
  350. /package/{typed → dist}/utils/gpu-grid-aggregation/gpu-grid-aggregator-utils.d.ts +0 -0
  351. /package/{typed → dist}/utils/gpu-grid-aggregation/gpu-grid-aggregator-utils.d.ts.map +0 -0
  352. /package/{typed → dist}/utils/gpu-grid-aggregation/gpu-grid-aggregator.d.ts +0 -0
  353. /package/{typed → dist}/utils/gpu-grid-aggregation/transform-mean-vs.glsl.d.ts +0 -0
  354. /package/{typed → dist}/utils/gpu-grid-aggregation/transform-mean-vs.glsl.d.ts.map +0 -0
  355. /package/{typed → dist}/utils/grid-aggregation-utils.d.ts +0 -0
  356. /package/{typed → dist}/utils/grid-aggregation-utils.d.ts.map +0 -0
  357. /package/{typed → dist}/utils/prop-utils.d.ts +0 -0
  358. /package/{typed → dist}/utils/prop-utils.d.ts.map +0 -0
  359. /package/{typed → dist}/utils/resource-utils.d.ts +0 -0
  360. /package/{typed → dist}/utils/resource-utils.d.ts.map +0 -0
  361. /package/{typed → dist}/utils/scale-utils.d.ts +0 -0
  362. /package/{typed → dist}/utils/scale-utils.d.ts.map +0 -0
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/heatmap-layer/heatmap-layer.ts"],"names":["getBounds","boundsContain","packVertices","scaleToAspectRatio","getTextureCoordinates","getTextureParams","GL","TextureTransform","withGLParameters","AttributeManager","COORDINATE_SYSTEM","log","TriangleLayer","AggregationLayer","defaultColorRange","colorRangeToFlatArray","weightsVs","weightsFs","vsMax","fsMax","RESOLUTION","TEXTURE_PROPS","format","mipmaps","sampler","minFilter","magFilter","addressModeU","addressModeV","DEFAULT_COLOR_DOMAIN","AGGREGATION_MODE","SUM","MEAN","defaultProps","getPosition","type","value","x","position","getWeight","intensity","min","radiusPixels","max","colorRange","threshold","colorDomain","optional","aggregation","weightsTextureSize","debounceTimeout","REQUIRED_FEATURES","FLOAT_TARGET_FEATURES","DIMENSIONS","data","props","HeatmapLayer","state","initializeState","every","feature","context","device","features","has","setState","supported","error","id","initializeAggregationLayer","_setupTextureParams","_setupAttributes","_setupResources","shouldUpdateState","changeFlags","somethingChanged","updateState","opts","_updateHeatmapState","oldProps","_getChangeFlags","dataChanged","viewportChanged","boundsChanged","_updateBounds","_updateTextureRenderingBounds","clearTimeout","updateTimer","isWeightMapDirty","viewportZoomChanged","_debouncedUpdateWeightmap","_updateColorTexture","_updateWeightmap","zoom","viewport","renderLayers","weightsTexture","triPositionBuffer","triTexCoordBuffer","maxWeightsTexture","colorTexture","updateTriggers","TriangleLayerClass","getSubLayerClass","getSubLayerProps","coordinateSystem","DEFAULT","attributes","positions","texCoords","vertexCount","maxTexture","aggregationMode","texture","finalizeState","weightsTransform","maxWeightTransform","destroy","_getAttributeManager","stats","dimensions","isAttributeChanged","isAggregationDirty","compareAll","dimension","_createTextures","textureSize","createTexture","width","height","attributeManager","getAttributeManager","add","size","accessor","weights","positionAttributeName","Math","limits","maxTextureDimension2D","floatTargetSupport","weightsScale","warn","getShaders","vs","_fs","_createWeightsTransform","shaders","delete","targetTexture","targetTextureVarying","weightsTransformShaders","maxWeightsTransformShaders","_sourceTextures","inTexture","_targetTexture","_targetTextureVarying","elementCount","createBuffer","byteLength","updateShaders","shaderOptions","_updateMaxWeightValue","run","parameters","blend","depthTest","blendFunc","blendEquation","forceUpdate","viewportCorners","unproject","map","p","fround","visibleWorldBounds","newState","worldBounds","scaledCommonBounds","_worldToCommonBounds","_commonToWorldBounds","LNGLAT","normalizedCommonBounds","write","textureBounds","projectPosition","colors","Uint8Array","setImageData","length","commonBounds","useLayerCoordinateSystem","metersPerPixel","distanceScales","metersPerUnit","uniforms","textureWidth","update","getNumInstances","gl","clearColor","clearRenderTarget","getAttributes","moduleSettings","getModuleSettings","fromTimer","setTimeout","bind","minLong","minLat","maxLong","maxLat","offsetMode","LNGLAT_OFFSETS","METER_OFFSETS","offsetOriginCommon","coordinateOrigin","scale","bottomLeftCommon","topRightCommon","xMin","yMin","xMax","yMax","bottomLeftWorld","unprojectPosition","topRightWorld","slice","concat","layerName"],"mappings":"AAqBA,SACEA,SADF,EAEEC,aAFF,EAGEC,YAHF,EAIEC,kBAJF,EAKEC,qBALF,EAMEC,gBANF,QAOO,uBAPP;AASA,SAAQC,EAAR,QAAiB,oBAAjB;AACA,SAAQC,gBAAR,QAAsD,iBAAtD;AACA,SAAQC,gBAAR,QAA+B,gBAA/B;AACA,SAGEC,gBAHF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B,CAAzB;AAUD;;AAID+C,EAAAA,oBAAoB,CAACU,YAAD,EAAe;AACjC,UAAM,CAAC8B,IAAD,EAAOC,IAAP,EAAaC,IAAb,EAAmBC,IAAnB,IAA2BjC,YAAjC;AACA,UAAM;AAAChG,MAAAA;AAAD,QAAa,KAAKjC,OAAxB;AACA,UAAMmK,eAAe,GAAGlI,QAAQ,CAACmI,iBAAT,CAA2B,CAACL,IAAD,EAAOC,IAAP,CAA3B,CAAxB;AACA,UAAMK,aAAa,GAAGpI,QAAQ,CAACmI,iBAAT,CAA2B,CAACH,IAAD,EAAOC,IAAP,CAA3B,CAAtB;AAEA,WAAOC,eAAe,CAACG,KAAhB,CAAsB,CAAtB,EAAyB,CAAzB,EAA4BC,MAA5B,CAAmCF,aAAa,CAACC,KAAd,CAAoB,CAApB,EAAuB,CAAvB,CAAnC,CAAP;AACD;;AA9gBkF;AAHhE3K,Y,CAIZ6K,S,GAAY,c;AAJA7K,Y,CAKZvB,Y,GAAeA,Y","sourcesContent":["// Copyright (c) 2015 - 2019 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\n/* global setTimeout clearTimeout */\nimport {\n getBounds,\n boundsContain,\n packVertices,\n scaleToAspectRatio,\n getTextureCoordinates,\n getTextureParams\n} from './heatmap-layer-utils';\nimport {Buffer, DeviceFeature, Texture, TextureProps, TextureFormat} from '@luma.gl/core';\nimport {GL} from '@luma.gl/constants';\nimport {TextureTransform, TextureTransformProps} from '@luma.gl/engine';\nimport {withGLParameters} from '@luma.gl/webgl';\nimport {\n Accessor,\n AccessorFunction,\n AttributeManager,\n ChangeFlags,\n Color,\n COORDINATE_SYSTEM,\n Layer,\n LayerContext,\n LayersList,\n log,\n Position,\n UpdateParameters,\n DefaultProps\n} from '@deck.gl/core';\nimport TriangleLayer from './triangle-layer';\nimport AggregationLayer, {AggregationLayerProps} from '../aggregation-layer';\nimport {defaultColorRange, colorRangeToFlatArray} from '../utils/color-utils';\nimport weightsVs from './weights-vs.glsl';\nimport weightsFs from './weights-fs.glsl';\nimport vsMax from './max-vs.glsl';\nimport fsMax from './max-fs.glsl';\n\nconst RESOLUTION = 2; // (number of common space pixels) / (number texels)\nconst TEXTURE_PROPS: TextureProps = {\n format: 'rgba8unorm',\n mipmaps: false,\n sampler: {\n minFilter: 'nearest',\n magFilter: 'nearest',\n addressModeU: 'clamp-to-edge',\n addressModeV: 'clamp-to-edge'\n }\n};\nconst DEFAULT_COLOR_DOMAIN = [0, 0];\nconst AGGREGATION_MODE = {\n SUM: 0,\n MEAN: 1\n};\n\nconst defaultProps: DefaultProps<HeatmapLayerProps> = {\n getPosition: {type: 'accessor', value: (x: any) => x.position},\n getWeight: {type: 'accessor', value: 1},\n intensity: {type: 'number', min: 0, value: 1},\n radiusPixels: {type: 'number', min: 1, max: 100, value: 50},\n colorRange: defaultColorRange,\n threshold: {type: 'number', min: 0, max: 1, value: 0.05},\n colorDomain: {type: 'array', value: null, optional: true},\n // 'SUM' or 'MEAN'\n aggregation: 'SUM',\n weightsTextureSize: {type: 'number', min: 128, max: 2048, value: 2048},\n debounceTimeout: {type: 'number', min: 0, max: 1000, value: 500}\n};\n\nconst REQUIRED_FEATURES: DeviceFeature[] = [\n 'blend-minmax-webgl1', // max weight calculation\n 'texture-formats-float32-webgl1' // weight-map as texture\n];\n\nconst FLOAT_TARGET_FEATURES: DeviceFeature[] = [\n 'texture-renderable-float32-webgl', // ability to render to float texture\n 'texture-blend-float-webgl1' // ability to blend when rendering to float texture\n];\n\nconst DIMENSIONS = {\n data: {\n props: ['radiusPixels']\n }\n};\n\nexport type HeatmapLayerProps<DataT = unknown> = _HeatmapLayerProps<DataT> &\n AggregationLayerProps<DataT>;\n\ntype _HeatmapLayerProps<DataT> = {\n /**\n * Radius of the circle in pixels, to which the weight of an object is distributed.\n *\n * @default 30\n */\n radiusPixels?: number;\n\n /**\n * Specified as an array of colors [color1, color2, ...].\n *\n * @default `6-class YlOrRd` - [colorbrewer](http://colorbrewer2.org/#type=sequential&scheme=YlOrRd&n=6)\n */\n colorRange?: Color[];\n\n /**\n * Value that is multiplied with the total weight at a pixel to obtain the final weight.\n *\n * @default 1\n */\n intensity?: number;\n\n /**\n * Ratio of the fading weight to the max weight, between `0` and `1`.\n *\n * For example, `0.1` affects all pixels with weight under 10% of the max.\n *\n * Ignored when `colorDomain` is specified.\n * @default 0.05\n */\n threshold?: number;\n\n /**\n * Controls how weight values are mapped to the `colorRange`, as an array of two numbers [`minValue`, `maxValue`].\n *\n * @default null\n */\n colorDomain?: [number, number] | null;\n\n /**\n * Defines the type of aggregation operation\n *\n * V valid values are 'SUM', 'MEAN'.\n *\n * @default 'SUM'\n */\n aggregation?: 'SUM' | 'MEAN';\n\n /**\n * Specifies the size of weight texture.\n * @default 2048\n */\n weightsTextureSize?: number;\n\n /**\n * Interval in milliseconds during which changes to the viewport don't trigger aggregation.\n *\n * @default 500\n */\n debounceTimeout?: number;\n\n /**\n * Method called to retrieve the position of each object.\n *\n * @default d => d.position\n */\n getPosition?: AccessorFunction<DataT, Position>;\n\n /**\n * The weight of each object.\n *\n * @default 1\n */\n getWeight?: Accessor<DataT, number>;\n};\n\n/** Visualizes the spatial distribution of data. */\nexport default class HeatmapLayer<\n DataT = any,\n ExtraPropsT extends {} = {}\n> extends AggregationLayer<DataT, ExtraPropsT & Required<_HeatmapLayerProps<DataT>>> {\n static layerName = 'HeatmapLayer';\n static defaultProps = defaultProps;\n\n state!: AggregationLayer<DataT>['state'] & {\n supported: boolean;\n colorDomain?: number[];\n isWeightMapDirty?: boolean;\n weightsTexture?: Texture;\n maxWeightsTexture?: Texture;\n colorTexture?: Texture;\n zoom?: number;\n worldBounds?: number[];\n normalizedCommonBounds?: number[];\n updateTimer?: any;\n triPositionBuffer?: Buffer;\n triTexCoordBuffer?: Buffer;\n weightsTransform?: TextureTransform;\n maxWeightTransform?: TextureTransform;\n textureSize: number;\n format: TextureFormat;\n type: GL;\n weightsScale: number;\n visibleWorldBounds: number[];\n viewportCorners: number[][];\n };\n\n initializeState() {\n if (!REQUIRED_FEATURES.every(feature => this.context.device.features.has(feature))) {\n this.setState({supported: false});\n log.error(`HeatmapLayer: ${this.id} is not supported on this browser`)();\n return;\n }\n super.initializeAggregationLayer(DIMENSIONS);\n this.setState({supported: true, colorDomain: DEFAULT_COLOR_DOMAIN});\n this._setupTextureParams();\n this._setupAttributes();\n this._setupResources();\n }\n\n shouldUpdateState({changeFlags}: UpdateParameters<this>) {\n // Need to be updated when viewport changes\n return changeFlags.somethingChanged;\n }\n\n /* eslint-disable max-statements,complexity */\n updateState(opts: UpdateParameters<this>) {\n if (!this.state.supported) {\n return;\n }\n super.updateState(opts);\n this._updateHeatmapState(opts);\n }\n\n _updateHeatmapState(opts: UpdateParameters<this>) {\n const {props, oldProps} = opts;\n const changeFlags = this._getChangeFlags(opts);\n\n if (changeFlags.dataChanged || changeFlags.viewportChanged) {\n // if data is changed, do not debounce and immediately update the weight map\n changeFlags.boundsChanged = this._updateBounds(changeFlags.dataChanged);\n this._updateTextureRenderingBounds();\n }\n\n if (changeFlags.dataChanged || changeFlags.boundsChanged) {\n // Update weight map immediately\n clearTimeout(this.state.updateTimer);\n this.setState({isWeightMapDirty: true});\n } else if (changeFlags.viewportZoomChanged) {\n // Update weight map when zoom stops\n this._debouncedUpdateWeightmap();\n }\n\n if (props.colorRange !== oldProps.colorRange) {\n this._updateColorTexture(opts);\n }\n\n if (this.state.isWeightMapDirty) {\n this._updateWeightmap();\n }\n\n this.setState({zoom: opts.context.viewport.zoom});\n }\n\n renderLayers(): LayersList | Layer {\n if (!this.state.supported) {\n return [];\n }\n const {\n weightsTexture,\n triPositionBuffer,\n triTexCoordBuffer,\n maxWeightsTexture,\n colorTexture,\n colorDomain\n } = this.state;\n const {updateTriggers, intensity, threshold, aggregation} = this.props;\n\n const TriangleLayerClass = this.getSubLayerClass('triangle', TriangleLayer);\n\n return new TriangleLayerClass(\n this.getSubLayerProps({\n id: 'triangle-layer',\n updateTriggers\n }),\n {\n // position buffer is filled with world coordinates generated from viewport.unproject\n // i.e. LNGLAT if geospatial, CARTESIAN otherwise\n coordinateSystem: COORDINATE_SYSTEM.DEFAULT,\n data: {\n attributes: {\n positions: triPositionBuffer,\n texCoords: triTexCoordBuffer\n }\n },\n vertexCount: 4,\n maxTexture: maxWeightsTexture,\n colorTexture,\n aggregationMode: AGGREGATION_MODE[aggregation] || 0,\n texture: weightsTexture,\n intensity,\n threshold,\n colorDomain\n }\n );\n }\n\n finalizeState(context: LayerContext) {\n super.finalizeState(context);\n const {\n weightsTransform,\n weightsTexture,\n maxWeightTransform,\n maxWeightsTexture,\n triPositionBuffer,\n triTexCoordBuffer,\n colorTexture,\n updateTimer\n } = this.state;\n weightsTransform?.destroy();\n weightsTexture?.destroy();\n maxWeightTransform?.destroy();\n maxWeightsTexture?.destroy();\n triPositionBuffer?.destroy();\n triTexCoordBuffer?.destroy();\n colorTexture?.destroy();\n if (updateTimer) {\n clearTimeout(updateTimer);\n }\n }\n\n // PRIVATE\n\n // override Composite layer private method to create AttributeManager instance\n _getAttributeManager() {\n return new AttributeManager(this.context.device, {\n id: this.props.id,\n stats: this.context.stats\n });\n }\n\n _getChangeFlags(opts: UpdateParameters<this>) {\n const changeFlags: Partial<ChangeFlags> & {\n boundsChanged?: boolean;\n viewportZoomChanged?: boolean;\n } = {};\n const {dimensions} = this.state;\n changeFlags.dataChanged =\n (this.isAttributeChanged() && 'attribute changed') || // if any attribute is changed\n (this.isAggregationDirty(opts, {\n compareAll: true,\n dimension: dimensions.data\n }) &&\n 'aggregation is dirty');\n changeFlags.viewportChanged = opts.changeFlags.viewportChanged;\n\n const {zoom} = this.state;\n if (!opts.context.viewport || opts.context.viewport.zoom !== zoom) {\n changeFlags.viewportZoomChanged = true;\n }\n\n return changeFlags;\n }\n\n _createTextures() {\n const {textureSize, format, type} = this.state;\n\n this.setState({\n weightsTexture: this.context.device.createTexture({\n width: textureSize,\n height: textureSize,\n format,\n type,\n ...TEXTURE_PROPS\n }),\n maxWeightsTexture: this.context.device.createTexture({format, type, ...TEXTURE_PROPS}) // 1 X 1 texture,\n });\n }\n\n _setupAttributes() {\n const attributeManager = this.getAttributeManager()!;\n attributeManager.add({\n positions: {size: 3, type: GL.DOUBLE, accessor: 'getPosition'},\n weights: {size: 1, accessor: 'getWeight'}\n });\n this.setState({positionAttributeName: 'positions'});\n }\n\n _setupTextureParams() {\n const {device} = this.context;\n const {weightsTextureSize} = this.props;\n\n const textureSize = Math.min(weightsTextureSize, device.limits.maxTextureDimension2D as number);\n const floatTargetSupport = FLOAT_TARGET_FEATURES.every(feature => device.features.has(feature));\n const {format, type} = getTextureParams({device, floatTargetSupport});\n const weightsScale = floatTargetSupport ? 1 : 1 / 255;\n this.setState({textureSize, format, type, weightsScale});\n if (!floatTargetSupport) {\n log.warn(\n `HeatmapLayer: ${this.id} rendering to float texture not supported, fallingback to low precession format`\n )();\n }\n }\n\n getShaders(type) {\n return super.getShaders(\n type === 'max-weights-transform'\n ? {\n vs: vsMax,\n _fs: fsMax\n }\n : {\n vs: weightsVs,\n _fs: weightsFs\n }\n );\n }\n\n _createWeightsTransform(shaders = {}) {\n let {weightsTransform} = this.state;\n weightsTransform?.delete();\n\n weightsTransform = new TextureTransform(this.context.device, {\n id: `${this.id}-weights-transform`,\n vertexCount: 1,\n targetTexture: this.state.weightsTexture!,\n targetTextureVarying: 'weightsTexture',\n ...shaders\n } as TextureTransformProps);\n this.setState({weightsTransform});\n }\n\n _setupResources() {\n this._createTextures();\n const {textureSize, weightsTexture, maxWeightsTexture} = this.state;\n\n const weightsTransformShaders = this.getShaders('weights-transform');\n this._createWeightsTransform(weightsTransformShaders);\n\n const maxWeightsTransformShaders = this.getShaders('max-weights-transform');\n const maxWeightTransform = new TextureTransform(this.context.device, {\n id: `${this.id}-max-weights-transform`,\n _sourceTextures: {\n inTexture: weightsTexture\n },\n _targetTexture: maxWeightsTexture,\n _targetTextureVarying: 'outTexture',\n ...maxWeightsTransformShaders,\n elementCount: textureSize * textureSize\n });\n\n this.setState({\n weightsTexture,\n maxWeightsTexture,\n maxWeightTransform,\n zoom: null,\n triPositionBuffer: this.context.device.createBuffer({\n byteLength: 48,\n // @ts-expect-error\n accessor: {size: 3}\n }),\n triTexCoordBuffer: this.context.device.createBuffer({\n byteLength: 48,\n // @ts-expect-error\n accessor: {size: 2}\n })\n });\n }\n\n // overwrite super class method to update transform model\n updateShaders(shaderOptions) {\n // sahder params (modules, injects) changed, update model object\n this._createWeightsTransform(shaderOptions);\n }\n\n _updateMaxWeightValue() {\n const {maxWeightTransform} = this.state;\n maxWeightTransform!.run({\n parameters: {\n // @ts-expect-error TODO(v9): Resolve errors.\n blend: true,\n depthTest: false,\n blendFunc: [GL.ONE, GL.ONE],\n blendEquation: GL.MAX\n }\n });\n }\n\n // Computes world bounds area that needs to be processed for generate heatmap\n _updateBounds(forceUpdate: any = false): boolean {\n const {viewport} = this.context;\n\n // Unproject all 4 corners of the current screen coordinates into world coordinates (lng/lat)\n // Takes care of viewport has non zero bearing/pitch (i.e axis not aligned with world coordiante system)\n const viewportCorners = [\n viewport.unproject([0, 0]),\n viewport.unproject([viewport.width, 0]),\n viewport.unproject([viewport.width, viewport.height]),\n viewport.unproject([0, viewport.height])\n ].map(p => p.map(Math.fround));\n\n // #1: get world bounds for current viewport extends\n const visibleWorldBounds = getBounds(viewportCorners); // TODO: Change to visible bounds\n\n const newState: Partial<HeatmapLayer['state']> = {visibleWorldBounds, viewportCorners};\n let boundsChanged = false;\n\n if (\n forceUpdate ||\n !this.state.worldBounds ||\n !boundsContain(this.state.worldBounds, visibleWorldBounds)\n ) {\n // #2 : convert world bounds to common (Flat) bounds\n // #3 : extend common bounds to match aspect ratio with viewport\n const scaledCommonBounds = this._worldToCommonBounds(visibleWorldBounds);\n\n // #4 :convert aligned common bounds to world bounds\n const worldBounds = this._commonToWorldBounds(scaledCommonBounds);\n\n // Clip webmercator projection limits\n if (this.props.coordinateSystem === COORDINATE_SYSTEM.LNGLAT) {\n worldBounds[1] = Math.max(worldBounds[1], -85.051129);\n worldBounds[3] = Math.min(worldBounds[3], 85.051129);\n worldBounds[0] = Math.max(worldBounds[0], -360);\n worldBounds[2] = Math.min(worldBounds[2], 360);\n }\n\n // #5: now convert world bounds to common using Layer's coordiante system and origin\n const normalizedCommonBounds = this._worldToCommonBounds(worldBounds);\n\n newState.worldBounds = worldBounds;\n newState.normalizedCommonBounds = normalizedCommonBounds;\n\n boundsChanged = true;\n }\n this.setState(newState);\n return boundsChanged;\n }\n\n _updateTextureRenderingBounds() {\n // Just render visible portion of the texture\n const {triPositionBuffer, triTexCoordBuffer, normalizedCommonBounds, viewportCorners} =\n this.state;\n\n const {viewport} = this.context;\n\n triPositionBuffer!.write(packVertices(viewportCorners, 3));\n\n const textureBounds = viewportCorners.map(p =>\n getTextureCoordinates(viewport.projectPosition(p), normalizedCommonBounds!)\n );\n triTexCoordBuffer!.write(packVertices(textureBounds, 2));\n }\n\n _updateColorTexture(opts) {\n const {colorRange} = opts.props;\n let {colorTexture} = this.state;\n const colors = colorRangeToFlatArray(colorRange, false, Uint8Array as any);\n\n if (colorTexture) {\n // @ts-expect-error TODO - no longer supported in v9?\n colorTexture.setImageData({\n data: colors,\n width: colorRange.length\n });\n } else {\n colorTexture = this.context.device.createTexture({\n data: colors,\n width: colorRange.length,\n height: 1,\n ...TEXTURE_PROPS\n });\n }\n this.setState({colorTexture});\n }\n\n _updateWeightmap() {\n const {radiusPixels, colorDomain, aggregation} = this.props;\n const {worldBounds, textureSize, weightsScale} = this.state;\n const weightsTransform = this.state.weightsTransform!;\n this.state.isWeightMapDirty = false;\n\n // convert world bounds to common using Layer's coordiante system and origin\n const commonBounds = this._worldToCommonBounds(worldBounds, {\n useLayerCoordinateSystem: true\n });\n\n if (colorDomain && aggregation === 'SUM') {\n // scale color domain to weight per pixel\n const {viewport} = this.context;\n const metersPerPixel =\n (viewport.distanceScales.metersPerUnit[2] * (commonBounds[2] - commonBounds[0])) /\n textureSize;\n this.state.colorDomain = colorDomain.map(x => x * metersPerPixel * weightsScale);\n } else {\n this.state.colorDomain = colorDomain || DEFAULT_COLOR_DOMAIN;\n }\n\n const uniforms = {\n radiusPixels,\n commonBounds,\n textureWidth: textureSize,\n weightsScale\n };\n // Attribute manager sets data array count as instaceCount on model\n // we need to set that as elementCount on 'weightsTransform'\n weightsTransform.update({\n elementCount: this.getNumInstances()\n });\n // Need to explictly specify clearColor as external context may have modified it\n withGLParameters(this.context.gl, {clearColor: [0, 0, 0, 0]}, () => {\n weightsTransform.run({\n uniforms,\n parameters: {\n // @ts-expect-error TODO(v9): Resolve errors.\n blend: true,\n depthTest: false,\n blendFunc: [GL.ONE, GL.ONE],\n blendEquation: GL.FUNC_ADD\n },\n clearRenderTarget: true,\n attributes: this.getAttributes(),\n moduleSettings: this.getModuleSettings()\n });\n });\n this._updateMaxWeightValue();\n\n // reset filtering parameters (TODO: remove once luma issue#1193 is fixed)\n // TODO v9 sampler support in luma.gl needs to improve\n // weightsTexture.setSampler({\n // magFilter: 'linear',\n // minFilter: 'linear'\n // });\n }\n\n _debouncedUpdateWeightmap(fromTimer = false) {\n let {updateTimer} = this.state;\n const {debounceTimeout} = this.props;\n\n if (fromTimer) {\n updateTimer = null;\n // update\n this._updateBounds(true);\n this._updateTextureRenderingBounds();\n this.setState({isWeightMapDirty: true});\n } else {\n this.setState({isWeightMapDirty: false});\n clearTimeout(updateTimer);\n updateTimer = setTimeout(this._debouncedUpdateWeightmap.bind(this, true), debounceTimeout);\n }\n\n this.setState({updateTimer});\n }\n\n // input: worldBounds: [minLong, minLat, maxLong, maxLat]\n // input: opts.useLayerCoordinateSystem : layers coordiante system is used\n // optput: commonBounds: [minX, minY, maxX, maxY] scaled to fit the current texture\n _worldToCommonBounds(worldBounds, opts: {useLayerCoordinateSystem?: boolean} = {}) {\n const {useLayerCoordinateSystem = false} = opts;\n const [minLong, minLat, maxLong, maxLat] = worldBounds;\n const {viewport} = this.context;\n const {textureSize} = this.state;\n const {coordinateSystem} = this.props;\n\n const offsetMode =\n useLayerCoordinateSystem &&\n (coordinateSystem === COORDINATE_SYSTEM.LNGLAT_OFFSETS ||\n coordinateSystem === COORDINATE_SYSTEM.METER_OFFSETS);\n const offsetOriginCommon = offsetMode\n ? viewport.projectPosition(this.props.coordinateOrigin)\n : [0, 0];\n const size = (textureSize * RESOLUTION) / viewport.scale;\n\n let bottomLeftCommon;\n let topRightCommon;\n\n // Y-axis is flipped between World and Common bounds\n if (useLayerCoordinateSystem && !offsetMode) {\n bottomLeftCommon = this.projectPosition([minLong, minLat, 0]);\n topRightCommon = this.projectPosition([maxLong, maxLat, 0]);\n } else {\n bottomLeftCommon = viewport.projectPosition([minLong, minLat, 0]);\n topRightCommon = viewport.projectPosition([maxLong, maxLat, 0]);\n }\n // Ignore z component\n return scaleToAspectRatio(\n [\n bottomLeftCommon[0] - offsetOriginCommon[0],\n bottomLeftCommon[1] - offsetOriginCommon[1],\n topRightCommon[0] - offsetOriginCommon[0],\n topRightCommon[1] - offsetOriginCommon[1]\n ],\n size,\n size\n );\n }\n\n // input commonBounds: [xMin, yMin, xMax, yMax]\n // output worldBounds: [minLong, minLat, maxLong, maxLat]\n _commonToWorldBounds(commonBounds) {\n const [xMin, yMin, xMax, yMax] = commonBounds;\n const {viewport} = this.context;\n const bottomLeftWorld = viewport.unprojectPosition([xMin, yMin]);\n const topRightWorld = viewport.unprojectPosition([xMax, yMax]);\n\n return bottomLeftWorld.slice(0, 2).concat(topRightWorld.slice(0, 2));\n }\n}\n"],"file":"heatmap-layer.js"}
@@ -1,10 +0,0 @@
1
- export default `\
2
- #version 300 es
3
- in vec4 outTexture;
4
- out vec4 fragColor;
5
- void main() {
6
- fragColor = outTexture;
7
- fragColor.g = outTexture.r / max(1.0, outTexture.a);
8
- }
9
- `;
10
- //# sourceMappingURL=max-fs.glsl.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/heatmap-layer/max-fs.glsl.ts"],"names":[],"mappings":"AAAA,eAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CARA","sourcesContent":["export default `\\\n#version 300 es\nin vec4 outTexture;\nout vec4 fragColor;\nvoid main() {\n fragColor = outTexture;\n fragColor.g = outTexture.r / max(1.0, outTexture.a);\n}\n`;\n"],"file":"max-fs.glsl.js"}
@@ -1,14 +0,0 @@
1
- export default `\
2
- #version 300 es
3
- in vec4 inTexture;
4
- out vec4 outTexture;
5
-
6
- void main()
7
- {
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;
12
- }
13
- `;
14
- //# sourceMappingURL=max-vs.glsl.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/heatmap-layer/max-vs.glsl.ts"],"names":[],"mappings":"AAAA,eAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAZA","sourcesContent":["export default `\\\n#version 300 es\nin vec4 inTexture;\nout vec4 outTexture;\n\nvoid main()\n{\noutTexture = inTexture;\ngl_Position = vec4(0, 0, 0, 1.);\n// Enforce default value for ANGLE issue (https://bugs.chromium.org/p/angleproject/issues/detail?id=3941)\ngl_PointSize = 1.0;\n}\n`;\n"],"file":"max-vs.glsl.js"}
@@ -1,43 +0,0 @@
1
- export default `\
2
- #version 300 es
3
- #define SHADER_NAME triangle-layer-fragment-shader
4
-
5
- precision highp float;
6
-
7
- uniform float opacity;
8
- uniform sampler2D texture;
9
- uniform sampler2D colorTexture;
10
- uniform float aggregationMode;
11
-
12
- in vec2 vTexCoords;
13
- in float vIntensityMin;
14
- in float vIntensityMax;
15
-
16
- out vec4 fragColor;
17
-
18
- vec4 getLinearColor(float value) {
19
- float factor = clamp(value * vIntensityMax, 0., 1.);
20
- vec4 color = texture(colorTexture, vec2(factor, 0.5));
21
- color.a *= min(value * vIntensityMin, 1.0);
22
- return color;
23
- }
24
-
25
- void main(void) {
26
- vec4 weights = texture(texture, vTexCoords);
27
- float weight = weights.r;
28
-
29
- if (aggregationMode > 0.5) {
30
- weight /= max(1.0, weights.a);
31
- }
32
-
33
- // discard pixels with 0 weight.
34
- if (weight <= 0.) {
35
- discard;
36
- }
37
-
38
- vec4 linearColor = getLinearColor(weight);
39
- linearColor.a *= opacity;
40
- fragColor = linearColor;
41
- }
42
- `;
43
- //# sourceMappingURL=triangle-layer-fragment.glsl.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/heatmap-layer/triangle-layer-fragment.glsl.ts"],"names":[],"mappings":"AAoBA,eAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAzCA","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\nexport default `\\\n#version 300 es\n#define SHADER_NAME triangle-layer-fragment-shader\n\nprecision highp float;\n\nuniform float opacity;\nuniform sampler2D texture;\nuniform sampler2D colorTexture;\nuniform float aggregationMode;\n\nin vec2 vTexCoords;\nin float vIntensityMin;\nin float vIntensityMax;\n\nout vec4 fragColor;\n\nvec4 getLinearColor(float value) {\n float factor = clamp(value * vIntensityMax, 0., 1.);\n vec4 color = texture(colorTexture, vec2(factor, 0.5));\n color.a *= min(value * vIntensityMin, 1.0);\n return color;\n}\n\nvoid main(void) {\n vec4 weights = texture(texture, vTexCoords);\n float weight = weights.r;\n\n if (aggregationMode > 0.5) {\n weight /= max(1.0, weights.a);\n }\n\n // discard pixels with 0 weight.\n if (weight <= 0.) {\n discard;\n }\n\n vec4 linearColor = getLinearColor(weight);\n linearColor.a *= opacity;\n fragColor = linearColor;\n}\n`;\n"],"file":"triangle-layer-fragment.glsl.js"}
@@ -1,33 +0,0 @@
1
- export default `\
2
- #version 300 es
3
- #define SHADER_NAME heatp-map-layer-vertex-shader
4
-
5
- uniform sampler2D maxTexture;
6
- uniform float intensity;
7
- uniform vec2 colorDomain;
8
- uniform float threshold;
9
- uniform float aggregationMode;
10
-
11
- in vec3 positions;
12
- in vec2 texCoords;
13
-
14
- out vec2 vTexCoords;
15
- out float vIntensityMin;
16
- out float vIntensityMax;
17
-
18
- void main(void) {
19
- gl_Position = project_position_to_clipspace(positions, vec3(0.0), vec3(0.0));
20
- vTexCoords = texCoords;
21
- vec4 maxTexture = texture(maxTexture, vec2(0.5));
22
- float maxValue = aggregationMode < 0.5 ? maxTexture.r : maxTexture.g;
23
- float minValue = maxValue * threshold;
24
- if (colorDomain[1] > 0.) {
25
- // if user specified custom domain use it.
26
- maxValue = colorDomain[1];
27
- minValue = colorDomain[0];
28
- }
29
- vIntensityMax = intensity / maxValue;
30
- vIntensityMin = intensity / minValue;
31
- }
32
- `;
33
- //# sourceMappingURL=triangle-layer-vertex.glsl.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/heatmap-layer/triangle-layer-vertex.glsl.ts"],"names":[],"mappings":"AAsBA,eAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CA/BA","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\n// Inspired by screen-grid-layer vertex shader in deck.gl\n\nexport default `\\\n#version 300 es\n#define SHADER_NAME heatp-map-layer-vertex-shader\n\nuniform sampler2D maxTexture;\nuniform float intensity;\nuniform vec2 colorDomain;\nuniform float threshold;\nuniform float aggregationMode;\n\nin vec3 positions;\nin vec2 texCoords;\n\nout vec2 vTexCoords;\nout float vIntensityMin;\nout float vIntensityMax;\n\nvoid main(void) {\n gl_Position = project_position_to_clipspace(positions, vec3(0.0), vec3(0.0));\n vTexCoords = texCoords;\n vec4 maxTexture = texture(maxTexture, vec2(0.5));\n float maxValue = aggregationMode < 0.5 ? maxTexture.r : maxTexture.g;\n float minValue = maxValue * threshold;\n if (colorDomain[1] > 0.) {\n // if user specified custom domain use it.\n maxValue = colorDomain[1];\n minValue = colorDomain[0];\n }\n vIntensityMax = intensity / maxValue;\n vIntensityMin = intensity / minValue;\n}\n`;\n"],"file":"triangle-layer-vertex.glsl.js"}
@@ -1,80 +0,0 @@
1
- import { Model, Geometry } from '@luma.gl/engine';
2
- import { Layer, project32 } from '@deck.gl/core';
3
- import vs from './triangle-layer-vertex.glsl';
4
- import fs from './triangle-layer-fragment.glsl';
5
- export default class TriangleLayer extends Layer {
6
- constructor(...args) {
7
- super(...args);
8
- this.state = void 0;
9
- }
10
-
11
- getShaders() {
12
- return {
13
- vs,
14
- fs,
15
- modules: [project32]
16
- };
17
- }
18
-
19
- initializeState({
20
- device
21
- }) {
22
- const attributeManager = this.getAttributeManager();
23
- attributeManager.add({
24
- positions: {
25
- size: 3,
26
- noAlloc: true
27
- },
28
- texCoords: {
29
- size: 2,
30
- noAlloc: true
31
- }
32
- });
33
- this.setState({
34
- model: this._getModel(device)
35
- });
36
- }
37
-
38
- _getModel(device) {
39
- const {
40
- vertexCount
41
- } = this.props;
42
- return new Model(device, { ...this.getShaders(),
43
- id: this.props.id,
44
- geometry: new Geometry({
45
- topology: 'triangle-fan-webgl',
46
- vertexCount
47
- })
48
- });
49
- }
50
-
51
- draw({
52
- uniforms
53
- }) {
54
- const {
55
- model
56
- } = this.state;
57
- const {
58
- texture,
59
- maxTexture,
60
- colorTexture,
61
- intensity,
62
- threshold,
63
- aggregationMode,
64
- colorDomain
65
- } = this.props;
66
- model.setUniforms({ ...uniforms,
67
- texture,
68
- maxTexture,
69
- colorTexture,
70
- intensity,
71
- threshold,
72
- aggregationMode,
73
- colorDomain
74
- });
75
- model.draw(this.context.renderPass);
76
- }
77
-
78
- }
79
- TriangleLayer.layerName = 'TriangleLayer';
80
- //# sourceMappingURL=triangle-layer.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/heatmap-layer/triangle-layer.ts"],"names":["Model","Geometry","Layer","project32","vs","fs","TriangleLayer","state","getShaders","modules","initializeState","device","attributeManager","getAttributeManager","add","positions","size","noAlloc","texCoords","setState","model","_getModel","vertexCount","props","id","geometry","topology","draw","uniforms","texture","maxTexture","colorTexture","intensity","threshold","aggregationMode","colorDomain","setUniforms","context","renderPass","layerName"],"mappings":"AAqBA,SAAQA,KAAR,EAAeC,QAAf,QAA8B,iBAA9B;AACA,SAAQC,KAAR,EAA6BC,SAA7B,QAA6C,eAA7C;AACA,OAAOC,EAAP,MAAe,8BAAf;AACA,OAAOC,EAAP,MAAe,gCAAf;AAaA,eAAe,MAAMC,aAAN,SAA4BJ,KAA5B,CAAuD;AAAA;AAAA;AAAA,SAGpEK,KAHoE;AAAA;;AAOpEC,EAAAA,UAAU,GAAG;AACX,WAAO;AAACJ,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WAAN,CAAkB,EAChB,GAAGR,QADa;AAEhBC,MAAAA,OAFgB;AAGhBC,MAAAA,UAHgB;AAIhBC,MAAAA,YAJgB;AAKhBC,MAAAA,SALgB;AAMhBC,MAAAA,SANgB;AAOhBC,MAAAA,eAPgB;AAQhBC,MAAAA;AARgB,KAAlB;AAUAf,IAAAA,KAAK,CAACO,IAAN,CAAW,KAAKU,OAAL,CAAaC,UAAxB;AACD;;AApDmE;AAAjDhC,a,CACZiC,S,GAAY,e","sourcesContent":["// Copyright (c) 2015 - 2019 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 type {Device, Texture} from '@luma.gl/core';\nimport {Model, Geometry} from '@luma.gl/engine';\nimport {Layer, LayerContext, project32} from '@deck.gl/core';\nimport vs from './triangle-layer-vertex.glsl';\nimport fs from './triangle-layer-fragment.glsl';\n\ntype _TriangleLayerProps = {\n colorDomain: number[];\n aggregationMode: string;\n threshold: number;\n intensity: number;\n vertexCount: number;\n colorTexture: Texture;\n maxTexture: Texture;\n texture: Texture;\n};\n\nexport default class TriangleLayer extends Layer<_TriangleLayerProps> {\n static layerName = 'TriangleLayer';\n\n state!: {\n model: Model;\n };\n\n getShaders() {\n return {vs, fs, modules: [project32]};\n }\n\n initializeState({device}: LayerContext): void {\n const attributeManager = this.getAttributeManager()!;\n attributeManager.add({\n positions: {size: 3, noAlloc: true},\n texCoords: {size: 2, noAlloc: true}\n });\n this.setState({\n model: this._getModel(device)\n });\n }\n\n _getModel(device: Device): Model {\n const {vertexCount} = this.props;\n\n return new Model(device, {\n ...this.getShaders(),\n id: this.props.id,\n geometry: new Geometry({\n topology: 'triangle-fan-webgl',\n vertexCount\n })\n });\n }\n\n draw({uniforms}): void {\n const {model} = this.state;\n\n const {texture, maxTexture, colorTexture, intensity, threshold, aggregationMode, colorDomain} =\n this.props;\n\n model.setUniforms({\n ...uniforms,\n texture,\n maxTexture,\n colorTexture,\n intensity,\n threshold,\n aggregationMode,\n colorDomain\n });\n model.draw(this.context.renderPass);\n }\n}\n"],"file":"triangle-layer.js"}
@@ -1,22 +0,0 @@
1
- export default `\
2
- #version 300 es
3
- in vec4 weightsTexture;
4
- out vec4 fragColor;
5
- // Epanechnikov function, keeping for reference
6
- // float epanechnikovKDE(float u) {
7
- // return 0.75 * (1.0 - u * u);
8
- // }
9
- float gaussianKDE(float u){
10
- return pow(2.71828, -u*u/0.05555)/(1.77245385*0.166666);
11
- }
12
- void main()
13
- {
14
- float dist = length(gl_PointCoord - vec2(0.5, 0.5));
15
- if (dist > 0.5) {
16
- discard;
17
- }
18
- fragColor = weightsTexture * gaussianKDE(2. * dist);
19
- DECKGL_FILTER_COLOR(fragColor, geometry);
20
- }
21
- `;
22
- //# sourceMappingURL=weights-fs.glsl.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/heatmap-layer/weights-fs.glsl.ts"],"names":[],"mappings":"AAAA,eAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CApBA","sourcesContent":["export default `\\\n#version 300 es\nin vec4 weightsTexture;\nout vec4 fragColor;\n// Epanechnikov function, keeping for reference\n// float epanechnikovKDE(float u) {\n// return 0.75 * (1.0 - u * u);\n// }\nfloat gaussianKDE(float u){\n return pow(2.71828, -u*u/0.05555)/(1.77245385*0.166666);\n}\nvoid main()\n{\n float dist = length(gl_PointCoord - vec2(0.5, 0.5));\n if (dist > 0.5) {\n discard;\n }\n fragColor = weightsTexture * gaussianKDE(2. * dist);\n DECKGL_FILTER_COLOR(fragColor, geometry);\n}\n`;\n"],"file":"weights-fs.glsl.js"}
@@ -1,25 +0,0 @@
1
- export default `\
2
- #version 300 es
3
- in vec3 positions;
4
- in vec3 positions64Low;
5
- in float weights;
6
- out vec4 weightsTexture;
7
- uniform float radiusPixels;
8
- uniform float textureWidth;
9
- uniform vec4 commonBounds;
10
- uniform float weightsScale;
11
- void main()
12
- {
13
- weightsTexture = vec4(weights * weightsScale, 0., 0., 1.);
14
-
15
- float radiusTexels = project_pixel_size(radiusPixels) * textureWidth / (commonBounds.z - commonBounds.x);
16
- gl_PointSize = radiusTexels * 2.;
17
-
18
- vec3 commonPosition = project_position(positions, positions64Low);
19
-
20
- // map xy from commonBounds to [-1, 1]
21
- gl_Position.xy = (commonPosition.xy - commonBounds.xy) / (commonBounds.zw - commonBounds.xy) ;
22
- gl_Position.xy = (gl_Position.xy * 2.) - (1.);
23
- }
24
- `;
25
- //# sourceMappingURL=weights-vs.glsl.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/heatmap-layer/weights-vs.glsl.ts"],"names":[],"mappings":"AAAA,eAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAvBA","sourcesContent":["export default `\\\n#version 300 es\nin vec3 positions;\nin vec3 positions64Low;\nin float weights;\nout vec4 weightsTexture;\nuniform float radiusPixels;\nuniform float textureWidth;\nuniform vec4 commonBounds;\nuniform float weightsScale;\nvoid main()\n{\n weightsTexture = vec4(weights * weightsScale, 0., 0., 1.);\n\n float radiusTexels = project_pixel_size(radiusPixels) * textureWidth / (commonBounds.z - commonBounds.x);\n gl_PointSize = radiusTexels * 2.;\n\n vec3 commonPosition = project_position(positions, positions64Low);\n\n // map xy from commonBounds to [-1, 1]\n gl_Position.xy = (commonPosition.xy - commonBounds.xy) / (commonBounds.zw - commonBounds.xy) ;\n gl_Position.xy = (gl_Position.xy * 2.) - (1.);\n}\n`;\n"],"file":"weights-vs.glsl.js"}
@@ -1,87 +0,0 @@
1
- import { hexbin } from 'd3-hexbin';
2
- import { createIterable, log } from '@deck.gl/core';
3
- export function pointToHexbin(props, aggregationParams) {
4
- const {
5
- data,
6
- radius
7
- } = props;
8
- const {
9
- viewport,
10
- attributes
11
- } = aggregationParams;
12
- const centerLngLat = data.length ? getPointsCenter(data, aggregationParams) : null;
13
- const radiusCommon = getRadiusInCommon(radius, viewport, centerLngLat);
14
- const screenPoints = [];
15
- const {
16
- iterable,
17
- objectInfo
18
- } = createIterable(data);
19
- const positions = attributes.positions.value;
20
- const {
21
- size
22
- } = attributes.positions.getAccessor();
23
-
24
- for (const object of iterable) {
25
- objectInfo.index++;
26
- const posIndex = objectInfo.index * size;
27
- const position = [positions[posIndex], positions[posIndex + 1]];
28
- const arrayIsFinite = Number.isFinite(position[0]) && Number.isFinite(position[1]);
29
-
30
- if (arrayIsFinite) {
31
- screenPoints.push({
32
- screenCoord: viewport.projectFlat(position),
33
- source: object,
34
- index: objectInfo.index
35
- });
36
- } else {
37
- log.warn('HexagonLayer: invalid position')();
38
- }
39
- }
40
-
41
- const newHexbin = hexbin().radius(radiusCommon).x(d => d.screenCoord[0]).y(d => d.screenCoord[1]);
42
- const hexagonBins = newHexbin(screenPoints);
43
- return {
44
- hexagons: hexagonBins.map((hex, index) => ({
45
- position: viewport.unprojectFlat([hex.x, hex.y]),
46
- points: hex,
47
- index
48
- })),
49
- radiusCommon
50
- };
51
- }
52
- export function getPointsCenter(data, aggregationParams) {
53
- const {
54
- attributes
55
- } = aggregationParams;
56
- const positions = attributes.positions.value;
57
- const {
58
- size
59
- } = attributes.positions.getAccessor();
60
- let minX = Infinity;
61
- let minY = Infinity;
62
- let maxX = -Infinity;
63
- let maxY = -Infinity;
64
- let i;
65
-
66
- for (i = 0; i < size * data.length; i += size) {
67
- const x = positions[i];
68
- const y = positions[i + 1];
69
- const arrayIsFinite = Number.isFinite(x) && Number.isFinite(y);
70
-
71
- if (arrayIsFinite) {
72
- minX = Math.min(x, minX);
73
- maxX = Math.max(x, maxX);
74
- minY = Math.min(y, minY);
75
- maxY = Math.max(y, maxY);
76
- }
77
- }
78
-
79
- return [minX, minY, maxX, maxY].every(Number.isFinite) ? [(minX + maxX) / 2, (minY + maxY) / 2] : null;
80
- }
81
- export function getRadiusInCommon(radius, viewport, center) {
82
- const {
83
- unitsPerMeter
84
- } = viewport.getDistanceScales(center);
85
- return radius * unitsPerMeter[0];
86
- }
87
- //# sourceMappingURL=hexagon-aggregator.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/hexagon-layer/hexagon-aggregator.ts"],"names":["hexbin","createIterable","log","pointToHexbin","props","aggregationParams","data","radius","viewport","attributes","centerLngLat","length","getPointsCenter","radiusCommon","getRadiusInCommon","screenPoints","iterable","objectInfo","positions","value","size","getAccessor","object","index","posIndex","position","arrayIsFinite","Number","isFinite","push","screenCoord","projectFlat","source","warn","newHexbin","x","d","y","hexagonBins","hexagons","map","hex","unprojectFlat","points","minX","Infinity","minY","maxX","maxY","i","Math","min","max","every","center","unitsPerMeter","getDistanceScales"],"mappings":"AAoBA,SAAQA,MAAR,QAAqB,WAArB;AACA,SAAQC,cAAR,EAAwBC,GAAxB,QAAkC,eAAlC;AAWA,OAAO,SAASC,aAAT,CAAuBC,KAAvB,EAA8BC,iBAA9B,EAAiD;AACtD,QA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,GAAGnB,SAAS,CAAC+B,CAAC,GAAG,CAAL,CAAnB;AACA,UAAMvB,aAAa,GAAGC,MAAM,CAACC,QAAP,CAAgBO,CAAhB,KAAsBR,MAAM,CAACC,QAAP,CAAgBS,CAAhB,CAA5C;;AAEA,QAAIX,aAAJ,EAAmB;AACjBkB,MAAAA,IAAI,GAAGM,IAAI,CAACC,GAAL,CAAShB,CAAT,EAAYS,IAAZ,CAAP;AACAG,MAAAA,IAAI,GAAGG,IAAI,CAACE,GAAL,CAASjB,CAAT,EAAYY,IAAZ,CAAP;AACAD,MAAAA,IAAI,GAAGI,IAAI,CAACC,GAAL,CAASd,CAAT,EAAYS,IAAZ,CAAP;AACAE,MAAAA,IAAI,GAAGE,IAAI,CAACE,GAAL,CAASf,CAAT,EAAYW,IAAZ,CAAP;AACD;AACF;;AAGD,SAAO,CAACJ,IAAD,EAAOE,IAAP,EAAaC,IAAb,EAAmBC,IAAnB,EAAyBK,KAAzB,CAA+B1B,MAAM,CAACC,QAAtC,IACH,CAAC,CAACgB,IAAI,GAAGG,IAAR,IAAgB,CAAjB,EAAoB,CAACD,IAAI,GAAGE,IAAR,IAAgB,CAApC,CADG,GAEH,IAFJ;AAGD;AAUD,OAAO,SAASlC,iBAAT,CAA2BP,MAA3B,EAAmCC,QAAnC,EAA6C8C,MAA7C,EAAqD;AAC1D,QAAM;AAACC,IAAAA;AAAD,MAAkB/C,QAAQ,CAACgD,iBAAT,CAA2BF,MAA3B,CAAxB;AAEA,SAAO/C,MAAM,GAAGgD,aAAa,CAAC,CAAD,CAA7B;AACD","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 {hexbin} from 'd3-hexbin';\nimport {createIterable, log} from '@deck.gl/core';\n\n/**\n * Use d3-hexbin to performs hexagonal binning from geo points to hexagons\n * @param {Iterable} data - array of points\n * @param {Number} radius - hexagon radius in meter\n * @param {function} getPosition - get points lon lat\n * @param {Object} viewport - current viewport object\n\n * @return {Object} - hexagons and countRange\n */\nexport function pointToHexbin(props, aggregationParams) {\n const {data, radius} = props;\n const {viewport, attributes} = aggregationParams;\n // get hexagon radius in mercator world unit\n const centerLngLat = data.length ? getPointsCenter(data, aggregationParams) : null;\n const radiusCommon = getRadiusInCommon(radius, viewport, centerLngLat);\n\n // add world space coordinates to points\n const screenPoints: {\n screenCoord: number[];\n source: any;\n index: number;\n }[] = [];\n const {iterable, objectInfo} = createIterable(data);\n const positions = attributes.positions.value;\n const {size} = attributes.positions.getAccessor();\n for (const object of iterable) {\n objectInfo.index++;\n const posIndex = objectInfo.index * size;\n const position = [positions[posIndex], positions[posIndex + 1]];\n const arrayIsFinite = Number.isFinite(position[0]) && Number.isFinite(position[1]);\n if (arrayIsFinite) {\n screenPoints.push({\n screenCoord: viewport.projectFlat(position),\n source: object,\n index: objectInfo.index\n });\n } else {\n log.warn('HexagonLayer: invalid position')();\n }\n }\n\n const newHexbin = hexbin()\n .radius(radiusCommon)\n .x(d => d.screenCoord[0])\n .y(d => d.screenCoord[1]);\n\n const hexagonBins = newHexbin(screenPoints);\n\n return {\n hexagons: hexagonBins.map((hex, index) => ({\n position: viewport.unprojectFlat([hex.x, hex.y]),\n points: hex,\n index\n })),\n radiusCommon\n };\n}\n\n/**\n * Get the bounding box of all data points\n */\nexport function getPointsCenter(data, aggregationParams) {\n const {attributes} = aggregationParams;\n const positions = attributes.positions.value;\n const {size} = attributes.positions.getAccessor();\n\n let minX = Infinity;\n let minY = Infinity;\n let maxX = -Infinity;\n let maxY = -Infinity;\n let i;\n\n for (i = 0; i < size * data.length; i += size) {\n const x = positions[i];\n const y = positions[i + 1];\n const arrayIsFinite = Number.isFinite(x) && Number.isFinite(y);\n\n if (arrayIsFinite) {\n minX = Math.min(x, minX);\n maxX = Math.max(x, maxX);\n minY = Math.min(y, minY);\n maxY = Math.max(y, maxY);\n }\n }\n\n // return center\n return [minX, minY, maxX, maxY].every(Number.isFinite)\n ? [(minX + maxX) / 2, (minY + maxY) / 2]\n : null;\n}\n\n/**\n * Get radius in mercator world space coordinates from meter\n * @param {Number} radius - in meter\n * @param {Object} viewport - current viewport object\n * @param {Array<Number>} center - data center\n\n * @return {Number} radius in mercator world spcae coordinates\n */\nexport function getRadiusInCommon(radius, viewport, center) {\n const {unitsPerMeter} = viewport.getDistanceScales(center);\n // x, y distance should be the same\n return radius * unitsPerMeter[0];\n}\n"],"file":"hexagon-aggregator.js"}