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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (318) hide show
  1. package/dist/common/aggregation-layer.d.ts +30 -0
  2. package/dist/common/aggregation-layer.d.ts.map +1 -0
  3. package/dist/common/aggregation-layer.js +69 -0
  4. package/dist/common/aggregator/aggregator.d.ts +76 -0
  5. package/dist/common/aggregator/aggregator.d.ts.map +1 -0
  6. package/dist/common/aggregator/aggregator.js +4 -0
  7. package/dist/common/aggregator/cpu-aggregator/aggregate.d.ts +27 -0
  8. package/dist/common/aggregator/cpu-aggregator/aggregate.d.ts.map +1 -0
  9. package/dist/common/aggregator/cpu-aggregator/aggregate.js +66 -0
  10. package/dist/common/aggregator/cpu-aggregator/cpu-aggregator.d.ts +70 -0
  11. package/dist/common/aggregator/cpu-aggregator/cpu-aggregator.d.ts.map +1 -0
  12. package/dist/common/aggregator/cpu-aggregator/cpu-aggregator.js +139 -0
  13. package/dist/common/aggregator/cpu-aggregator/sort-bins.d.ts +15 -0
  14. package/dist/common/aggregator/cpu-aggregator/sort-bins.d.ts.map +1 -0
  15. package/dist/common/aggregator/cpu-aggregator/sort-bins.js +43 -0
  16. package/dist/common/aggregator/cpu-aggregator/vertex-accessor.d.ts +21 -0
  17. package/dist/common/aggregator/cpu-aggregator/vertex-accessor.d.ts.map +1 -0
  18. package/dist/common/aggregator/cpu-aggregator/vertex-accessor.js +55 -0
  19. package/dist/common/aggregator/gpu-aggregator/aggregation-transform-uniforms.d.ts +18 -0
  20. package/dist/common/aggregator/gpu-aggregator/aggregation-transform-uniforms.d.ts.map +1 -0
  21. package/dist/common/aggregator/gpu-aggregator/aggregation-transform-uniforms.js +20 -0
  22. package/dist/common/aggregator/gpu-aggregator/bin-sorter-uniforms.d.ts +14 -0
  23. package/dist/common/aggregator/gpu-aggregator/bin-sorter-uniforms.d.ts.map +1 -0
  24. package/dist/common/aggregator/gpu-aggregator/bin-sorter-uniforms.js +17 -0
  25. package/dist/common/aggregator/gpu-aggregator/utils.d.ts +6 -0
  26. package/dist/common/aggregator/gpu-aggregator/utils.d.ts.map +1 -0
  27. package/dist/common/aggregator/gpu-aggregator/utils.js +24 -0
  28. package/dist/common/aggregator/gpu-aggregator/webgl-aggregation-transform.d.ts +24 -0
  29. package/dist/common/aggregator/gpu-aggregator/webgl-aggregation-transform.d.ts.map +1 -0
  30. package/dist/common/aggregator/gpu-aggregator/webgl-aggregation-transform.js +215 -0
  31. package/dist/common/aggregator/gpu-aggregator/webgl-aggregator.d.ts +81 -0
  32. package/dist/common/aggregator/gpu-aggregator/webgl-aggregator.d.ts.map +1 -0
  33. package/dist/common/aggregator/gpu-aggregator/webgl-aggregator.js +201 -0
  34. package/dist/common/aggregator/gpu-aggregator/webgl-bin-sorter.d.ts +38 -0
  35. package/dist/common/aggregator/gpu-aggregator/webgl-bin-sorter.d.ts.map +1 -0
  36. package/dist/common/aggregator/gpu-aggregator/webgl-bin-sorter.js +223 -0
  37. package/dist/common/aggregator/index.d.ts +6 -0
  38. package/dist/common/aggregator/index.d.ts.map +1 -0
  39. package/dist/common/aggregator/index.js +5 -0
  40. package/dist/common/types.d.ts +11 -0
  41. package/dist/common/types.d.ts.map +1 -0
  42. package/dist/common/types.js +4 -0
  43. package/dist/common/utils/bounds-utils.d.ts +10 -0
  44. package/dist/common/utils/bounds-utils.d.ts.map +1 -0
  45. package/dist/common/utils/bounds-utils.js +20 -0
  46. package/dist/common/utils/color-utils.d.ts +10 -0
  47. package/dist/common/utils/color-utils.d.ts.map +1 -0
  48. package/dist/common/utils/color-utils.js +65 -0
  49. package/dist/common/utils/prop-utils.d.ts.map +1 -0
  50. package/dist/common/utils/prop-utils.js +12 -0
  51. package/dist/common/utils/scale-utils.d.ts +46 -0
  52. package/dist/common/utils/scale-utils.d.ts.map +1 -0
  53. package/dist/common/utils/scale-utils.js +180 -0
  54. package/dist/contour-layer/bin-options-uniforms.d.ts +13 -0
  55. package/dist/contour-layer/bin-options-uniforms.d.ts.map +1 -0
  56. package/dist/contour-layer/bin-options-uniforms.js +17 -0
  57. package/dist/contour-layer/contour-layer.d.ts +42 -50
  58. package/dist/contour-layer/contour-layer.d.ts.map +1 -1
  59. package/dist/contour-layer/contour-layer.js +232 -192
  60. package/dist/contour-layer/contour-utils.d.ts +36 -15
  61. package/dist/contour-layer/contour-utils.d.ts.map +1 -1
  62. package/dist/contour-layer/contour-utils.js +24 -29
  63. package/dist/contour-layer/marching-squares-codes.d.ts.map +1 -1
  64. package/dist/contour-layer/marching-squares-codes.js +3 -0
  65. package/dist/contour-layer/marching-squares.d.ts +22 -6
  66. package/dist/contour-layer/marching-squares.d.ts.map +1 -1
  67. package/dist/contour-layer/marching-squares.js +71 -68
  68. package/dist/contour-layer/value-reader.d.ts +10 -0
  69. package/dist/contour-layer/value-reader.d.ts.map +1 -0
  70. package/dist/contour-layer/value-reader.js +46 -0
  71. package/dist/dist.dev.js +4842 -4081
  72. package/dist/grid-layer/bin-options-uniforms.d.ts +13 -0
  73. package/dist/grid-layer/bin-options-uniforms.d.ts.map +1 -0
  74. package/dist/grid-layer/bin-options-uniforms.js +17 -0
  75. package/dist/grid-layer/grid-cell-layer-vertex.glsl.d.ts +3 -0
  76. package/dist/grid-layer/grid-cell-layer-vertex.glsl.d.ts.map +1 -0
  77. package/dist/grid-layer/grid-cell-layer-vertex.glsl.js +51 -0
  78. package/dist/grid-layer/grid-cell-layer.d.ts +32 -0
  79. package/dist/grid-layer/grid-cell-layer.d.ts.map +1 -0
  80. package/dist/grid-layer/grid-cell-layer.js +93 -0
  81. package/dist/grid-layer/grid-layer-uniforms.d.ts +21 -0
  82. package/dist/grid-layer/grid-layer-uniforms.d.ts.map +1 -0
  83. package/dist/grid-layer/grid-layer-uniforms.js +23 -0
  84. package/dist/grid-layer/grid-layer.d.ts +175 -13
  85. package/dist/grid-layer/grid-layer.d.ts.map +1 -1
  86. package/dist/grid-layer/grid-layer.js +342 -46
  87. package/dist/{aggregation-layer.d.ts → heatmap-layer/aggregation-layer.d.ts} +1 -0
  88. package/dist/heatmap-layer/aggregation-layer.d.ts.map +1 -0
  89. package/dist/{aggregation-layer.js → heatmap-layer/aggregation-layer.js} +6 -21
  90. package/dist/heatmap-layer/heatmap-layer-uniforms.d.ts +30 -0
  91. package/dist/heatmap-layer/heatmap-layer-uniforms.d.ts.map +1 -0
  92. package/dist/heatmap-layer/heatmap-layer-uniforms.js +32 -0
  93. package/dist/heatmap-layer/heatmap-layer-utils.d.ts +1 -1
  94. package/dist/heatmap-layer/heatmap-layer-utils.d.ts.map +1 -1
  95. package/dist/heatmap-layer/heatmap-layer-utils.js +3 -0
  96. package/dist/heatmap-layer/heatmap-layer.d.ts +6 -4
  97. package/dist/heatmap-layer/heatmap-layer.d.ts.map +1 -1
  98. package/dist/heatmap-layer/heatmap-layer.js +43 -33
  99. package/dist/heatmap-layer/max-fs.glsl.d.ts.map +1 -1
  100. package/dist/heatmap-layer/max-fs.glsl.js +3 -0
  101. package/dist/heatmap-layer/max-vs.glsl.d.ts +1 -1
  102. package/dist/heatmap-layer/max-vs.glsl.d.ts.map +1 -1
  103. package/dist/heatmap-layer/max-vs.glsl.js +6 -4
  104. package/dist/heatmap-layer/triangle-layer-fragment.glsl.d.ts +1 -1
  105. package/dist/heatmap-layer/triangle-layer-fragment.glsl.d.ts.map +1 -1
  106. package/dist/heatmap-layer/triangle-layer-fragment.glsl.js +5 -23
  107. package/dist/heatmap-layer/triangle-layer-uniforms.d.ts +22 -0
  108. package/dist/heatmap-layer/triangle-layer-uniforms.d.ts.map +1 -0
  109. package/dist/heatmap-layer/triangle-layer-uniforms.js +22 -0
  110. package/dist/heatmap-layer/triangle-layer-vertex.glsl.d.ts +1 -1
  111. package/dist/heatmap-layer/triangle-layer-vertex.glsl.d.ts.map +1 -1
  112. package/dist/heatmap-layer/triangle-layer-vertex.glsl.js +10 -30
  113. package/dist/heatmap-layer/triangle-layer.d.ts +4 -10
  114. package/dist/heatmap-layer/triangle-layer.d.ts.map +1 -1
  115. package/dist/heatmap-layer/triangle-layer.js +17 -30
  116. package/dist/heatmap-layer/weights-fs.glsl.d.ts.map +1 -1
  117. package/dist/heatmap-layer/weights-fs.glsl.js +3 -0
  118. package/dist/heatmap-layer/weights-vs.glsl.d.ts +1 -1
  119. package/dist/heatmap-layer/weights-vs.glsl.d.ts.map +1 -1
  120. package/dist/heatmap-layer/weights-vs.glsl.js +6 -7
  121. package/dist/hexagon-layer/bin-options-uniforms.d.ts +14 -0
  122. package/dist/hexagon-layer/bin-options-uniforms.d.ts.map +1 -0
  123. package/dist/hexagon-layer/bin-options-uniforms.js +17 -0
  124. package/dist/hexagon-layer/hexagon-cell-layer-vertex.glsl.d.ts +3 -0
  125. package/dist/hexagon-layer/hexagon-cell-layer-vertex.glsl.d.ts.map +1 -0
  126. package/dist/hexagon-layer/hexagon-cell-layer-vertex.glsl.js +55 -0
  127. package/dist/hexagon-layer/hexagon-cell-layer.d.ts +29 -0
  128. package/dist/hexagon-layer/hexagon-cell-layer.d.ts.map +1 -0
  129. package/dist/hexagon-layer/hexagon-cell-layer.js +94 -0
  130. package/dist/hexagon-layer/hexagon-layer-uniforms.d.ts +19 -0
  131. package/dist/hexagon-layer/hexagon-layer-uniforms.d.ts.map +1 -0
  132. package/dist/hexagon-layer/hexagon-layer-uniforms.js +21 -0
  133. package/dist/hexagon-layer/hexagon-layer.d.ts +84 -54
  134. package/dist/hexagon-layer/hexagon-layer.d.ts.map +1 -1
  135. package/dist/hexagon-layer/hexagon-layer.js +307 -123
  136. package/dist/hexagon-layer/hexbin.d.ts +17 -0
  137. package/dist/hexagon-layer/hexbin.d.ts.map +1 -0
  138. package/dist/hexagon-layer/hexbin.js +69 -0
  139. package/dist/index.cjs +3025 -2946
  140. package/dist/index.cjs.map +4 -4
  141. package/dist/index.d.ts +7 -13
  142. package/dist/index.d.ts.map +1 -1
  143. package/dist/index.js +5 -27
  144. package/dist/screen-grid-layer/bin-options-uniforms.d.ts +11 -0
  145. package/dist/screen-grid-layer/bin-options-uniforms.d.ts.map +1 -0
  146. package/dist/screen-grid-layer/bin-options-uniforms.js +15 -0
  147. package/dist/screen-grid-layer/screen-grid-cell-layer.d.ts +11 -16
  148. package/dist/screen-grid-layer/screen-grid-cell-layer.d.ts.map +1 -1
  149. package/dist/screen-grid-layer/screen-grid-cell-layer.js +52 -134
  150. package/dist/screen-grid-layer/screen-grid-layer-fragment.glsl.d.ts +1 -1
  151. package/dist/screen-grid-layer/screen-grid-layer-fragment.glsl.d.ts.map +1 -1
  152. package/dist/screen-grid-layer/screen-grid-layer-fragment.glsl.js +4 -24
  153. package/dist/screen-grid-layer/screen-grid-layer-uniforms.d.ts +17 -0
  154. package/dist/screen-grid-layer/screen-grid-layer-uniforms.d.ts.map +1 -0
  155. package/dist/screen-grid-layer/screen-grid-layer-uniforms.js +19 -0
  156. package/dist/screen-grid-layer/screen-grid-layer-vertex.glsl.d.ts +1 -1
  157. package/dist/screen-grid-layer/screen-grid-layer-vertex.glsl.d.ts.map +1 -1
  158. package/dist/screen-grid-layer/screen-grid-layer-vertex.glsl.js +21 -62
  159. package/dist/screen-grid-layer/screen-grid-layer.d.ts +33 -40
  160. package/dist/screen-grid-layer/screen-grid-layer.d.ts.map +1 -1
  161. package/dist/screen-grid-layer/screen-grid-layer.js +157 -174
  162. package/dist.min.js +401 -382
  163. package/package.json +10 -9
  164. package/src/common/aggregation-layer.ts +107 -0
  165. package/src/common/aggregator/aggregator.ts +88 -0
  166. package/src/common/aggregator/cpu-aggregator/aggregate.ts +101 -0
  167. package/src/common/aggregator/cpu-aggregator/cpu-aggregator.ts +203 -0
  168. package/src/common/aggregator/cpu-aggregator/sort-bins.ts +63 -0
  169. package/src/common/aggregator/cpu-aggregator/vertex-accessor.ts +86 -0
  170. package/src/common/aggregator/gpu-aggregator/aggregation-transform-uniforms.ts +33 -0
  171. package/src/common/aggregator/gpu-aggregator/bin-sorter-uniforms.ts +27 -0
  172. package/src/common/aggregator/gpu-aggregator/utils.ts +27 -0
  173. package/src/common/aggregator/gpu-aggregator/webgl-aggregation-transform.ts +247 -0
  174. package/src/common/aggregator/gpu-aggregator/webgl-aggregator.ts +274 -0
  175. package/src/common/aggregator/gpu-aggregator/webgl-bin-sorter.ts +258 -0
  176. package/src/common/aggregator/index.ts +10 -0
  177. package/src/{types.ts → common/types.ts} +10 -4
  178. package/src/common/utils/bounds-utils.ts +34 -0
  179. package/src/common/utils/color-utils.ts +86 -0
  180. package/src/common/utils/prop-utils.ts +13 -0
  181. package/src/common/utils/scale-utils.ts +236 -0
  182. package/src/contour-layer/bin-options-uniforms.ts +26 -0
  183. package/src/contour-layer/contour-layer.ts +300 -265
  184. package/src/contour-layer/contour-utils.ts +68 -39
  185. package/src/contour-layer/marching-squares-codes.ts +4 -0
  186. package/src/contour-layer/marching-squares.ts +93 -82
  187. package/src/contour-layer/value-reader.ts +65 -0
  188. package/src/grid-layer/bin-options-uniforms.ts +26 -0
  189. package/src/grid-layer/grid-cell-layer-vertex.glsl.ts +68 -0
  190. package/src/grid-layer/grid-cell-layer.ts +141 -0
  191. package/src/grid-layer/grid-layer-uniforms.ts +37 -0
  192. package/src/grid-layer/grid-layer.ts +614 -73
  193. package/src/{aggregation-layer.ts → heatmap-layer/aggregation-layer.ts} +6 -21
  194. package/src/heatmap-layer/heatmap-layer-uniforms.ts +50 -0
  195. package/src/heatmap-layer/heatmap-layer-utils.ts +9 -1
  196. package/src/heatmap-layer/heatmap-layer.ts +59 -36
  197. package/src/heatmap-layer/max-fs.glsl.ts +4 -0
  198. package/src/heatmap-layer/max-vs.glsl.ts +7 -4
  199. package/src/heatmap-layer/triangle-layer-fragment.glsl.ts +5 -23
  200. package/src/heatmap-layer/triangle-layer-uniforms.ts +37 -0
  201. package/src/heatmap-layer/triangle-layer-vertex.glsl.ts +10 -30
  202. package/src/heatmap-layer/triangle-layer.ts +26 -31
  203. package/src/heatmap-layer/weights-fs.glsl.ts +4 -0
  204. package/src/heatmap-layer/weights-vs.glsl.ts +7 -7
  205. package/src/hexagon-layer/bin-options-uniforms.ts +27 -0
  206. package/src/hexagon-layer/hexagon-cell-layer-vertex.glsl.ts +73 -0
  207. package/src/hexagon-layer/hexagon-cell-layer.ts +141 -0
  208. package/src/hexagon-layer/hexagon-layer-uniforms.ts +34 -0
  209. package/src/hexagon-layer/hexagon-layer.ts +454 -186
  210. package/src/hexagon-layer/hexbin.ts +79 -0
  211. package/src/index.ts +21 -34
  212. package/src/screen-grid-layer/bin-options-uniforms.ts +23 -0
  213. package/src/screen-grid-layer/screen-grid-cell-layer.ts +71 -156
  214. package/src/screen-grid-layer/screen-grid-layer-fragment.glsl.ts +4 -24
  215. package/src/screen-grid-layer/screen-grid-layer-uniforms.ts +31 -0
  216. package/src/screen-grid-layer/screen-grid-layer-vertex.glsl.ts +21 -64
  217. package/src/screen-grid-layer/screen-grid-layer.ts +194 -222
  218. package/dist/aggregation-layer.d.ts.map +0 -1
  219. package/dist/cpu-grid-layer/cpu-grid-layer.d.ts +0 -158
  220. package/dist/cpu-grid-layer/cpu-grid-layer.d.ts.map +0 -1
  221. package/dist/cpu-grid-layer/cpu-grid-layer.js +0 -130
  222. package/dist/cpu-grid-layer/grid-aggregator.d.ts +0 -35
  223. package/dist/cpu-grid-layer/grid-aggregator.d.ts.map +0 -1
  224. package/dist/cpu-grid-layer/grid-aggregator.js +0 -141
  225. package/dist/gpu-grid-layer/gpu-grid-cell-layer-fragment.glsl.d.ts +0 -3
  226. package/dist/gpu-grid-layer/gpu-grid-cell-layer-fragment.glsl.d.ts.map +0 -1
  227. package/dist/gpu-grid-layer/gpu-grid-cell-layer-fragment.glsl.js +0 -30
  228. package/dist/gpu-grid-layer/gpu-grid-cell-layer-vertex.glsl.d.ts +0 -3
  229. package/dist/gpu-grid-layer/gpu-grid-cell-layer-vertex.glsl.d.ts.map +0 -1
  230. package/dist/gpu-grid-layer/gpu-grid-cell-layer-vertex.glsl.js +0 -112
  231. package/dist/gpu-grid-layer/gpu-grid-cell-layer.d.ts +0 -48
  232. package/dist/gpu-grid-layer/gpu-grid-cell-layer.d.ts.map +0 -1
  233. package/dist/gpu-grid-layer/gpu-grid-cell-layer.js +0 -146
  234. package/dist/gpu-grid-layer/gpu-grid-layer.d.ts +0 -99
  235. package/dist/gpu-grid-layer/gpu-grid-layer.d.ts.map +0 -1
  236. package/dist/gpu-grid-layer/gpu-grid-layer.js +0 -289
  237. package/dist/grid-aggregation-layer.d.ts +0 -67
  238. package/dist/grid-aggregation-layer.d.ts.map +0 -1
  239. package/dist/grid-aggregation-layer.js +0 -173
  240. package/dist/hexagon-layer/hexagon-aggregator.d.ts +0 -27
  241. package/dist/hexagon-layer/hexagon-aggregator.d.ts.map +0 -1
  242. package/dist/hexagon-layer/hexagon-aggregator.js +0 -112
  243. package/dist/types.d.ts +0 -12
  244. package/dist/types.d.ts.map +0 -1
  245. package/dist/types.js +0 -1
  246. package/dist/utils/aggregation-operation-utils.d.ts +0 -19
  247. package/dist/utils/aggregation-operation-utils.d.ts.map +0 -1
  248. package/dist/utils/aggregation-operation-utils.js +0 -94
  249. package/dist/utils/bin-sorter.d.ts +0 -52
  250. package/dist/utils/bin-sorter.d.ts.map +0 -1
  251. package/dist/utils/bin-sorter.js +0 -167
  252. package/dist/utils/color-utils.d.ts +0 -3
  253. package/dist/utils/color-utils.d.ts.map +0 -1
  254. package/dist/utils/color-utils.js +0 -53
  255. package/dist/utils/cpu-aggregator.d.ts +0 -169
  256. package/dist/utils/cpu-aggregator.d.ts.map +0 -1
  257. package/dist/utils/cpu-aggregator.js +0 -421
  258. package/dist/utils/gpu-grid-aggregation/aggregate-all-fs.glsl.d.ts +0 -3
  259. package/dist/utils/gpu-grid-aggregation/aggregate-all-fs.glsl.d.ts.map +0 -1
  260. package/dist/utils/gpu-grid-aggregation/aggregate-all-fs.glsl.js +0 -36
  261. package/dist/utils/gpu-grid-aggregation/aggregate-all-vs.glsl.d.ts +0 -3
  262. package/dist/utils/gpu-grid-aggregation/aggregate-all-vs.glsl.d.ts.map +0 -1
  263. package/dist/utils/gpu-grid-aggregation/aggregate-all-vs.glsl.js +0 -42
  264. package/dist/utils/gpu-grid-aggregation/aggregate-to-grid-fs.glsl.d.ts +0 -3
  265. package/dist/utils/gpu-grid-aggregation/aggregate-to-grid-fs.glsl.d.ts.map +0 -1
  266. package/dist/utils/gpu-grid-aggregation/aggregate-to-grid-fs.glsl.js +0 -30
  267. package/dist/utils/gpu-grid-aggregation/aggregate-to-grid-vs.glsl.d.ts +0 -3
  268. package/dist/utils/gpu-grid-aggregation/aggregate-to-grid-vs.glsl.d.ts.map +0 -1
  269. package/dist/utils/gpu-grid-aggregation/aggregate-to-grid-vs.glsl.js +0 -61
  270. package/dist/utils/gpu-grid-aggregation/gpu-grid-aggregator-constants.d.ts +0 -38
  271. package/dist/utils/gpu-grid-aggregation/gpu-grid-aggregator-constants.d.ts.map +0 -1
  272. package/dist/utils/gpu-grid-aggregation/gpu-grid-aggregator-constants.js +0 -41
  273. package/dist/utils/gpu-grid-aggregation/gpu-grid-aggregator-utils.d.ts +0 -1
  274. package/dist/utils/gpu-grid-aggregation/gpu-grid-aggregator-utils.d.ts.map +0 -1
  275. package/dist/utils/gpu-grid-aggregation/gpu-grid-aggregator-utils.js +0 -1
  276. package/dist/utils/gpu-grid-aggregation/gpu-grid-aggregator.d.ts +0 -76
  277. package/dist/utils/gpu-grid-aggregation/gpu-grid-aggregator.d.ts.map +0 -1
  278. package/dist/utils/gpu-grid-aggregation/gpu-grid-aggregator.js +0 -555
  279. package/dist/utils/gpu-grid-aggregation/transform-mean-vs.glsl.d.ts +0 -3
  280. package/dist/utils/gpu-grid-aggregation/transform-mean-vs.glsl.d.ts.map +0 -1
  281. package/dist/utils/gpu-grid-aggregation/transform-mean-vs.glsl.js +0 -32
  282. package/dist/utils/grid-aggregation-utils.d.ts +0 -30
  283. package/dist/utils/grid-aggregation-utils.d.ts.map +0 -1
  284. package/dist/utils/grid-aggregation-utils.js +0 -114
  285. package/dist/utils/prop-utils.d.ts.map +0 -1
  286. package/dist/utils/prop-utils.js +0 -28
  287. package/dist/utils/resource-utils.d.ts +0 -14
  288. package/dist/utils/resource-utils.d.ts.map +0 -1
  289. package/dist/utils/resource-utils.js +0 -38
  290. package/dist/utils/scale-utils.d.ts +0 -15
  291. package/dist/utils/scale-utils.d.ts.map +0 -1
  292. package/dist/utils/scale-utils.js +0 -184
  293. package/src/cpu-grid-layer/cpu-grid-layer.ts +0 -329
  294. package/src/cpu-grid-layer/grid-aggregator.ts +0 -184
  295. package/src/gpu-grid-layer/gpu-grid-cell-layer-fragment.glsl.ts +0 -35
  296. package/src/gpu-grid-layer/gpu-grid-cell-layer-vertex.glsl.ts +0 -143
  297. package/src/gpu-grid-layer/gpu-grid-cell-layer.ts +0 -201
  298. package/src/gpu-grid-layer/gpu-grid-layer.ts +0 -455
  299. package/src/grid-aggregation-layer.ts +0 -243
  300. package/src/hexagon-layer/hexagon-aggregator.ts +0 -127
  301. package/src/utils/aggregation-operation-utils.ts +0 -118
  302. package/src/utils/bin-sorter.ts +0 -218
  303. package/src/utils/color-utils.ts +0 -57
  304. package/src/utils/cpu-aggregator.ts +0 -503
  305. package/src/utils/gpu-grid-aggregation/aggregate-all-fs.glsl.ts +0 -40
  306. package/src/utils/gpu-grid-aggregation/aggregate-all-vs.glsl.ts +0 -54
  307. package/src/utils/gpu-grid-aggregation/aggregate-to-grid-fs.glsl.ts +0 -35
  308. package/src/utils/gpu-grid-aggregation/aggregate-to-grid-vs.glsl.ts +0 -79
  309. package/src/utils/gpu-grid-aggregation/gpu-grid-aggregator-constants.ts +0 -46
  310. package/src/utils/gpu-grid-aggregation/gpu-grid-aggregator-utils.ts +0 -0
  311. package/src/utils/gpu-grid-aggregation/gpu-grid-aggregator.md +0 -155
  312. package/src/utils/gpu-grid-aggregation/gpu-grid-aggregator.ts +0 -690
  313. package/src/utils/gpu-grid-aggregation/transform-mean-vs.glsl.ts +0 -38
  314. package/src/utils/grid-aggregation-utils.ts +0 -147
  315. package/src/utils/prop-utils.ts +0 -29
  316. package/src/utils/resource-utils.ts +0 -53
  317. package/src/utils/scale-utils.js +0 -219
  318. /package/dist/{utils → common/utils}/prop-utils.d.ts +0 -0
@@ -1,33 +1,18 @@
1
- // Copyright (c) 2015 - 2019 Uber Technologies, Inc.
2
- //
3
- // Permission is hereby granted, free of charge, to any person obtaining a copy
4
- // of this software and associated documentation files (the "Software"), to deal
5
- // in the Software without restriction, including without limitation the rights
6
- // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
- // copies of the Software, and to permit persons to whom the Software is
8
- // furnished to do so, subject to the following conditions:
9
- //
10
- // The above copyright notice and this permission notice shall be included in
11
- // all copies or substantial portions of the Software.
12
- //
13
- // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
- // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
- // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
- // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
- // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
- // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
- // THE SOFTWARE.
1
+ // deck.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright (c) vis.gl contributors
20
4
  /* global setTimeout clearTimeout */
21
5
  import { getBounds, boundsContain, packVertices, scaleToAspectRatio, getTextureCoordinates } from "./heatmap-layer-utils.js";
22
6
  import { TextureTransform } from '@luma.gl/engine';
23
- import { AttributeManager, COORDINATE_SYSTEM, log } from '@deck.gl/core';
7
+ import { AttributeManager, COORDINATE_SYSTEM, log, project32 } from '@deck.gl/core';
24
8
  import TriangleLayer from "./triangle-layer.js";
25
- import AggregationLayer from "../aggregation-layer.js";
26
- import { defaultColorRange, colorRangeToFlatArray } from "../utils/color-utils.js";
9
+ import AggregationLayer from "./aggregation-layer.js";
10
+ import { defaultColorRange, colorRangeToFlatArray } from "../common/utils/color-utils.js";
27
11
  import weightsVs from "./weights-vs.glsl.js";
28
12
  import weightsFs from "./weights-fs.glsl.js";
29
13
  import maxVs from "./max-vs.glsl.js";
30
14
  import maxFs from "./max-fs.glsl.js";
15
+ import { maxWeightUniforms, weightUniforms } from "./heatmap-layer-uniforms.js";
31
16
  const RESOLUTION = 2; // (number of common space pixels) / (number texels)
32
17
  const TEXTURE_PROPS = {
33
18
  format: 'rgba8unorm',
@@ -68,6 +53,13 @@ const DIMENSIONS = {
68
53
  };
69
54
  /** Visualizes the spatial distribution of data. */
70
55
  class HeatmapLayer extends AggregationLayer {
56
+ getShaders(shaders) {
57
+ let modules = [project32];
58
+ if (shaders.modules) {
59
+ modules = [...modules, ...shaders.modules];
60
+ }
61
+ return super.getShaders({ ...shaders, modules });
62
+ }
71
63
  initializeState() {
72
64
  super.initializeAggregationLayer(DIMENSIONS);
73
65
  this.setState({ colorDomain: DEFAULT_COLOR_DOMAIN });
@@ -231,7 +223,8 @@ class HeatmapLayer extends AggregationLayer {
231
223
  blendAlphaDstFactor: 'one'
232
224
  },
233
225
  topology: 'point-list',
234
- ...shaders
226
+ ...shaders,
227
+ modules: [...shaders.modules, weightUniforms]
235
228
  });
236
229
  this.setState({ weightsTransform });
237
230
  }
@@ -244,11 +237,13 @@ class HeatmapLayer extends AggregationLayer {
244
237
  fs: weightsFs
245
238
  });
246
239
  this._createWeightsTransform(weightsTransformShaders);
247
- const maxWeightsTransformShaders = this.getShaders({ vs: maxVs, fs: maxFs });
240
+ const maxWeightsTransformShaders = this.getShaders({
241
+ vs: maxVs,
242
+ fs: maxFs,
243
+ modules: [maxWeightUniforms]
244
+ });
248
245
  const maxWeightTransform = new TextureTransform(device, {
249
246
  id: `${this.id}-max-weights-transform`,
250
- bindings: { inTexture: weightsTexture },
251
- uniforms: { textureSize },
252
247
  targetTexture: maxWeightsTexture,
253
248
  ...maxWeightsTransformShaders,
254
249
  vertexCount: textureSize * textureSize,
@@ -263,6 +258,10 @@ class HeatmapLayer extends AggregationLayer {
263
258
  blendAlphaDstFactor: 'one'
264
259
  }
265
260
  });
261
+ const maxWeightProps = { inTexture: weightsTexture, textureSize };
262
+ maxWeightTransform.model.shaderInputs.setProps({
263
+ maxWeight: maxWeightProps
264
+ });
266
265
  this.setState({
267
266
  weightsTexture,
268
267
  maxWeightsTexture,
@@ -296,8 +295,8 @@ class HeatmapLayer extends AggregationLayer {
296
295
  const viewportCorners = [
297
296
  viewport.unproject([0, 0]),
298
297
  viewport.unproject([viewport.width, 0]),
299
- viewport.unproject([viewport.width, viewport.height]),
300
- viewport.unproject([0, viewport.height])
298
+ viewport.unproject([0, viewport.height]),
299
+ viewport.unproject([viewport.width, viewport.height])
301
300
  ].map(p => p.map(Math.fround));
302
301
  // #1: get world bounds for current viewport extends
303
302
  const visibleWorldBounds = getBounds(viewportCorners); // TODO: Change to visible bounds
@@ -341,10 +340,11 @@ class HeatmapLayer extends AggregationLayer {
341
340
  const colors = colorRangeToFlatArray(colorRange, false, Uint8Array);
342
341
  if (colorTexture && colorTexture?.width === colorRange.length) {
343
342
  // TODO(v9): Unclear whether `setSubImageData` is a public API, or what to use if not.
344
- colorTexture.setSubImageData({ data: colors });
343
+ colorTexture.setTexture2DData({ data: colors });
345
344
  }
346
345
  else {
347
346
  colorTexture?.destroy();
347
+ // @ts-expect-error TODO(ib) - texture API change
348
348
  colorTexture = this.context.device.createTexture({
349
349
  ...TEXTURE_PROPS,
350
350
  data: colors,
@@ -356,7 +356,7 @@ class HeatmapLayer extends AggregationLayer {
356
356
  }
357
357
  _updateWeightmap() {
358
358
  const { radiusPixels, colorDomain, aggregation } = this.props;
359
- const { worldBounds, textureSize, weightsScale } = this.state;
359
+ const { worldBounds, textureSize, weightsScale, weightsTexture } = this.state;
360
360
  const weightsTransform = this.state.weightsTransform;
361
361
  this.state.isWeightMapDirty = false;
362
362
  // convert world bounds to common using Layer's coordiante system and origin
@@ -376,11 +376,21 @@ class HeatmapLayer extends AggregationLayer {
376
376
  const attributeManager = this.getAttributeManager();
377
377
  const attributes = attributeManager.getAttributes();
378
378
  const moduleSettings = this.getModuleSettings();
379
- const uniforms = { radiusPixels, commonBounds, textureWidth: textureSize, weightsScale };
380
379
  this._setModelAttributes(weightsTransform.model, attributes);
381
380
  weightsTransform.model.setVertexCount(this.getNumInstances());
382
- weightsTransform.model.setUniforms(uniforms);
383
- weightsTransform.model.updateModuleSettings(moduleSettings);
381
+ const weightProps = {
382
+ radiusPixels,
383
+ commonBounds,
384
+ textureWidth: textureSize,
385
+ weightsScale,
386
+ weightsTexture: weightsTexture
387
+ };
388
+ const { viewport, devicePixelRatio, coordinateSystem, coordinateOrigin } = moduleSettings;
389
+ const { modelMatrix } = this.props;
390
+ weightsTransform.model.shaderInputs.setProps({
391
+ project: { viewport, devicePixelRatio, modelMatrix, coordinateSystem, coordinateOrigin },
392
+ weight: weightProps
393
+ });
384
394
  weightsTransform.run({
385
395
  parameters: { viewport: [0, 0, textureSize, textureSize] },
386
396
  clearColor: [0, 0, 0, 0]
@@ -1 +1 @@
1
- {"version":3,"file":"max-fs.glsl.d.ts","sourceRoot":"","sources":["../../src/heatmap-layer/max-fs.glsl.ts"],"names":[],"mappings":";AAAA,wBAQE"}
1
+ {"version":3,"file":"max-fs.glsl.d.ts","sourceRoot":"","sources":["../../src/heatmap-layer/max-fs.glsl.ts"],"names":[],"mappings":";AAIA,wBAQE"}
@@ -1,3 +1,6 @@
1
+ // deck.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright (c) vis.gl contributors
1
4
  export default `\
2
5
  #version 300 es
3
6
  in vec4 outTexture;
@@ -1,3 +1,3 @@
1
- declare const _default: "#version 300 es\nuniform sampler2D inTexture;\nuniform float textureSize;\nout vec4 outTexture;\n\nvoid main()\n{\n // Sample every pixel in texture\n int yIndex = gl_VertexID / int(textureSize);\n int xIndex = gl_VertexID - (yIndex * int(textureSize));\n vec2 uv = (0.5 + vec2(float(xIndex), float(yIndex))) / textureSize;\n outTexture = texture(inTexture, uv);\n\n gl_Position = vec4(0.0, 0.0, 0.0, 1.0);\n // Enforce default value for ANGLE issue (https://bugs.chromium.org/p/angleproject/issues/detail?id=3941)\n gl_PointSize = 1.0;\n}\n";
1
+ declare const _default: "#version 300 es\nuniform sampler2D inTexture;\nout vec4 outTexture;\n\nvoid main()\n{\n // Sample every pixel in texture\n int yIndex = gl_VertexID / int(maxWeight.textureSize);\n int xIndex = gl_VertexID - (yIndex * int(maxWeight.textureSize));\n vec2 uv = (0.5 + vec2(float(xIndex), float(yIndex))) / maxWeight.textureSize;\n outTexture = texture(inTexture, uv);\n\n gl_Position = vec4(0.0, 0.0, 0.0, 1.0);\n // Enforce default value for ANGLE issue (https://bugs.chromium.org/p/angleproject/issues/detail?id=3941)\n gl_PointSize = 1.0;\n}\n";
2
2
  export default _default;
3
3
  //# sourceMappingURL=max-vs.glsl.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"max-vs.glsl.d.ts","sourceRoot":"","sources":["../../src/heatmap-layer/max-vs.glsl.ts"],"names":[],"mappings":";AAAA,wBAkBE"}
1
+ {"version":3,"file":"max-vs.glsl.d.ts","sourceRoot":"","sources":["../../src/heatmap-layer/max-vs.glsl.ts"],"names":[],"mappings":";AAIA,wBAiBE"}
@@ -1,13 +1,15 @@
1
+ // deck.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright (c) vis.gl contributors
1
4
  export default `\
2
5
  #version 300 es
3
6
  uniform sampler2D inTexture;
4
- uniform float textureSize;
5
7
  out vec4 outTexture;
6
8
  void main()
7
9
  {
8
- int yIndex = gl_VertexID / int(textureSize);
9
- int xIndex = gl_VertexID - (yIndex * int(textureSize));
10
- vec2 uv = (0.5 + vec2(float(xIndex), float(yIndex))) / textureSize;
10
+ int yIndex = gl_VertexID / int(maxWeight.textureSize);
11
+ int xIndex = gl_VertexID - (yIndex * int(maxWeight.textureSize));
12
+ vec2 uv = (0.5 + vec2(float(xIndex), float(yIndex))) / maxWeight.textureSize;
11
13
  outTexture = texture(inTexture, uv);
12
14
  gl_Position = vec4(0.0, 0.0, 0.0, 1.0);
13
15
  gl_PointSize = 1.0;
@@ -1,3 +1,3 @@
1
- declare const _default: "#version 300 es\n#define SHADER_NAME triangle-layer-fragment-shader\n\nprecision highp float;\n\nuniform float opacity;\nuniform sampler2D weightsTexture;\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(weightsTexture, 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";
1
+ declare const _default: "#version 300 es\n#define SHADER_NAME triangle-layer-fragment-shader\n\nprecision highp float;\n\nuniform sampler2D weightsTexture;\nuniform sampler2D colorTexture;\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(weightsTexture, vTexCoords);\n float weight = weights.r;\n\n if (triangle.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 *= layer.opacity;\n fragColor = linearColor;\n}\n";
2
2
  export default _default;
3
3
  //# sourceMappingURL=triangle-layer-fragment.glsl.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"triangle-layer-fragment.glsl.d.ts","sourceRoot":"","sources":["../../src/heatmap-layer/triangle-layer-fragment.glsl.ts"],"names":[],"mappings":";AAoBA,wBAyCE"}
1
+ {"version":3,"file":"triangle-layer-fragment.glsl.d.ts","sourceRoot":"","sources":["../../src/heatmap-layer/triangle-layer-fragment.glsl.ts"],"names":[],"mappings":";AAIA,wBAuCE"}
@@ -1,30 +1,12 @@
1
- // Copyright (c) 2015 - 2017 Uber Technologies, Inc.
2
- //
3
- // Permission is hereby granted, free of charge, to any person obtaining a copy
4
- // of this software and associated documentation files (the "Software"), to deal
5
- // in the Software without restriction, including without limitation the rights
6
- // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
- // copies of the Software, and to permit persons to whom the Software is
8
- // furnished to do so, subject to the following conditions:
9
- //
10
- // The above copyright notice and this permission notice shall be included in
11
- // all copies or substantial portions of the Software.
12
- //
13
- // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
- // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
- // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
- // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
- // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
- // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
- // THE SOFTWARE.
1
+ // deck.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright (c) vis.gl contributors
20
4
  export default `\
21
5
  #version 300 es
22
6
  #define SHADER_NAME triangle-layer-fragment-shader
23
7
  precision highp float;
24
- uniform float opacity;
25
8
  uniform sampler2D weightsTexture;
26
9
  uniform sampler2D colorTexture;
27
- uniform float aggregationMode;
28
10
  in vec2 vTexCoords;
29
11
  in float vIntensityMin;
30
12
  in float vIntensityMax;
@@ -38,14 +20,14 @@ return color;
38
20
  void main(void) {
39
21
  vec4 weights = texture(weightsTexture, vTexCoords);
40
22
  float weight = weights.r;
41
- if (aggregationMode > 0.5) {
23
+ if (triangle.aggregationMode > 0.5) {
42
24
  weight /= max(1.0, weights.a);
43
25
  }
44
26
  if (weight <= 0.) {
45
27
  discard;
46
28
  }
47
29
  vec4 linearColor = getLinearColor(weight);
48
- linearColor.a *= opacity;
30
+ linearColor.a *= layer.opacity;
49
31
  fragColor = linearColor;
50
32
  }
51
33
  `;
@@ -0,0 +1,22 @@
1
+ import { Texture } from '@luma.gl/core';
2
+ export type TriangleProps = {
3
+ aggregationMode: number;
4
+ colorDomain: [number, number];
5
+ intensity: number;
6
+ threshold: number;
7
+ colorTexture: Texture;
8
+ maxTexture: Texture;
9
+ weightsTexture: Texture;
10
+ };
11
+ export declare const triangleUniforms: {
12
+ readonly name: "triangle";
13
+ readonly vs: "uniform triangleUniforms {\n float aggregationMode;\n vec2 colorDomain;\n float intensity;\n float threshold;\n} triangle;\n";
14
+ readonly fs: "uniform triangleUniforms {\n float aggregationMode;\n vec2 colorDomain;\n float intensity;\n float threshold;\n} triangle;\n";
15
+ readonly uniformTypes: {
16
+ readonly aggregationMode: "f32";
17
+ readonly colorDomain: "vec2<f32>";
18
+ readonly intensity: "f32";
19
+ readonly threshold: "f32";
20
+ };
21
+ };
22
+ //# sourceMappingURL=triangle-layer-uniforms.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"triangle-layer-uniforms.d.ts","sourceRoot":"","sources":["../../src/heatmap-layer/triangle-layer-uniforms.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,OAAO,EAAC,MAAM,eAAe,CAAC;AAYtC,MAAM,MAAM,aAAa,GAAG;IAC1B,eAAe,EAAE,MAAM,CAAC;IACxB,WAAW,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC9B,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,OAAO,CAAC;IACtB,UAAU,EAAE,OAAO,CAAC;IACpB,cAAc,EAAE,OAAO,CAAC;CACzB,CAAC;AAEF,eAAO,MAAM,gBAAgB;;;;;;;;;;CAUmB,CAAC"}
@@ -0,0 +1,22 @@
1
+ // deck.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright (c) vis.gl contributors
4
+ const uniformBlock = `\
5
+ uniform triangleUniforms {
6
+ float aggregationMode;
7
+ vec2 colorDomain;
8
+ float intensity;
9
+ float threshold;
10
+ } triangle;
11
+ `;
12
+ export const triangleUniforms = {
13
+ name: 'triangle',
14
+ vs: uniformBlock,
15
+ fs: uniformBlock,
16
+ uniformTypes: {
17
+ aggregationMode: 'f32',
18
+ colorDomain: 'vec2<f32>',
19
+ intensity: 'f32',
20
+ threshold: 'f32'
21
+ }
22
+ };
@@ -1,3 +1,3 @@
1
- declare const _default: "#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";
1
+ declare const _default: "#version 300 es\n#define SHADER_NAME heatp-map-layer-vertex-shader\n\nuniform sampler2D maxTexture;\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 = triangle.aggregationMode < 0.5 ? maxTexture.r : maxTexture.g;\n float minValue = maxValue * triangle.threshold;\n if (triangle.colorDomain[1] > 0.) {\n // if user specified custom domain use it.\n maxValue = triangle.colorDomain[1];\n minValue = triangle.colorDomain[0];\n }\n vIntensityMax = triangle.intensity / maxValue;\n vIntensityMin = triangle.intensity / minValue;\n}\n";
2
2
  export default _default;
3
3
  //# sourceMappingURL=triangle-layer-vertex.glsl.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"triangle-layer-vertex.glsl.d.ts","sourceRoot":"","sources":["../../src/heatmap-layer/triangle-layer-vertex.glsl.ts"],"names":[],"mappings":";AAsBA,wBA+BE"}
1
+ {"version":3,"file":"triangle-layer-vertex.glsl.d.ts","sourceRoot":"","sources":["../../src/heatmap-layer/triangle-layer-vertex.glsl.ts"],"names":[],"mappings":";AAMA,wBA2BE"}
@@ -1,31 +1,11 @@
1
- // Copyright (c) 2015 - 2017 Uber Technologies, Inc.
2
- //
3
- // Permission is hereby granted, free of charge, to any person obtaining a copy
4
- // of this software and associated documentation files (the "Software"), to deal
5
- // in the Software without restriction, including without limitation the rights
6
- // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
- // copies of the Software, and to permit persons to whom the Software is
8
- // furnished to do so, subject to the following conditions:
9
- //
10
- // The above copyright notice and this permission notice shall be included in
11
- // all copies or substantial portions of the Software.
12
- //
13
- // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
- // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
- // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
- // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
- // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
- // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
- // THE SOFTWARE.
1
+ // deck.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright (c) vis.gl contributors
20
4
  // Inspired by screen-grid-layer vertex shader in deck.gl
21
5
  export default `\
22
6
  #version 300 es
23
7
  #define SHADER_NAME heatp-map-layer-vertex-shader
24
8
  uniform sampler2D maxTexture;
25
- uniform float intensity;
26
- uniform vec2 colorDomain;
27
- uniform float threshold;
28
- uniform float aggregationMode;
29
9
  in vec3 positions;
30
10
  in vec2 texCoords;
31
11
  out vec2 vTexCoords;
@@ -35,13 +15,13 @@ void main(void) {
35
15
  gl_Position = project_position_to_clipspace(positions, vec3(0.0), vec3(0.0));
36
16
  vTexCoords = texCoords;
37
17
  vec4 maxTexture = texture(maxTexture, vec2(0.5));
38
- float maxValue = aggregationMode < 0.5 ? maxTexture.r : maxTexture.g;
39
- float minValue = maxValue * threshold;
40
- if (colorDomain[1] > 0.) {
41
- maxValue = colorDomain[1];
42
- minValue = colorDomain[0];
18
+ float maxValue = triangle.aggregationMode < 0.5 ? maxTexture.r : maxTexture.g;
19
+ float minValue = maxValue * triangle.threshold;
20
+ if (triangle.colorDomain[1] > 0.) {
21
+ maxValue = triangle.colorDomain[1];
22
+ minValue = triangle.colorDomain[0];
43
23
  }
44
- vIntensityMax = intensity / maxValue;
45
- vIntensityMin = intensity / minValue;
24
+ vIntensityMax = triangle.intensity / maxValue;
25
+ vIntensityMin = triangle.intensity / minValue;
46
26
  }
47
27
  `;
@@ -8,8 +8,8 @@ type _TriangleLayerProps = {
8
8
  texCoords: Buffer;
9
9
  };
10
10
  };
11
- colorDomain: number[];
12
- aggregationMode: string;
11
+ colorDomain: [number, number];
12
+ aggregationMode: number;
13
13
  threshold: number;
14
14
  intensity: number;
15
15
  vertexCount: number;
@@ -24,16 +24,10 @@ export default class TriangleLayer extends Layer<_TriangleLayerProps> {
24
24
  positions: Buffer;
25
25
  texCoords: Buffer;
26
26
  };
27
- getShaders(): {
28
- vs: string;
29
- fs: string;
30
- modules: import("@luma.gl/shadertools").ShaderModule[];
31
- };
27
+ getShaders(): any;
32
28
  initializeState({ device }: LayerContext): void;
33
29
  _getModel(device: Device): Model;
34
- draw({ uniforms }: {
35
- uniforms: any;
36
- }): void;
30
+ draw(): void;
37
31
  }
38
32
  export {};
39
33
  //# sourceMappingURL=triangle-layer.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"triangle-layer.d.ts","sourceRoot":"","sources":["../../src/heatmap-layer/triangle-layer.ts"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAC,MAAM,eAAe,CAAC;AAC3D,OAAO,EAAC,KAAK,EAAC,MAAM,iBAAiB,CAAC;AACtC,OAAO,EAAC,KAAK,EAAE,YAAY,EAAY,MAAM,eAAe,CAAC;AAI7D,KAAK,mBAAmB,GAAG;IACzB,IAAI,EAAE;QAAC,UAAU,EAAE;YAAC,SAAS,EAAE,MAAM,CAAC;YAAC,SAAS,EAAE,MAAM,CAAA;SAAC,CAAA;KAAC,CAAC;IAC3D,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,eAAe,EAAE,MAAM,CAAC;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,OAAO,CAAC;IACtB,UAAU,EAAE,OAAO,CAAC;IACpB,cAAc,EAAE,OAAO,CAAC;CACzB,CAAC;AAEF,MAAM,CAAC,OAAO,OAAO,aAAc,SAAQ,KAAK,CAAC,mBAAmB,CAAC;IACnE,MAAM,CAAC,SAAS,SAAmB;IAEnC,KAAK,EAAG;QACN,KAAK,EAAE,KAAK,CAAC;QACb,SAAS,EAAE,MAAM,CAAC;QAClB,SAAS,EAAE,MAAM,CAAC;KACnB,CAAC;IAEF,UAAU;;;;;IAIV,eAAe,CAAC,EAAC,MAAM,EAAC,EAAE,YAAY,GAAG,IAAI;IAI7C,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,KAAK;IAiBhC,IAAI,CAAC,EAAC,QAAQ,EAAC;;KAAA,GAAG,IAAI;CAYvB"}
1
+ {"version":3,"file":"triangle-layer.d.ts","sourceRoot":"","sources":["../../src/heatmap-layer/triangle-layer.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAC,MAAM,eAAe,CAAC;AAC3D,OAAO,EAAC,KAAK,EAAC,MAAM,iBAAiB,CAAC;AACtC,OAAO,EAAC,KAAK,EAAE,YAAY,EAAY,MAAM,eAAe,CAAC;AAK7D,KAAK,mBAAmB,GAAG;IACzB,IAAI,EAAE;QAAC,UAAU,EAAE;YAAC,SAAS,EAAE,MAAM,CAAC;YAAC,SAAS,EAAE,MAAM,CAAA;SAAC,CAAA;KAAC,CAAC;IAC3D,WAAW,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC9B,eAAe,EAAE,MAAM,CAAC;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,OAAO,CAAC;IACtB,UAAU,EAAE,OAAO,CAAC;IACpB,cAAc,EAAE,OAAO,CAAC;CACzB,CAAC;AAEF,MAAM,CAAC,OAAO,OAAO,aAAc,SAAQ,KAAK,CAAC,mBAAmB,CAAC;IACnE,MAAM,CAAC,SAAS,SAAmB;IAEnC,KAAK,EAAG;QACN,KAAK,EAAE,KAAK,CAAC;QACb,SAAS,EAAE,MAAM,CAAC;QAClB,SAAS,EAAE,MAAM,CAAC;KACnB,CAAC;IAEF,UAAU;IAIV,eAAe,CAAC,EAAC,MAAM,EAAC,EAAE,YAAY,GAAG,IAAI;IAI7C,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,KAAK;IAgBhC,IAAI,IAAI,IAAI;CAuBb"}
@@ -1,58 +1,45 @@
1
- // Copyright (c) 2015 - 2019 Uber Technologies, Inc.
2
- //
3
- // Permission is hereby granted, free of charge, to any person obtaining a copy
4
- // of this software and associated documentation files (the "Software"), to deal
5
- // in the Software without restriction, including without limitation the rights
6
- // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
- // copies of the Software, and to permit persons to whom the Software is
8
- // furnished to do so, subject to the following conditions:
9
- //
10
- // The above copyright notice and this permission notice shall be included in
11
- // all copies or substantial portions of the Software.
12
- //
13
- // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
- // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
- // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
- // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
- // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
- // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
- // THE SOFTWARE.
1
+ // deck.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright (c) vis.gl contributors
20
4
  import { Model } from '@luma.gl/engine';
21
5
  import { Layer, project32 } from '@deck.gl/core';
22
6
  import vs from "./triangle-layer-vertex.glsl.js";
23
7
  import fs from "./triangle-layer-fragment.glsl.js";
8
+ import { triangleUniforms } from "./triangle-layer-uniforms.js";
24
9
  class TriangleLayer extends Layer {
25
10
  getShaders() {
26
- return { vs, fs, modules: [project32] };
11
+ return super.getShaders({ vs, fs, modules: [project32, triangleUniforms] });
27
12
  }
28
13
  initializeState({ device }) {
29
14
  this.setState({ model: this._getModel(device) });
30
15
  }
31
16
  _getModel(device) {
32
- const { vertexCount, data, weightsTexture, maxTexture, colorTexture } = this.props;
17
+ const { vertexCount, data } = this.props;
33
18
  return new Model(device, {
34
19
  ...this.getShaders(),
35
20
  id: this.props.id,
36
- bindings: { weightsTexture, maxTexture, colorTexture },
37
21
  attributes: data.attributes,
38
22
  bufferLayout: [
39
23
  { name: 'positions', format: 'float32x3' },
40
24
  { name: 'texCoords', format: 'float32x2' }
41
25
  ],
42
- topology: 'triangle-fan-webgl',
26
+ topology: 'triangle-strip',
43
27
  vertexCount
44
28
  });
45
29
  }
46
- draw({ uniforms }) {
30
+ draw() {
47
31
  const { model } = this.state;
48
- const { intensity, threshold, aggregationMode, colorDomain } = this.props;
49
- model.setUniforms({
50
- ...uniforms,
32
+ const { aggregationMode, colorDomain, intensity, threshold, colorTexture, maxTexture, weightsTexture } = this.props;
33
+ const triangleProps = {
34
+ aggregationMode,
35
+ colorDomain,
51
36
  intensity,
52
37
  threshold,
53
- aggregationMode,
54
- colorDomain
55
- });
38
+ colorTexture,
39
+ maxTexture,
40
+ weightsTexture
41
+ };
42
+ model.shaderInputs.setProps({ triangle: triangleProps });
56
43
  model.draw(this.context.renderPass);
57
44
  }
58
45
  }
@@ -1 +1 @@
1
- {"version":3,"file":"weights-fs.glsl.d.ts","sourceRoot":"","sources":["../../src/heatmap-layer/weights-fs.glsl.ts"],"names":[],"mappings":";AAAA,wBAoBE"}
1
+ {"version":3,"file":"weights-fs.glsl.d.ts","sourceRoot":"","sources":["../../src/heatmap-layer/weights-fs.glsl.ts"],"names":[],"mappings":";AAIA,wBAoBE"}
@@ -1,3 +1,6 @@
1
+ // deck.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright (c) vis.gl contributors
1
4
  export default `\
2
5
  #version 300 es
3
6
  in vec4 weightsTexture;
@@ -1,3 +1,3 @@
1
- declare const _default: "#version 300 es\nin vec3 positions;\nin vec3 positions64Low;\nin float weights;\nout vec4 weightsTexture;\nuniform float radiusPixels;\nuniform float textureWidth;\nuniform vec4 commonBounds;\nuniform float weightsScale;\n\nvoid main()\n{\n weightsTexture = vec4(weights * weightsScale, 0., 0., 1.);\n\n float radiusTexels = project_pixel_size(radiusPixels) * textureWidth / (commonBounds.z - commonBounds.x);\n gl_PointSize = radiusTexels * 2.;\n\n vec3 commonPosition = project_position(positions, positions64Low);\n\n // // map xy from commonBounds to [-1, 1]\n gl_Position.xy = (commonPosition.xy - commonBounds.xy) / (commonBounds.zw - commonBounds.xy) ;\n gl_Position.xy = (gl_Position.xy * 2.) - (1.);\n gl_Position.w = 1.0;\n}\n";
1
+ declare const _default: "#version 300 es\nin vec3 positions;\nin vec3 positions64Low;\nin float weights;\nout vec4 weightsTexture;\n\nvoid main()\n{\n weightsTexture = vec4(weights * weight.weightsScale, 0., 0., 1.);\n\n float radiusTexels = project_pixel_size(weight.radiusPixels) * weight.textureWidth / (weight.commonBounds.z - weight.commonBounds.x);\n gl_PointSize = radiusTexels * 2.;\n\n vec3 commonPosition = project_position(positions, positions64Low);\n\n // // map xy from commonBounds to [-1, 1]\n gl_Position.xy = (commonPosition.xy - weight.commonBounds.xy) / (weight.commonBounds.zw - weight.commonBounds.xy) ;\n gl_Position.xy = (gl_Position.xy * 2.) - (1.);\n gl_Position.w = 1.0;\n}\n";
2
2
  export default _default;
3
3
  //# sourceMappingURL=weights-vs.glsl.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"weights-vs.glsl.d.ts","sourceRoot":"","sources":["../../src/heatmap-layer/weights-vs.glsl.ts"],"names":[],"mappings":";AAAA,wBAyBE"}
1
+ {"version":3,"file":"weights-vs.glsl.d.ts","sourceRoot":"","sources":["../../src/heatmap-layer/weights-vs.glsl.ts"],"names":[],"mappings":";AAIA,wBAqBE"}
@@ -1,20 +1,19 @@
1
+ // deck.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright (c) vis.gl contributors
1
4
  export default `\
2
5
  #version 300 es
3
6
  in vec3 positions;
4
7
  in vec3 positions64Low;
5
8
  in float weights;
6
9
  out vec4 weightsTexture;
7
- uniform float radiusPixels;
8
- uniform float textureWidth;
9
- uniform vec4 commonBounds;
10
- uniform float weightsScale;
11
10
  void main()
12
11
  {
13
- weightsTexture = vec4(weights * weightsScale, 0., 0., 1.);
14
- float radiusTexels = project_pixel_size(radiusPixels) * textureWidth / (commonBounds.z - commonBounds.x);
12
+ weightsTexture = vec4(weights * weight.weightsScale, 0., 0., 1.);
13
+ float radiusTexels = project_pixel_size(weight.radiusPixels) * weight.textureWidth / (weight.commonBounds.z - weight.commonBounds.x);
15
14
  gl_PointSize = radiusTexels * 2.;
16
15
  vec3 commonPosition = project_position(positions, positions64Low);
17
- gl_Position.xy = (commonPosition.xy - commonBounds.xy) / (commonBounds.zw - commonBounds.xy) ;
16
+ gl_Position.xy = (commonPosition.xy - weight.commonBounds.xy) / (weight.commonBounds.zw - weight.commonBounds.xy) ;
18
17
  gl_Position.xy = (gl_Position.xy * 2.) - (1.);
19
18
  gl_Position.w = 1.0;
20
19
  }
@@ -0,0 +1,14 @@
1
+ import { NumberArray2 } from '@math.gl/core';
2
+ export type BinOptions = {
3
+ hexOriginCommon: NumberArray2;
4
+ radiusCommon: number;
5
+ };
6
+ export declare const binOptionsUniforms: {
7
+ readonly name: "binOptions";
8
+ readonly vs: "uniform binOptionsUniforms {\n vec2 hexOriginCommon;\n float radiusCommon;\n} binOptions;\n";
9
+ readonly uniformTypes: {
10
+ readonly hexOriginCommon: "vec2<f32>";
11
+ readonly radiusCommon: "f32";
12
+ };
13
+ };
14
+ //# sourceMappingURL=bin-options-uniforms.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bin-options-uniforms.d.ts","sourceRoot":"","sources":["../../src/hexagon-layer/bin-options-uniforms.ts"],"names":[],"mappings":"AAKA,OAAO,EAAC,YAAY,EAAC,MAAM,eAAe,CAAC;AAS3C,MAAM,MAAM,UAAU,GAAG;IACvB,eAAe,EAAE,YAAY,CAAC;IAC9B,YAAY,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,eAAO,MAAM,kBAAkB;;;;;;;CAOc,CAAC"}
@@ -0,0 +1,17 @@
1
+ // deck.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright (c) vis.gl contributors
4
+ const uniformBlock = /* glsl */ `\
5
+ uniform binOptionsUniforms {
6
+ vec2 hexOriginCommon;
7
+ float radiusCommon;
8
+ } binOptions;
9
+ `;
10
+ export const binOptionsUniforms = {
11
+ name: 'binOptions',
12
+ vs: uniformBlock,
13
+ uniformTypes: {
14
+ hexOriginCommon: 'vec2<f32>',
15
+ radiusCommon: 'f32'
16
+ }
17
+ };
@@ -0,0 +1,3 @@
1
+ declare const _default: string;
2
+ export default _default;
3
+ //# sourceMappingURL=hexagon-cell-layer-vertex.glsl.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hexagon-cell-layer-vertex.glsl.d.ts","sourceRoot":"","sources":["../../src/hexagon-layer/hexagon-cell-layer-vertex.glsl.ts"],"names":[],"mappings":";AAMA,wBAkEE"}