@deck.gl/aggregation-layers 9.0.40 → 9.1.0-beta.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (372) hide show
  1. package/dist/common/aggregation-layer.d.ts +30 -0
  2. package/dist/common/aggregation-layer.d.ts.map +1 -0
  3. package/dist/common/aggregation-layer.js +70 -0
  4. package/dist/common/aggregation-layer.js.map +1 -0
  5. package/dist/common/aggregator/aggregator.d.ts +76 -0
  6. package/dist/common/aggregator/aggregator.d.ts.map +1 -0
  7. package/dist/common/aggregator/aggregator.js +5 -0
  8. package/dist/common/aggregator/aggregator.js.map +1 -0
  9. package/dist/common/aggregator/cpu-aggregator/aggregate.d.ts +27 -0
  10. package/dist/common/aggregator/cpu-aggregator/aggregate.d.ts.map +1 -0
  11. package/dist/common/aggregator/cpu-aggregator/aggregate.js +67 -0
  12. package/dist/common/aggregator/cpu-aggregator/aggregate.js.map +1 -0
  13. package/dist/common/aggregator/cpu-aggregator/cpu-aggregator.d.ts +70 -0
  14. package/dist/common/aggregator/cpu-aggregator/cpu-aggregator.d.ts.map +1 -0
  15. package/dist/common/aggregator/cpu-aggregator/cpu-aggregator.js +140 -0
  16. package/dist/common/aggregator/cpu-aggregator/cpu-aggregator.js.map +1 -0
  17. package/dist/common/aggregator/cpu-aggregator/sort-bins.d.ts +15 -0
  18. package/dist/common/aggregator/cpu-aggregator/sort-bins.d.ts.map +1 -0
  19. package/dist/common/aggregator/cpu-aggregator/sort-bins.js +44 -0
  20. package/dist/common/aggregator/cpu-aggregator/sort-bins.js.map +1 -0
  21. package/dist/common/aggregator/cpu-aggregator/vertex-accessor.d.ts +21 -0
  22. package/dist/common/aggregator/cpu-aggregator/vertex-accessor.d.ts.map +1 -0
  23. package/dist/common/aggregator/cpu-aggregator/vertex-accessor.js +56 -0
  24. package/dist/common/aggregator/cpu-aggregator/vertex-accessor.js.map +1 -0
  25. package/dist/common/aggregator/gpu-aggregator/aggregation-transform-uniforms.d.ts +18 -0
  26. package/dist/common/aggregator/gpu-aggregator/aggregation-transform-uniforms.d.ts.map +1 -0
  27. package/dist/common/aggregator/gpu-aggregator/aggregation-transform-uniforms.js +21 -0
  28. package/dist/common/aggregator/gpu-aggregator/aggregation-transform-uniforms.js.map +1 -0
  29. package/dist/common/aggregator/gpu-aggregator/bin-sorter-uniforms.d.ts +14 -0
  30. package/dist/common/aggregator/gpu-aggregator/bin-sorter-uniforms.d.ts.map +1 -0
  31. package/dist/common/aggregator/gpu-aggregator/bin-sorter-uniforms.js +18 -0
  32. package/dist/common/aggregator/gpu-aggregator/bin-sorter-uniforms.js.map +1 -0
  33. package/dist/common/aggregator/gpu-aggregator/utils.d.ts +6 -0
  34. package/dist/common/aggregator/gpu-aggregator/utils.d.ts.map +1 -0
  35. package/dist/common/aggregator/gpu-aggregator/utils.js +25 -0
  36. package/dist/common/aggregator/gpu-aggregator/utils.js.map +1 -0
  37. package/dist/common/aggregator/gpu-aggregator/webgl-aggregation-transform.d.ts +24 -0
  38. package/dist/common/aggregator/gpu-aggregator/webgl-aggregation-transform.d.ts.map +1 -0
  39. package/dist/common/aggregator/gpu-aggregator/webgl-aggregation-transform.js +216 -0
  40. package/dist/common/aggregator/gpu-aggregator/webgl-aggregation-transform.js.map +1 -0
  41. package/dist/common/aggregator/gpu-aggregator/webgl-aggregator.d.ts +81 -0
  42. package/dist/common/aggregator/gpu-aggregator/webgl-aggregator.d.ts.map +1 -0
  43. package/dist/common/aggregator/gpu-aggregator/webgl-aggregator.js +202 -0
  44. package/dist/common/aggregator/gpu-aggregator/webgl-aggregator.js.map +1 -0
  45. package/dist/common/aggregator/gpu-aggregator/webgl-bin-sorter.d.ts +38 -0
  46. package/dist/common/aggregator/gpu-aggregator/webgl-bin-sorter.d.ts.map +1 -0
  47. package/dist/common/aggregator/gpu-aggregator/webgl-bin-sorter.js +224 -0
  48. package/dist/common/aggregator/gpu-aggregator/webgl-bin-sorter.js.map +1 -0
  49. package/dist/common/aggregator/index.d.ts +6 -0
  50. package/dist/common/aggregator/index.d.ts.map +1 -0
  51. package/dist/common/aggregator/index.js +6 -0
  52. package/dist/common/aggregator/index.js.map +1 -0
  53. package/dist/common/types.d.ts +11 -0
  54. package/dist/common/types.d.ts.map +1 -0
  55. package/dist/common/types.js +5 -0
  56. package/dist/common/types.js.map +1 -0
  57. package/dist/common/utils/bounds-utils.d.ts +10 -0
  58. package/dist/common/utils/bounds-utils.d.ts.map +1 -0
  59. package/dist/common/utils/bounds-utils.js +21 -0
  60. package/dist/common/utils/bounds-utils.js.map +1 -0
  61. package/dist/common/utils/color-utils.d.ts +10 -0
  62. package/dist/common/utils/color-utils.d.ts.map +1 -0
  63. package/dist/common/utils/color-utils.js +66 -0
  64. package/dist/common/utils/color-utils.js.map +1 -0
  65. package/dist/common/utils/prop-utils.d.ts.map +1 -0
  66. package/dist/common/utils/prop-utils.js +13 -0
  67. package/dist/common/utils/prop-utils.js.map +1 -0
  68. package/dist/common/utils/scale-utils.d.ts +46 -0
  69. package/dist/common/utils/scale-utils.d.ts.map +1 -0
  70. package/dist/common/utils/scale-utils.js +181 -0
  71. package/dist/common/utils/scale-utils.js.map +1 -0
  72. package/dist/contour-layer/bin-options-uniforms.d.ts +13 -0
  73. package/dist/contour-layer/bin-options-uniforms.d.ts.map +1 -0
  74. package/dist/contour-layer/bin-options-uniforms.js +18 -0
  75. package/dist/contour-layer/bin-options-uniforms.js.map +1 -0
  76. package/dist/contour-layer/contour-layer.d.ts +42 -50
  77. package/dist/contour-layer/contour-layer.d.ts.map +1 -1
  78. package/dist/contour-layer/contour-layer.js +233 -192
  79. package/dist/contour-layer/contour-layer.js.map +1 -0
  80. package/dist/contour-layer/contour-utils.d.ts +36 -15
  81. package/dist/contour-layer/contour-utils.d.ts.map +1 -1
  82. package/dist/contour-layer/contour-utils.js +25 -29
  83. package/dist/contour-layer/contour-utils.js.map +1 -0
  84. package/dist/contour-layer/marching-squares-codes.d.ts.map +1 -1
  85. package/dist/contour-layer/marching-squares-codes.js +4 -0
  86. package/dist/contour-layer/marching-squares-codes.js.map +1 -0
  87. package/dist/contour-layer/marching-squares.d.ts +22 -6
  88. package/dist/contour-layer/marching-squares.d.ts.map +1 -1
  89. package/dist/contour-layer/marching-squares.js +72 -68
  90. package/dist/contour-layer/marching-squares.js.map +1 -0
  91. package/dist/contour-layer/value-reader.d.ts +10 -0
  92. package/dist/contour-layer/value-reader.d.ts.map +1 -0
  93. package/dist/contour-layer/value-reader.js +47 -0
  94. package/dist/contour-layer/value-reader.js.map +1 -0
  95. package/dist/dist.dev.js +4844 -4083
  96. package/dist/grid-layer/bin-options-uniforms.d.ts +13 -0
  97. package/dist/grid-layer/bin-options-uniforms.d.ts.map +1 -0
  98. package/dist/grid-layer/bin-options-uniforms.js +18 -0
  99. package/dist/grid-layer/bin-options-uniforms.js.map +1 -0
  100. package/dist/grid-layer/grid-cell-layer-vertex.glsl.d.ts +3 -0
  101. package/dist/grid-layer/grid-cell-layer-vertex.glsl.d.ts.map +1 -0
  102. package/dist/grid-layer/grid-cell-layer-vertex.glsl.js +52 -0
  103. package/dist/grid-layer/grid-cell-layer-vertex.glsl.js.map +1 -0
  104. package/dist/grid-layer/grid-cell-layer.d.ts +32 -0
  105. package/dist/grid-layer/grid-cell-layer.d.ts.map +1 -0
  106. package/dist/grid-layer/grid-cell-layer.js +94 -0
  107. package/dist/grid-layer/grid-cell-layer.js.map +1 -0
  108. package/dist/grid-layer/grid-layer-uniforms.d.ts +21 -0
  109. package/dist/grid-layer/grid-layer-uniforms.d.ts.map +1 -0
  110. package/dist/grid-layer/grid-layer-uniforms.js +24 -0
  111. package/dist/grid-layer/grid-layer-uniforms.js.map +1 -0
  112. package/dist/grid-layer/grid-layer.d.ts +176 -14
  113. package/dist/grid-layer/grid-layer.d.ts.map +1 -1
  114. package/dist/grid-layer/grid-layer.js +343 -46
  115. package/dist/grid-layer/grid-layer.js.map +1 -0
  116. package/dist/{aggregation-layer.d.ts → heatmap-layer/aggregation-layer.d.ts} +1 -0
  117. package/dist/heatmap-layer/aggregation-layer.d.ts.map +1 -0
  118. package/dist/{aggregation-layer.js → heatmap-layer/aggregation-layer.js} +7 -21
  119. package/dist/heatmap-layer/aggregation-layer.js.map +1 -0
  120. package/dist/heatmap-layer/heatmap-layer-uniforms.d.ts +30 -0
  121. package/dist/heatmap-layer/heatmap-layer-uniforms.d.ts.map +1 -0
  122. package/dist/heatmap-layer/heatmap-layer-uniforms.js +33 -0
  123. package/dist/heatmap-layer/heatmap-layer-uniforms.js.map +1 -0
  124. package/dist/heatmap-layer/heatmap-layer-utils.d.ts +1 -1
  125. package/dist/heatmap-layer/heatmap-layer-utils.d.ts.map +1 -1
  126. package/dist/heatmap-layer/heatmap-layer-utils.js +4 -0
  127. package/dist/heatmap-layer/heatmap-layer-utils.js.map +1 -0
  128. package/dist/heatmap-layer/heatmap-layer.d.ts +6 -4
  129. package/dist/heatmap-layer/heatmap-layer.d.ts.map +1 -1
  130. package/dist/heatmap-layer/heatmap-layer.js +44 -33
  131. package/dist/heatmap-layer/heatmap-layer.js.map +1 -0
  132. package/dist/heatmap-layer/max-fs.glsl.d.ts.map +1 -1
  133. package/dist/heatmap-layer/max-fs.glsl.js +4 -0
  134. package/dist/heatmap-layer/max-fs.glsl.js.map +1 -0
  135. package/dist/heatmap-layer/max-vs.glsl.d.ts +1 -1
  136. package/dist/heatmap-layer/max-vs.glsl.d.ts.map +1 -1
  137. package/dist/heatmap-layer/max-vs.glsl.js +7 -4
  138. package/dist/heatmap-layer/max-vs.glsl.js.map +1 -0
  139. package/dist/heatmap-layer/triangle-layer-fragment.glsl.d.ts +1 -1
  140. package/dist/heatmap-layer/triangle-layer-fragment.glsl.d.ts.map +1 -1
  141. package/dist/heatmap-layer/triangle-layer-fragment.glsl.js +6 -23
  142. package/dist/heatmap-layer/triangle-layer-fragment.glsl.js.map +1 -0
  143. package/dist/heatmap-layer/triangle-layer-uniforms.d.ts +22 -0
  144. package/dist/heatmap-layer/triangle-layer-uniforms.d.ts.map +1 -0
  145. package/dist/heatmap-layer/triangle-layer-uniforms.js +23 -0
  146. package/dist/heatmap-layer/triangle-layer-uniforms.js.map +1 -0
  147. package/dist/heatmap-layer/triangle-layer-vertex.glsl.d.ts +1 -1
  148. package/dist/heatmap-layer/triangle-layer-vertex.glsl.d.ts.map +1 -1
  149. package/dist/heatmap-layer/triangle-layer-vertex.glsl.js +11 -30
  150. package/dist/heatmap-layer/triangle-layer-vertex.glsl.js.map +1 -0
  151. package/dist/heatmap-layer/triangle-layer.d.ts +4 -10
  152. package/dist/heatmap-layer/triangle-layer.d.ts.map +1 -1
  153. package/dist/heatmap-layer/triangle-layer.js +18 -30
  154. package/dist/heatmap-layer/triangle-layer.js.map +1 -0
  155. package/dist/heatmap-layer/weights-fs.glsl.d.ts.map +1 -1
  156. package/dist/heatmap-layer/weights-fs.glsl.js +4 -0
  157. package/dist/heatmap-layer/weights-fs.glsl.js.map +1 -0
  158. package/dist/heatmap-layer/weights-vs.glsl.d.ts +1 -1
  159. package/dist/heatmap-layer/weights-vs.glsl.d.ts.map +1 -1
  160. package/dist/heatmap-layer/weights-vs.glsl.js +7 -7
  161. package/dist/heatmap-layer/weights-vs.glsl.js.map +1 -0
  162. package/dist/hexagon-layer/bin-options-uniforms.d.ts +14 -0
  163. package/dist/hexagon-layer/bin-options-uniforms.d.ts.map +1 -0
  164. package/dist/hexagon-layer/bin-options-uniforms.js +18 -0
  165. package/dist/hexagon-layer/bin-options-uniforms.js.map +1 -0
  166. package/dist/hexagon-layer/hexagon-cell-layer-vertex.glsl.d.ts +3 -0
  167. package/dist/hexagon-layer/hexagon-cell-layer-vertex.glsl.d.ts.map +1 -0
  168. package/dist/hexagon-layer/hexagon-cell-layer-vertex.glsl.js +56 -0
  169. package/dist/hexagon-layer/hexagon-cell-layer-vertex.glsl.js.map +1 -0
  170. package/dist/hexagon-layer/hexagon-cell-layer.d.ts +29 -0
  171. package/dist/hexagon-layer/hexagon-cell-layer.d.ts.map +1 -0
  172. package/dist/hexagon-layer/hexagon-cell-layer.js +95 -0
  173. package/dist/hexagon-layer/hexagon-cell-layer.js.map +1 -0
  174. package/dist/hexagon-layer/hexagon-layer-uniforms.d.ts +19 -0
  175. package/dist/hexagon-layer/hexagon-layer-uniforms.d.ts.map +1 -0
  176. package/dist/hexagon-layer/hexagon-layer-uniforms.js +22 -0
  177. package/dist/hexagon-layer/hexagon-layer-uniforms.js.map +1 -0
  178. package/dist/hexagon-layer/hexagon-layer.d.ts +84 -54
  179. package/dist/hexagon-layer/hexagon-layer.d.ts.map +1 -1
  180. package/dist/hexagon-layer/hexagon-layer.js +308 -123
  181. package/dist/hexagon-layer/hexagon-layer.js.map +1 -0
  182. package/dist/hexagon-layer/hexbin.d.ts +17 -0
  183. package/dist/hexagon-layer/hexbin.d.ts.map +1 -0
  184. package/dist/hexagon-layer/hexbin.js +70 -0
  185. package/dist/hexagon-layer/hexbin.js.map +1 -0
  186. package/dist/index.cjs +3026 -2947
  187. package/dist/index.cjs.map +4 -4
  188. package/dist/index.d.ts +7 -13
  189. package/dist/index.d.ts.map +1 -1
  190. package/dist/index.js +6 -27
  191. package/dist/index.js.map +1 -0
  192. package/dist/screen-grid-layer/bin-options-uniforms.d.ts +11 -0
  193. package/dist/screen-grid-layer/bin-options-uniforms.d.ts.map +1 -0
  194. package/dist/screen-grid-layer/bin-options-uniforms.js +16 -0
  195. package/dist/screen-grid-layer/bin-options-uniforms.js.map +1 -0
  196. package/dist/screen-grid-layer/screen-grid-cell-layer.d.ts +11 -16
  197. package/dist/screen-grid-layer/screen-grid-cell-layer.d.ts.map +1 -1
  198. package/dist/screen-grid-layer/screen-grid-cell-layer.js +53 -134
  199. package/dist/screen-grid-layer/screen-grid-cell-layer.js.map +1 -0
  200. package/dist/screen-grid-layer/screen-grid-layer-fragment.glsl.d.ts +1 -1
  201. package/dist/screen-grid-layer/screen-grid-layer-fragment.glsl.d.ts.map +1 -1
  202. package/dist/screen-grid-layer/screen-grid-layer-fragment.glsl.js +5 -24
  203. package/dist/screen-grid-layer/screen-grid-layer-fragment.glsl.js.map +1 -0
  204. package/dist/screen-grid-layer/screen-grid-layer-uniforms.d.ts +17 -0
  205. package/dist/screen-grid-layer/screen-grid-layer-uniforms.d.ts.map +1 -0
  206. package/dist/screen-grid-layer/screen-grid-layer-uniforms.js +20 -0
  207. package/dist/screen-grid-layer/screen-grid-layer-uniforms.js.map +1 -0
  208. package/dist/screen-grid-layer/screen-grid-layer-vertex.glsl.d.ts +1 -1
  209. package/dist/screen-grid-layer/screen-grid-layer-vertex.glsl.d.ts.map +1 -1
  210. package/dist/screen-grid-layer/screen-grid-layer-vertex.glsl.js +22 -62
  211. package/dist/screen-grid-layer/screen-grid-layer-vertex.glsl.js.map +1 -0
  212. package/dist/screen-grid-layer/screen-grid-layer.d.ts +33 -40
  213. package/dist/screen-grid-layer/screen-grid-layer.d.ts.map +1 -1
  214. package/dist/screen-grid-layer/screen-grid-layer.js +158 -174
  215. package/dist/screen-grid-layer/screen-grid-layer.js.map +1 -0
  216. package/dist.min.js +401 -382
  217. package/package.json +10 -9
  218. package/src/common/aggregation-layer.ts +107 -0
  219. package/src/common/aggregator/aggregator.ts +88 -0
  220. package/src/common/aggregator/cpu-aggregator/aggregate.ts +101 -0
  221. package/src/common/aggregator/cpu-aggregator/cpu-aggregator.ts +203 -0
  222. package/src/common/aggregator/cpu-aggregator/sort-bins.ts +63 -0
  223. package/src/common/aggregator/cpu-aggregator/vertex-accessor.ts +86 -0
  224. package/src/common/aggregator/gpu-aggregator/aggregation-transform-uniforms.ts +33 -0
  225. package/src/common/aggregator/gpu-aggregator/bin-sorter-uniforms.ts +27 -0
  226. package/src/common/aggregator/gpu-aggregator/utils.ts +27 -0
  227. package/src/common/aggregator/gpu-aggregator/webgl-aggregation-transform.ts +247 -0
  228. package/src/common/aggregator/gpu-aggregator/webgl-aggregator.ts +274 -0
  229. package/src/common/aggregator/gpu-aggregator/webgl-bin-sorter.ts +258 -0
  230. package/src/common/aggregator/index.ts +10 -0
  231. package/src/{types.ts → common/types.ts} +10 -4
  232. package/src/common/utils/bounds-utils.ts +34 -0
  233. package/src/common/utils/color-utils.ts +86 -0
  234. package/src/common/utils/prop-utils.ts +13 -0
  235. package/src/common/utils/scale-utils.ts +236 -0
  236. package/src/contour-layer/bin-options-uniforms.ts +26 -0
  237. package/src/contour-layer/contour-layer.ts +300 -265
  238. package/src/contour-layer/contour-utils.ts +68 -39
  239. package/src/contour-layer/marching-squares-codes.ts +4 -0
  240. package/src/contour-layer/marching-squares.ts +93 -82
  241. package/src/contour-layer/value-reader.ts +65 -0
  242. package/src/grid-layer/bin-options-uniforms.ts +26 -0
  243. package/src/grid-layer/grid-cell-layer-vertex.glsl.ts +68 -0
  244. package/src/grid-layer/grid-cell-layer.ts +141 -0
  245. package/src/grid-layer/grid-layer-uniforms.ts +37 -0
  246. package/src/grid-layer/grid-layer.ts +614 -73
  247. package/src/{aggregation-layer.ts → heatmap-layer/aggregation-layer.ts} +6 -21
  248. package/src/heatmap-layer/heatmap-layer-uniforms.ts +50 -0
  249. package/src/heatmap-layer/heatmap-layer-utils.ts +9 -1
  250. package/src/heatmap-layer/heatmap-layer.ts +59 -36
  251. package/src/heatmap-layer/max-fs.glsl.ts +4 -0
  252. package/src/heatmap-layer/max-vs.glsl.ts +7 -4
  253. package/src/heatmap-layer/triangle-layer-fragment.glsl.ts +5 -23
  254. package/src/heatmap-layer/triangle-layer-uniforms.ts +37 -0
  255. package/src/heatmap-layer/triangle-layer-vertex.glsl.ts +10 -30
  256. package/src/heatmap-layer/triangle-layer.ts +26 -31
  257. package/src/heatmap-layer/weights-fs.glsl.ts +4 -0
  258. package/src/heatmap-layer/weights-vs.glsl.ts +7 -7
  259. package/src/hexagon-layer/bin-options-uniforms.ts +27 -0
  260. package/src/hexagon-layer/hexagon-cell-layer-vertex.glsl.ts +73 -0
  261. package/src/hexagon-layer/hexagon-cell-layer.ts +141 -0
  262. package/src/hexagon-layer/hexagon-layer-uniforms.ts +34 -0
  263. package/src/hexagon-layer/hexagon-layer.ts +454 -186
  264. package/src/hexagon-layer/hexbin.ts +79 -0
  265. package/src/index.ts +21 -34
  266. package/src/screen-grid-layer/bin-options-uniforms.ts +23 -0
  267. package/src/screen-grid-layer/screen-grid-cell-layer.ts +71 -156
  268. package/src/screen-grid-layer/screen-grid-layer-fragment.glsl.ts +4 -24
  269. package/src/screen-grid-layer/screen-grid-layer-uniforms.ts +31 -0
  270. package/src/screen-grid-layer/screen-grid-layer-vertex.glsl.ts +21 -64
  271. package/src/screen-grid-layer/screen-grid-layer.ts +194 -222
  272. package/dist/aggregation-layer.d.ts.map +0 -1
  273. package/dist/cpu-grid-layer/cpu-grid-layer.d.ts +0 -158
  274. package/dist/cpu-grid-layer/cpu-grid-layer.d.ts.map +0 -1
  275. package/dist/cpu-grid-layer/cpu-grid-layer.js +0 -130
  276. package/dist/cpu-grid-layer/grid-aggregator.d.ts +0 -35
  277. package/dist/cpu-grid-layer/grid-aggregator.d.ts.map +0 -1
  278. package/dist/cpu-grid-layer/grid-aggregator.js +0 -141
  279. package/dist/gpu-grid-layer/gpu-grid-cell-layer-fragment.glsl.d.ts +0 -3
  280. package/dist/gpu-grid-layer/gpu-grid-cell-layer-fragment.glsl.d.ts.map +0 -1
  281. package/dist/gpu-grid-layer/gpu-grid-cell-layer-fragment.glsl.js +0 -30
  282. package/dist/gpu-grid-layer/gpu-grid-cell-layer-vertex.glsl.d.ts +0 -3
  283. package/dist/gpu-grid-layer/gpu-grid-cell-layer-vertex.glsl.d.ts.map +0 -1
  284. package/dist/gpu-grid-layer/gpu-grid-cell-layer-vertex.glsl.js +0 -112
  285. package/dist/gpu-grid-layer/gpu-grid-cell-layer.d.ts +0 -48
  286. package/dist/gpu-grid-layer/gpu-grid-cell-layer.d.ts.map +0 -1
  287. package/dist/gpu-grid-layer/gpu-grid-cell-layer.js +0 -146
  288. package/dist/gpu-grid-layer/gpu-grid-layer.d.ts +0 -99
  289. package/dist/gpu-grid-layer/gpu-grid-layer.d.ts.map +0 -1
  290. package/dist/gpu-grid-layer/gpu-grid-layer.js +0 -289
  291. package/dist/grid-aggregation-layer.d.ts +0 -67
  292. package/dist/grid-aggregation-layer.d.ts.map +0 -1
  293. package/dist/grid-aggregation-layer.js +0 -173
  294. package/dist/hexagon-layer/hexagon-aggregator.d.ts +0 -27
  295. package/dist/hexagon-layer/hexagon-aggregator.d.ts.map +0 -1
  296. package/dist/hexagon-layer/hexagon-aggregator.js +0 -112
  297. package/dist/types.d.ts +0 -12
  298. package/dist/types.d.ts.map +0 -1
  299. package/dist/types.js +0 -1
  300. package/dist/utils/aggregation-operation-utils.d.ts +0 -19
  301. package/dist/utils/aggregation-operation-utils.d.ts.map +0 -1
  302. package/dist/utils/aggregation-operation-utils.js +0 -94
  303. package/dist/utils/bin-sorter.d.ts +0 -52
  304. package/dist/utils/bin-sorter.d.ts.map +0 -1
  305. package/dist/utils/bin-sorter.js +0 -167
  306. package/dist/utils/color-utils.d.ts +0 -3
  307. package/dist/utils/color-utils.d.ts.map +0 -1
  308. package/dist/utils/color-utils.js +0 -53
  309. package/dist/utils/cpu-aggregator.d.ts +0 -169
  310. package/dist/utils/cpu-aggregator.d.ts.map +0 -1
  311. package/dist/utils/cpu-aggregator.js +0 -421
  312. package/dist/utils/gpu-grid-aggregation/aggregate-all-fs.glsl.d.ts +0 -3
  313. package/dist/utils/gpu-grid-aggregation/aggregate-all-fs.glsl.d.ts.map +0 -1
  314. package/dist/utils/gpu-grid-aggregation/aggregate-all-fs.glsl.js +0 -36
  315. package/dist/utils/gpu-grid-aggregation/aggregate-all-vs.glsl.d.ts +0 -3
  316. package/dist/utils/gpu-grid-aggregation/aggregate-all-vs.glsl.d.ts.map +0 -1
  317. package/dist/utils/gpu-grid-aggregation/aggregate-all-vs.glsl.js +0 -42
  318. package/dist/utils/gpu-grid-aggregation/aggregate-to-grid-fs.glsl.d.ts +0 -3
  319. package/dist/utils/gpu-grid-aggregation/aggregate-to-grid-fs.glsl.d.ts.map +0 -1
  320. package/dist/utils/gpu-grid-aggregation/aggregate-to-grid-fs.glsl.js +0 -30
  321. package/dist/utils/gpu-grid-aggregation/aggregate-to-grid-vs.glsl.d.ts +0 -3
  322. package/dist/utils/gpu-grid-aggregation/aggregate-to-grid-vs.glsl.d.ts.map +0 -1
  323. package/dist/utils/gpu-grid-aggregation/aggregate-to-grid-vs.glsl.js +0 -61
  324. package/dist/utils/gpu-grid-aggregation/gpu-grid-aggregator-constants.d.ts +0 -38
  325. package/dist/utils/gpu-grid-aggregation/gpu-grid-aggregator-constants.d.ts.map +0 -1
  326. package/dist/utils/gpu-grid-aggregation/gpu-grid-aggregator-constants.js +0 -41
  327. package/dist/utils/gpu-grid-aggregation/gpu-grid-aggregator-utils.d.ts +0 -1
  328. package/dist/utils/gpu-grid-aggregation/gpu-grid-aggregator-utils.d.ts.map +0 -1
  329. package/dist/utils/gpu-grid-aggregation/gpu-grid-aggregator-utils.js +0 -1
  330. package/dist/utils/gpu-grid-aggregation/gpu-grid-aggregator.d.ts +0 -76
  331. package/dist/utils/gpu-grid-aggregation/gpu-grid-aggregator.d.ts.map +0 -1
  332. package/dist/utils/gpu-grid-aggregation/gpu-grid-aggregator.js +0 -555
  333. package/dist/utils/gpu-grid-aggregation/transform-mean-vs.glsl.d.ts +0 -3
  334. package/dist/utils/gpu-grid-aggregation/transform-mean-vs.glsl.d.ts.map +0 -1
  335. package/dist/utils/gpu-grid-aggregation/transform-mean-vs.glsl.js +0 -32
  336. package/dist/utils/grid-aggregation-utils.d.ts +0 -30
  337. package/dist/utils/grid-aggregation-utils.d.ts.map +0 -1
  338. package/dist/utils/grid-aggregation-utils.js +0 -114
  339. package/dist/utils/prop-utils.d.ts.map +0 -1
  340. package/dist/utils/prop-utils.js +0 -28
  341. package/dist/utils/resource-utils.d.ts +0 -14
  342. package/dist/utils/resource-utils.d.ts.map +0 -1
  343. package/dist/utils/resource-utils.js +0 -38
  344. package/dist/utils/scale-utils.d.ts +0 -15
  345. package/dist/utils/scale-utils.d.ts.map +0 -1
  346. package/dist/utils/scale-utils.js +0 -184
  347. package/src/cpu-grid-layer/cpu-grid-layer.ts +0 -329
  348. package/src/cpu-grid-layer/grid-aggregator.ts +0 -184
  349. package/src/gpu-grid-layer/gpu-grid-cell-layer-fragment.glsl.ts +0 -35
  350. package/src/gpu-grid-layer/gpu-grid-cell-layer-vertex.glsl.ts +0 -143
  351. package/src/gpu-grid-layer/gpu-grid-cell-layer.ts +0 -201
  352. package/src/gpu-grid-layer/gpu-grid-layer.ts +0 -455
  353. package/src/grid-aggregation-layer.ts +0 -243
  354. package/src/hexagon-layer/hexagon-aggregator.ts +0 -127
  355. package/src/utils/aggregation-operation-utils.ts +0 -118
  356. package/src/utils/bin-sorter.ts +0 -218
  357. package/src/utils/color-utils.ts +0 -57
  358. package/src/utils/cpu-aggregator.ts +0 -503
  359. package/src/utils/gpu-grid-aggregation/aggregate-all-fs.glsl.ts +0 -40
  360. package/src/utils/gpu-grid-aggregation/aggregate-all-vs.glsl.ts +0 -54
  361. package/src/utils/gpu-grid-aggregation/aggregate-to-grid-fs.glsl.ts +0 -35
  362. package/src/utils/gpu-grid-aggregation/aggregate-to-grid-vs.glsl.ts +0 -79
  363. package/src/utils/gpu-grid-aggregation/gpu-grid-aggregator-constants.ts +0 -46
  364. package/src/utils/gpu-grid-aggregation/gpu-grid-aggregator-utils.ts +0 -0
  365. package/src/utils/gpu-grid-aggregation/gpu-grid-aggregator.md +0 -155
  366. package/src/utils/gpu-grid-aggregation/gpu-grid-aggregator.ts +0 -690
  367. package/src/utils/gpu-grid-aggregation/transform-mean-vs.glsl.ts +0 -38
  368. package/src/utils/grid-aggregation-utils.ts +0 -147
  369. package/src/utils/prop-utils.ts +0 -29
  370. package/src/utils/resource-utils.ts +0 -53
  371. package/src/utils/scale-utils.js +0 -219
  372. /package/dist/{utils → common/utils}/prop-utils.d.ts +0 -0
@@ -0,0 +1,66 @@
1
+ // deck.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright (c) vis.gl contributors
4
+ export const defaultColorRange = [
5
+ [255, 255, 178],
6
+ [254, 217, 118],
7
+ [254, 178, 76],
8
+ [253, 141, 60],
9
+ [240, 59, 32],
10
+ [189, 0, 38]
11
+ ];
12
+ // Converts a colorRange array to a flat array with 4 components per color
13
+ export function colorRangeToFlatArray(colorRange, normalize = false, ArrayType = Float32Array) {
14
+ let flatArray;
15
+ if (Number.isFinite(colorRange[0])) {
16
+ // its already a flat array.
17
+ flatArray = new ArrayType(colorRange);
18
+ }
19
+ else {
20
+ // flatten it
21
+ flatArray = new ArrayType(colorRange.length * 4);
22
+ let index = 0;
23
+ for (let i = 0; i < colorRange.length; i++) {
24
+ const color = colorRange[i];
25
+ flatArray[index++] = color[0];
26
+ flatArray[index++] = color[1];
27
+ flatArray[index++] = color[2];
28
+ flatArray[index++] = Number.isFinite(color[3]) ? color[3] : 255;
29
+ }
30
+ }
31
+ if (normalize) {
32
+ for (let i = 0; i < flatArray.length; i++) {
33
+ flatArray[i] /= 255;
34
+ }
35
+ }
36
+ return flatArray;
37
+ }
38
+ export const COLOR_RANGE_FILTER = {
39
+ linear: 'linear',
40
+ quantile: 'nearest',
41
+ quantize: 'nearest',
42
+ ordinal: 'nearest'
43
+ };
44
+ export function updateColorRangeTexture(texture, type) {
45
+ texture.setSampler({
46
+ minFilter: COLOR_RANGE_FILTER[type],
47
+ magFilter: COLOR_RANGE_FILTER[type]
48
+ });
49
+ }
50
+ export function createColorRangeTexture(device, colorRange, type = 'linear') {
51
+ const colors = colorRangeToFlatArray(colorRange, false, Uint8Array);
52
+ return device.createTexture({
53
+ format: 'rgba8unorm',
54
+ mipmaps: false,
55
+ sampler: {
56
+ minFilter: COLOR_RANGE_FILTER[type],
57
+ magFilter: COLOR_RANGE_FILTER[type],
58
+ addressModeU: 'clamp-to-edge',
59
+ addressModeV: 'clamp-to-edge'
60
+ },
61
+ data: colors,
62
+ width: colors.length / 4,
63
+ height: 1
64
+ });
65
+ }
66
+ //# sourceMappingUR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ACD,IAAI,EAAE,MAAM;QACZ,KAAK,EAAE,MAAM,CAAC,MAAM,GAAG,CAAC;QACxB,MAAM,EAAE,CAAC;KACV,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prop-utils.d.ts","sourceRoot":"","sources":["../../../src/common/utils/prop-utils.ts"],"names":[],"mappings":"AAIA,wBAAgB,WAAW,CAAC,KAAK,KAAA,EAAE,UAAU,KAAA,MAQ5C"}
@@ -0,0 +1,13 @@
1
+ // deck.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright (c) vis.gl contributors
4
+ export function filterProps(props, filterKeys) {
5
+ const filteredProps = {};
6
+ for (const key in props) {
7
+ if (!filterKeys.includes(key)) {
8
+ filteredProps[key] = props[key];
9
+ }
10
+ }
11
+ return filteredProps;
12
+ }
13
+ //# sourceMappingURL=prop-utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prop-utils.js","sourceRoot":"","sources":["../../../src/common/utils/prop-utils.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,oCAAoC;AAEpC,MAAM,UAAU,WAAW,CAAC,KAAK,EAAE,UAAU;IAC3C,MAAM,aAAa,GAAG,EAAE,CAAC;IACzB,KAAK,MAAM,GAAG,IAAI,KAAK,EAAE,CAAC;QACxB,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;YAC9B,aAAa,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC;QAClC,CAAC;IACH,CAAC;IACD,OAAO,aAAa,CAAC;AACvB,CAAC"}
@@ -0,0 +1,46 @@
1
+ import type { BinaryAttribute } from '@deck.gl/core';
2
+ import type { ScaleType } from "../types.js";
3
+ type ScaleProps = {
4
+ scaleType: ScaleType;
5
+ /** Trim the lower end of the domain by this percentile. Set to `0` to disable. */
6
+ lowerPercentile: number;
7
+ /** Trim the upper end of the domain by this percentile. Set to `100` to disable. */
8
+ upperPercentile: number;
9
+ };
10
+ /** Applies a scale to BinaryAttribute */
11
+ export declare class AttributeWithScale {
12
+ /** Input values accessor. Has either a `value` (CPU aggregation) or a `buffer` (GPU aggregation) */
13
+ private readonly input;
14
+ private readonly inputLength;
15
+ private props;
16
+ private _percentile?;
17
+ private _ordinal?;
18
+ /** Output values accessor */
19
+ attribute: BinaryAttribute;
20
+ /** [min, max] of attribute values, or null if unknown */
21
+ domain: [number, number] | null;
22
+ /** Valid domain if lower/upper percentile are defined */
23
+ cutoff: [number, number] | null;
24
+ constructor(input: BinaryAttribute, inputLength: number);
25
+ private getScalePercentile;
26
+ private getScaleOrdinal;
27
+ /** Returns the [lowerCutoff, upperCutoff] of scaled values, or null if not applicable */
28
+ private getCutoff;
29
+ update(props: ScaleProps): this;
30
+ }
31
+ /**
32
+ * Transform an array of values to ordinal indices
33
+ */
34
+ export declare function applyScaleOrdinal(values: Float32Array): {
35
+ attribute: BinaryAttribute;
36
+ domain: number[];
37
+ };
38
+ /**
39
+ * Transform an array of values to percentiles
40
+ */
41
+ export declare function applyScaleQuantile(values: Float32Array, rangeLength?: number): {
42
+ attribute: BinaryAttribute;
43
+ domain: number[];
44
+ };
45
+ export {};
46
+ //# sourceMappingURL=scale-utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scale-utils.d.ts","sourceRoot":"","sources":["../../../src/common/utils/scale-utils.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,eAAe,EAAC,MAAM,eAAe,CAAC;AACnD,OAAO,KAAK,EAAC,SAAS,EAAC,oBAAiB;AAExC,KAAK,UAAU,GAAG;IAChB,SAAS,EAAE,SAAS,CAAC;IACrB,kFAAkF;IAClF,eAAe,EAAE,MAAM,CAAC;IACxB,oFAAoF;IACpF,eAAe,EAAE,MAAM,CAAC;CACzB,CAAC;AAEF,yCAAyC;AACzC,qBAAa,kBAAkB;IAC7B,oGAAoG;IACpG,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAkB;IACxC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAS;IAErC,OAAO,CAAC,KAAK,CAIX;IAGF,OAAO,CAAC,WAAW,CAAC,CAAiD;IACrE,OAAO,CAAC,QAAQ,CAAC,CAAiD;IAElE,6BAA6B;IAC7B,SAAS,EAAE,eAAe,CAAC;IAC3B,yDAAyD;IACzD,MAAM,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,CAAQ;IACvC,yDAAyD;IACzD,MAAM,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,CAAQ;gBAE3B,KAAK,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM;IAOvD,OAAO,CAAC,kBAAkB;IAQ1B,OAAO,CAAC,eAAe;IAQvB,yFAAyF;IACzF,OAAO,CAAC,SAAS;IA4BjB,MAAM,CAAC,KAAK,EAAE,UAAU;CAiCzB;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,YAAY,GAAG;IACvD,SAAS,EAAE,eAAe,CAAC;IAC3B,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB,CAqBA;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,YAAY,EACpB,WAAW,SAAM,GAChB;IACD,SAAS,EAAE,eAAe,CAAC;IAC3B,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB,CAgBA"}
@@ -0,0 +1,181 @@
1
+ // deck.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright (c) vis.gl contributors
4
+ /** Applies a scale to BinaryAttribute */
5
+ export class AttributeWithScale {
6
+ constructor(input, inputLength) {
7
+ this.props = {
8
+ scaleType: 'linear',
9
+ lowerPercentile: 0,
10
+ upperPercentile: 100
11
+ };
12
+ /** [min, max] of attribute values, or null if unknown */
13
+ this.domain = null;
14
+ /** Valid domain if lower/upper percentile are defined */
15
+ this.cutoff = null;
16
+ this.input = input;
17
+ this.inputLength = inputLength;
18
+ // No processing is needed with the default scale
19
+ this.attribute = input;
20
+ }
21
+ getScalePercentile() {
22
+ if (!this._percentile) {
23
+ const value = getAttributeValue(this.input, this.inputLength);
24
+ this._percentile = applyScaleQuantile(value);
25
+ }
26
+ return this._percentile;
27
+ }
28
+ getScaleOrdinal() {
29
+ if (!this._ordinal) {
30
+ const value = getAttributeValue(this.input, this.inputLength);
31
+ this._ordinal = applyScaleOrdinal(value);
32
+ }
33
+ return this._ordinal;
34
+ }
35
+ /** Returns the [lowerCutoff, upperCutoff] of scaled values, or null if not applicable */
36
+ getCutoff({ scaleType, lowerPercentile, upperPercentile }) {
37
+ if (scaleType === 'quantile') {
38
+ return [lowerPercentile, upperPercentile - 1];
39
+ }
40
+ if (lowerPercentile > 0 || upperPercentile < 100) {
41
+ const { domain: thresholds } = this.getScalePercentile();
42
+ let lowValue = thresholds[Math.floor(lowerPercentile) - 1] ?? -Infinity;
43
+ let highValue = thresholds[Math.floor(upperPercentile) - 1] ?? Infinity;
44
+ if (scaleType === 'ordinal') {
45
+ const { domain: sortedUniqueValues } = this.getScaleOrdinal();
46
+ lowValue = sortedUniqueValues.findIndex(x => x >= lowValue);
47
+ highValue = sortedUniqueValues.findIndex(x => x > highValue) - 1;
48
+ if (highValue === -2) {
49
+ highValue = sortedUniqueValues.length - 1;
50
+ }
51
+ }
52
+ return [lowValue, highValue];
53
+ }
54
+ return null;
55
+ }
56
+ update(props) {
57
+ const oldProps = this.props;
58
+ if (props.scaleType !== oldProps.scaleType) {
59
+ switch (props.scaleType) {
60
+ case 'quantile': {
61
+ const { attribute } = this.getScalePercentile();
62
+ this.attribute = attribute;
63
+ this.domain = [0, 99];
64
+ break;
65
+ }
66
+ case 'ordinal': {
67
+ const { attribute, domain } = this.getScaleOrdinal();
68
+ this.attribute = attribute;
69
+ this.domain = [0, domain.length - 1];
70
+ break;
71
+ }
72
+ default:
73
+ this.attribute = this.input;
74
+ this.domain = null;
75
+ }
76
+ }
77
+ if (props.scaleType !== oldProps.scaleType ||
78
+ props.lowerPercentile !== oldProps.lowerPercentile ||
79
+ props.upperPercentile !== oldProps.upperPercentile) {
80
+ this.cutoff = this.getCutoff(props);
81
+ }
82
+ this.props = props;
83
+ return this;
84
+ }
85
+ }
86
+ /**
87
+ * Transform an array of values to ordinal indices
88
+ */
89
+ export function applyScaleOrdinal(values) {
90
+ const uniqueValues = new Set();
91
+ for (const x of values) {
92
+ if (Number.isFinite(x)) {
93
+ uniqueValues.add(x);
94
+ }
95
+ }
96
+ const sortedUniqueValues = Array.from(uniqueValues).sort();
97
+ const domainMap = new Map();
98
+ for (let i = 0; i < sortedUniqueValues.length; i++) {
99
+ domainMap.set(sortedUniqueValues[i], i);
100
+ }
101
+ return {
102
+ attribute: {
103
+ value: values.map(x => (Number.isFinite(x) ? domainMap.get(x) : NaN)),
104
+ type: 'float32',
105
+ size: 1
106
+ },
107
+ domain: sortedUniqueValues
108
+ };
109
+ }
110
+ /**
111
+ * Transform an array of values to percentiles
112
+ */
113
+ export function applyScaleQuantile(values, rangeLength = 100) {
114
+ const sortedValues = Array.from(values).filter(Number.isFinite).sort(ascending);
115
+ let i = 0;
116
+ const n = Math.max(1, rangeLength);
117
+ const thresholds = new Array(n - 1);
118
+ while (++i < n) {
119
+ thresholds[i - 1] = threshold(sortedValues, i / n);
120
+ }
121
+ return {
122
+ attribute: {
123
+ value: values.map(x => (Number.isFinite(x) ? bisectRight(thresholds, x) : NaN)),
124
+ type: 'float32',
125
+ size: 1
126
+ },
127
+ domain: thresholds
128
+ };
129
+ }
130
+ function getAttributeValue(attribute, length) {
131
+ const elementStride = (attribute.stride ?? 4) / 4;
132
+ const elementOffset = (attribute.offset ?? 0) / 4;
133
+ let value = attribute.value;
134
+ if (!value) {
135
+ const bytes = attribute.buffer?.readSyncWebGL(0, elementStride * 4 * length);
136
+ if (bytes) {
137
+ value = new Float32Array(bytes.buffer);
138
+ attribute.value = value;
139
+ }
140
+ }
141
+ if (elementStride === 1) {
142
+ return value.subarray(0, length);
143
+ }
144
+ const result = new Float32Array(length);
145
+ for (let i = 0; i < length; i++) {
146
+ result[i] = value[i * elementStride + elementOffset];
147
+ }
148
+ return result;
149
+ }
150
+ function ascending(a, b) {
151
+ return a - b;
152
+ }
153
+ function threshold(domain, fraction) {
154
+ const domainLength = domain.length;
155
+ if (fraction <= 0 || domainLength < 2) {
156
+ return domain[0];
157
+ }
158
+ if (fraction >= 1) {
159
+ return domain[domainLength - 1];
160
+ }
161
+ const domainFraction = (domainLength - 1) * fraction;
162
+ const lowIndex = Math.floor(domainFraction);
163
+ const low = domain[lowIndex];
164
+ const high = domain[lowIndex + 1];
165
+ return low + (high - low) * (domainFraction - lowIndex);
166
+ }
167
+ function bisectRight(a, x) {
168
+ let lo = 0;
169
+ let hi = a.length;
170
+ while (lo < hi) {
171
+ const mid = (lo + hi) >>> 1;
172
+ if (a[mid] > x) {
173
+ hi = mid;
174
+ }
175
+ else {
176
+ lo = mid + 1;
177
+ }
178
+ }
179
+ return lo;
180
+ }
181
+ //# sourceMappingURL=scale-utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scale-utils.js","sourceRoot":"","sources":["../../../src/common/utils/scale-utils.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,oCAAoC;AAapC,yCAAyC;AACzC,MAAM,OAAO,kBAAkB;IAsB7B,YAAY,KAAsB,EAAE,WAAmB;QAjB/C,UAAK,GAAe;YAC1B,SAAS,EAAE,QAAQ;YACnB,eAAe,EAAE,CAAC;YAClB,eAAe,EAAE,GAAG;SACrB,CAAC;QAQF,yDAAyD;QACzD,WAAM,GAA4B,IAAI,CAAC;QACvC,yDAAyD;QACzD,WAAM,GAA4B,IAAI,CAAC;QAGrC,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAC/B,iDAAiD;QACjD,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC;IACzB,CAAC;IAEO,kBAAkB;QACxB,IAAI,CAAC,IAAI,CAA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AC,CAAC;IAC5C,MAAM,GAAG,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC;IAC7B,MAAM,IAAI,GAAG,MAAM,CAAC,QAAQ,GAAG,CAAC,CAAC,CAAC;IAClC,OAAO,GAAG,GAAG,CAAC,IAAI,GAAG,GAAG,CAAC,GAAG,CAAC,cAAc,GAAG,QAAQ,CAAC,CAAC;AAC1D,CAAC;AAED,SAAS,WAAW,CAAC,CAAW,EAAE,CAAS;IACzC,IAAI,EAAE,GAAG,CAAC,CAAC;IACX,IAAI,EAAE,GAAG,CAAC,CAAC,MAAM,CAAC;IAClB,OAAO,EAAE,GAAG,EAAE,EAAE,CAAC;QACf,MAAM,GAAG,GAAG,CAAC,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,CAAC;QAC5B,IAAI,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC;YACf,EAAE,GAAG,GAAG,CAAC;QACX,CAAC;aAAM,CAAC;YACN,EAAE,GAAG,GAAG,GAAG,CAAC,CAAC;QACf,CAAC;IACH,CAAC;IACD,OAAO,EAAE,CAAC;AACZ,CAAC"}
@@ -0,0 +1,13 @@
1
+ export type BinOptions = {
2
+ cellOriginCommon: [number, number];
3
+ cellSizeCommon: [number, number];
4
+ };
5
+ export declare const binOptionsUniforms: {
6
+ readonly name: "binOptions";
7
+ readonly vs: "uniform binOptionsUniforms {\n vec2 cellOriginCommon;\n vec2 cellSizeCommon;\n} binOptions;\n";
8
+ readonly uniformTypes: {
9
+ readonly cellOriginCommon: "vec2<f32>";
10
+ readonly cellSizeCommon: "vec2<f32>";
11
+ };
12
+ };
13
+ //# sourceMappingURL=bin-options-uniforms.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bin-options-uniforms.d.ts","sourceRoot":"","sources":["../../src/contour-layer/bin-options-uniforms.ts"],"names":[],"mappings":"AAaA,MAAM,MAAM,UAAU,GAAG;IACvB,gBAAgB,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACnC,cAAc,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAClC,CAAC;AAEF,eAAO,MAAM,kBAAkB;;;;;;;CAOc,CAAC"}
@@ -0,0 +1,18 @@
1
+ // deck.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright (c) vis.gl contributors
4
+ const uniformBlock = /* glsl */ `\
5
+ uniform binOptionsUniforms {
6
+ vec2 cellOriginCommon;
7
+ vec2 cellSizeCommon;
8
+ } binOptions;
9
+ `;
10
+ export const binOptionsUniforms = {
11
+ name: 'binOptions',
12
+ vs: uniformBlock,
13
+ uniformTypes: {
14
+ cellOriginCommon: 'vec2<f32>',
15
+ cellSizeCommon: 'vec2<f32>'
16
+ }
17
+ };
18
+ //# sourceMappingURL=bin-options-uniforms.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bin-options-uniforms.js","sourceRoot":"","sources":["../../src/contour-layer/bin-options-uniforms.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,oCAAoC;AAIpC,MAAM,YAAY,GAAG,UAAU,CAAC;;;;;CAK/B,CAAC;AAOF,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,IAAI,EAAE,YAAY;IAClB,EAAE,EAAE,YAAY;IAChB,YAAY,EAAE;QACZ,gBAAgB,EAAE,WAAW;QAC7B,cAAc,EAAE,WAAW;KAC5B;CAC0C,CAAC"}
@@ -1,48 +1,38 @@
1
- import { Accessor, AccessorFunction, Color, Position, UpdateParameters, DefaultProps, LayersList } from '@deck.gl/core';
2
- import GridAggregationLayer, { GridAggregationLayerProps } from "../grid-aggregation-layer.js";
3
- /** All properties supported by ContourLayer. */
4
- export type ContourLayerProps<DataT = unknown> = _ContourLayerProps<DataT> & GridAggregationLayerProps<DataT>;
5
- /** Properties added by ContourLayer. */
6
- export type _ContourLayerProps<DataT> = {
1
+ import { Accessor, GetPickingInfoParams, LayersList, PickingInfo, Position, Viewport, UpdateParameters, DefaultProps } from '@deck.gl/core';
2
+ import { WebGLAggregator, CPUAggregator, AggregationOperation } from "../common/aggregator/index.js";
3
+ import AggregationLayer from "../common/aggregation-layer.js";
4
+ import { AggregationLayerProps } from "../common/aggregation-layer.js";
5
+ import { Contour, ContourLine, ContourPolygon } from "./contour-utils.js";
6
+ import { BinOptions } from "./bin-options-uniforms.js";
7
+ /** All properties supported by GridLayer. */
8
+ export type ContourLayerProps<DataT = unknown> = _ContourLayerProps<DataT> & AggregationLayerProps<DataT>;
9
+ /** Properties added by GridLayer. */
10
+ type _ContourLayerProps<DataT> = {
7
11
  /**
8
12
  * Size of each cell in meters.
9
13
  * @default 1000
10
14
  */
11
15
  cellSize?: number;
16
+ /**
17
+ * The grid origin
18
+ * @default [0, 0]
19
+ */
20
+ gridOrigin?: [number, number];
12
21
  /**
13
22
  * When set to true, aggregation is performed on GPU, provided other conditions are met.
14
- * @default true
23
+ * @default false
15
24
  */
16
25
  gpuAggregation?: boolean;
17
26
  /**
18
27
  * Defines the type of aggregation operation, valid values are 'SUM', 'MEAN', 'MIN' and 'MAX'.
19
28
  * @default 'SUM'
20
29
  */
21
- aggregation?: 'SUM' | 'MEAN' | 'MIN' | 'MAX';
30
+ aggregation?: AggregationOperation;
22
31
  /**
23
32
  * Definition of contours to be drawn.
24
33
  * @default [{threshold: 1}]
25
34
  */
26
- contours: {
27
- /**
28
- * Isolines: `threshold` value must be a single `Number`, Isolines are generated based on this threshold value.
29
- *
30
- * Isobands: `threshold` value must be an Array of two `Number`s. Isobands are generated using `[threshold[0], threshold[1])` as threshold range, i.e area that has values `>= threshold[0]` and `< threshold[1]` are rendered with corresponding color. NOTE: `threshold[0]` is inclusive and `threshold[1]` is not inclusive.
31
- */
32
- threshold: number | number[];
33
- /**
34
- * RGBA color array to be used to render the contour.
35
- * @default [255, 255, 255, 255]
36
- */
37
- color?: Color;
38
- /**
39
- * Applicable for `Isoline`s only, width of the Isoline in pixels.
40
- * @default 1
41
- */
42
- strokeWidth?: number;
43
- /** Defines z order of the contour. */
44
- zIndex?: number;
45
- }[];
35
+ contours?: Contour[];
46
36
  /**
47
37
  * A very small z offset that is added for each vertex of a contour (Isoline or Isoband).
48
38
  * @default 0.005
@@ -52,38 +42,40 @@ export type _ContourLayerProps<DataT> = {
52
42
  * Method called to retrieve the position of each object.
53
43
  * @default object => object.position
54
44
  */
55
- getPosition?: AccessorFunction<DataT, Position>;
45
+ getPosition?: Accessor<DataT, Position>;
56
46
  /**
57
47
  * The weight of each object.
58
48
  * @default 1
59
49
  */
60
50
  getWeight?: Accessor<DataT, number>;
61
51
  };
62
- /** Aggregate data into iso-lines or iso-bands for a given threshold and cell size. */
63
- export default class ContourLayer<DataT = any, ExtraPropsT extends {} = {}> extends GridAggregationLayer<DataT, ExtraPropsT & Required<_ContourLayerProps<DataT>>> {
52
+ export type ContourLayerPickingInfo = PickingInfo<{
53
+ contour: Contour;
54
+ }>;
55
+ /** Aggregate data into a grid-based heatmap. The color and height of a cell are determined based on the objects it contains. */
56
+ export default class GridLayer<DataT = any, ExtraPropsT extends {} = {}> extends AggregationLayer<DataT, ExtraPropsT & Required<_ContourLayerProps<DataT>>> {
64
57
  static layerName: string;
65
58
  static defaultProps: DefaultProps<ContourLayerProps<unknown>>;
66
- state: GridAggregationLayer<DataT>['state'] & {
67
- contourData: {
68
- contourSegments: {
69
- start: number[];
70
- end: number[];
71
- contour: any;
72
- }[];
73
- contourPolygons: {
74
- vertices: number[][];
75
- contour: any;
76
- }[];
59
+ state: AggregationLayer<DataT>['state'] & BinOptions & {
60
+ aggregatedValueReader?: (x: number, y: number) => number;
61
+ contourData?: {
62
+ lines: ContourLine[];
63
+ polygons: ContourPolygon[];
77
64
  };
78
- thresholdData: any;
65
+ binIdRange: [number, number][];
66
+ aggregatorViewport: Viewport;
79
67
  };
68
+ getAggregatorType(): string;
69
+ createAggregator(type: string): WebGLAggregator | CPUAggregator;
80
70
  initializeState(): void;
81
- updateState(opts: UpdateParameters<this>): void;
82
- renderLayers(): LayersList;
83
- updateAggregationState(opts: UpdateParameters<this>): void;
84
- private _updateAccessors;
85
- private _resetResults;
86
- private _generateContours;
87
- private _updateThresholdData;
71
+ updateState(params: UpdateParameters<this>): boolean;
72
+ private _updateBinOptions;
73
+ draw(opts: any): void;
74
+ private _onAggregationUpdate;
75
+ private _getContours;
76
+ onAttributeChange(id: string): void;
77
+ renderLayers(): LayersList | null;
78
+ getPickingInfo(params: GetPickingInfoParams): ContourLayerPickingInfo;
88
79
  }
80
+ export {};
89
81
  //# sourceMappingURL=contour-layer.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"contour-layer.d.ts","sourceRoot":"","sources":["../../src/contour-layer/contour-layer.ts"],"names":[],"mappings":"AAsBA,OAAO,EACL,QAAQ,EACR,gBAAgB,EAChB,KAAK,EAEL,QAAQ,EACR,gBAAgB,EAChB,YAAY,EACZ,UAAU,EACX,MAAM,eAAe,CAAC;AAKvB,OAAO,oBAAoB,EAAE,EAAC,yBAAyB,EAAC,qCAAkC;AAqC1F,gDAAgD;AAChD,MAAM,MAAM,iBAAiB,CAAC,KAAK,GAAG,OAAO,IAAI,kBAAkB,CAAC,KAAK,CAAC,GACxE,yBAAyB,CAAC,KAAK,CAAC,CAAC;AAEnC,wCAAwC;AACxC,MAAM,MAAM,kBAAkB,CAAC,KAAK,IAAI;IACtC;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;;OAGG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IAEzB;;;OAGG;IACH,WAAW,CAAC,EAAE,KAAK,GAAG,MAAM,GAAG,KAAK,GAAG,KAAK,CAAC;IAE7C;;;OAGG;IACH,QAAQ,EAAE;QACR;;;;WAIG;QACH,SAAS,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;QAE7B;;;WAGG;QACH,KAAK,CAAC,EAAE,KAAK,CAAC;QAEd;;;WAGG;QACH,WAAW,CAAC,EAAE,MAAM,CAAC;QAErB,sCAAsC;QACtC,MAAM,CAAC,EAAE,MAA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