@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
@@ -1,130 +0,0 @@
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.
20
- import { GridCellLayer } from '@deck.gl/layers';
21
- import { defaultColorRange } from "../utils/color-utils.js";
22
- import { pointToDensityGridDataCPU } from "./grid-aggregator.js";
23
- import CPUAggregator from "../utils/cpu-aggregator.js";
24
- import AggregationLayer from "../aggregation-layer.js";
25
- // eslint-disable-next-line @typescript-eslint/no-empty-function
26
- function nop() { }
27
- const defaultProps = {
28
- // color
29
- colorDomain: null,
30
- colorRange: defaultColorRange,
31
- getColorValue: { type: 'accessor', value: null }, // default value is calculated from `getColorWeight` and `colorAggregation`
32
- getColorWeight: { type: 'accessor', value: 1 },
33
- colorAggregation: 'SUM',
34
- lowerPercentile: { type: 'number', min: 0, max: 100, value: 0 },
35
- upperPercentile: { type: 'number', min: 0, max: 100, value: 100 },
36
- colorScaleType: 'quantize',
37
- onSetColorDomain: nop,
38
- // elevation
39
- elevationDomain: null,
40
- elevationRange: [0, 1000],
41
- getElevationValue: { type: 'accessor', value: null }, // default value is calculated from `getElevationWeight` and `elevationAggregation`
42
- getElevationWeight: { type: 'accessor', value: 1 },
43
- elevationAggregation: 'SUM',
44
- elevationLowerPercentile: { type: 'number', min: 0, max: 100, value: 0 },
45
- elevationUpperPercentile: { type: 'number', min: 0, max: 100, value: 100 },
46
- elevationScale: { type: 'number', min: 0, value: 1 },
47
- elevationScaleType: 'linear',
48
- onSetElevationDomain: nop,
49
- gridAggregator: pointToDensityGridDataCPU,
50
- // grid
51
- cellSize: { type: 'number', min: 0, max: 1000, value: 1000 },
52
- coverage: { type: 'number', min: 0, max: 1, value: 1 },
53
- getPosition: { type: 'accessor', value: (x) => x.position },
54
- extruded: false,
55
- // Optional material for 'lighting' shader module
56
- material: true,
57
- // data filter
58
- _filterData: { type: 'function', value: null, optional: true }
59
- };
60
- /** Aggregate data into a grid-based heatmap. Aggregation is performed on CPU. */
61
- class CPUGridLayer extends AggregationLayer {
62
- initializeState() {
63
- const cpuAggregator = new CPUAggregator({
64
- getAggregator: props => props.gridAggregator,
65
- getCellSize: props => props.cellSize
66
- });
67
- this.state = {
68
- cpuAggregator,
69
- aggregatorState: cpuAggregator.state
70
- };
71
- const attributeManager = this.getAttributeManager();
72
- attributeManager.add({
73
- positions: { size: 3, type: 'float64', accessor: 'getPosition' }
74
- });
75
- // color and elevation attributes can't be added as attributes
76
- // they are calcualted using 'getValue' accessor that takes an array of pints.
77
- }
78
- updateState(opts) {
79
- super.updateState(opts);
80
- this.setState({
81
- // make a copy of the internal state of cpuAggregator for testing
82
- aggregatorState: this.state.cpuAggregator.updateState(opts, {
83
- viewport: this.context.viewport,
84
- attributes: this.getAttributes(),
85
- numInstances: this.getNumInstances()
86
- })
87
- });
88
- }
89
- getPickingInfo({ info }) {
90
- return this.state.cpuAggregator.getPickingInfo({ info });
91
- }
92
- // create a method for testing
93
- _onGetSublayerColor(cell) {
94
- return this.state.cpuAggregator.getAccessor('fillColor')(cell);
95
- }
96
- // create a method for testing
97
- _onGetSublayerElevation(cell) {
98
- return this.state.cpuAggregator.getAccessor('elevation')(cell);
99
- }
100
- _getSublayerUpdateTriggers() {
101
- return this.state.cpuAggregator.getUpdateTriggers(this.props);
102
- }
103
- renderLayers() {
104
- const { elevationScale, extruded, cellSize, coverage, material, transitions } = this.props;
105
- const { cpuAggregator } = this.state;
106
- const SubLayerClass = this.getSubLayerClass('grid-cell', GridCellLayer);
107
- const updateTriggers = this._getSublayerUpdateTriggers();
108
- return new SubLayerClass({
109
- cellSize,
110
- coverage,
111
- material,
112
- elevationScale,
113
- extruded,
114
- getFillColor: this._onGetSublayerColor.bind(this),
115
- getElevation: this._onGetSublayerElevation.bind(this),
116
- transitions: transitions && {
117
- getFillColor: transitions.getColorValue || transitions.getColorWeight,
118
- getElevation: transitions.getElevationValue || transitions.getElevationWeight
119
- }
120
- }, this.getSubLayerProps({
121
- id: 'grid-cell',
122
- updateTriggers
123
- }), {
124
- data: cpuAggregator.state.layerData.data
125
- });
126
- }
127
- }
128
- CPUGridLayer.layerName = 'CPUGridLayer';
129
- CPUGridLayer.defaultProps = defaultProps;
130
- export default CPUGridLayer;
@@ -1,35 +0,0 @@
1
- export type GridHash = {
2
- [key: string]: {
3
- count: number;
4
- points: unknown[];
5
- lonIdx: number;
6
- latIdx: number;
7
- };
8
- };
9
- /**
10
- * Calculate density grid from an array of points
11
- * @param {Object} props - object containing :
12
- * @param {Iterable} [props.data] - data objects to be aggregated
13
- * @param {Integer} [props.cellSize] - size of the grid cell
14
- *
15
- * @param {Object} aggregationParams - object containing :
16
- * @param {Object} gridOffset - {xOffset, yOffset} cell size in meters
17
- * @param {Integer} width - width of the grid
18
- * @param {Integer} height - height of the grid
19
- * @param {Boolean} projectPoints - `true` if doing screen space projection, `false` otherwise
20
- * @param {Array} attributes - attributes array containing position values
21
- * @param {Viewport} viewport - viewport to be used for projection
22
- * @param {Array} posOffset - [xOffset, yOffset] offset to be applied to positions to get cell index
23
- * @param {Object} boundingBox - {xMin, yMin, xMax, yMax} bounding box of input data
24
- *
25
- * @returns {object} - grid data, cell dimension
26
- */
27
- export declare function pointToDensityGridDataCPU(props: any, aggregationParams: any): {
28
- gridHash: GridHash;
29
- gridOffset: {
30
- xOffset: number;
31
- yOffset: number;
32
- };
33
- data: any[];
34
- };
35
- //# sourceMappingURL=grid-aggregator.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"grid-aggregator.d.ts","sourceRoot":"","sources":["../../src/cpu-grid-layer/grid-aggregator.ts"],"names":[],"mappings":"AAuBA,MAAM,MAAM,QAAQ,GAAG;IACrB,CAAC,GAAG,EAAE,MAAM,GAAG;QACb,KAAK,EAAE,MAAM,CAAC;QACd,MAAM,EAAE,OAAO,EAAE,CAAC;QAClB,MAAM,EAAE,MAAM,CAAC;QACf,MAAM,EAAE,MAAM,CAAC;KAChB,CAAC;CACH,CAAC;AAEF;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,yBAAyB,CAAC,KAAK,KAAA,EAAE,iBAAiB,KAAA;;;;;;;EASjE"}
@@ -1,141 +0,0 @@
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.
20
- import { createIterable } from '@deck.gl/core';
21
- import { getGridOffset } from "../utils/grid-aggregation-utils.js";
22
- /**
23
- * Calculate density grid from an array of points
24
- * @param {Object} props - object containing :
25
- * @param {Iterable} [props.data] - data objects to be aggregated
26
- * @param {Integer} [props.cellSize] - size of the grid cell
27
- *
28
- * @param {Object} aggregationParams - object containing :
29
- * @param {Object} gridOffset - {xOffset, yOffset} cell size in meters
30
- * @param {Integer} width - width of the grid
31
- * @param {Integer} height - height of the grid
32
- * @param {Boolean} projectPoints - `true` if doing screen space projection, `false` otherwise
33
- * @param {Array} attributes - attributes array containing position values
34
- * @param {Viewport} viewport - viewport to be used for projection
35
- * @param {Array} posOffset - [xOffset, yOffset] offset to be applied to positions to get cell index
36
- * @param {Object} boundingBox - {xMin, yMin, xMax, yMax} bounding box of input data
37
- *
38
- * @returns {object} - grid data, cell dimension
39
- */
40
- export function pointToDensityGridDataCPU(props, aggregationParams) {
41
- const hashInfo = pointsToGridHashing(props, aggregationParams);
42
- const result = getGridLayerDataFromGridHash(hashInfo);
43
- return {
44
- gridHash: hashInfo.gridHash,
45
- gridOffset: hashInfo.gridOffset,
46
- data: result
47
- };
48
- }
49
- /**
50
- * Project points into each cell, return a hash table of cells
51
- * @param {Iterable} points
52
- * @param {number} cellSize - unit size in meters
53
- * @param {function} getPosition - position accessor
54
- * @returns {object} - grid hash and cell dimension
55
- */
56
- /* eslint-disable-next-line max-statements, complexity */
57
- function pointsToGridHashing(props, aggregationParams) {
58
- const { data = [], cellSize } = props;
59
- const { attributes, viewport, projectPoints, numInstances } = aggregationParams;
60
- const positions = attributes.positions.value;
61
- const { size } = attributes.positions.getAccessor();
62
- const boundingBox = aggregationParams.boundingBox || getPositionBoundingBox(attributes.positions, numInstances);
63
- const offsets = aggregationParams.posOffset || [180, 90];
64
- const gridOffset = aggregationParams.gridOffset || getGridOffset(boundingBox, cellSize);
65
- if (gridOffset.xOffset <= 0 || gridOffset.yOffset <= 0) {
66
- return { gridHash: {}, gridOffset, offsets: [0, 0] };
67
- }
68
- const { width, height } = viewport;
69
- const numCol = Math.ceil(width / gridOffset.xOffset);
70
- const numRow = Math.ceil(height / gridOffset.yOffset);
71
- // calculate count per cell
72
- const gridHash = {};
73
- const { iterable, objectInfo } = createIterable(data);
74
- const position = new Array(3);
75
- for (const pt of iterable) {
76
- objectInfo.index++;
77
- position[0] = positions[objectInfo.index * size];
78
- position[1] = positions[objectInfo.index * size + 1];
79
- position[2] = size >= 3 ? positions[objectInfo.index * size + 2] : 0;
80
- const [x, y] = projectPoints ? viewport.project(position) : position;
81
- if (Number.isFinite(x) && Number.isFinite(y)) {
82
- const yIndex = Math.floor((y + offsets[1]) / gridOffset.yOffset);
83
- const xIndex = Math.floor((x + offsets[0]) / gridOffset.xOffset);
84
- if (!projectPoints ||
85
- // when doing screen space agggregation (projectPoints = true), filter points outside of the viewport range.
86
- (xIndex >= 0 && xIndex < numCol && yIndex >= 0 && yIndex < numRow)) {
87
- const key = `${yIndex}-${xIndex}`;
88
- gridHash[key] = gridHash[key] || { count: 0, points: [], lonIdx: xIndex, latIdx: yIndex };
89
- gridHash[key].count += 1;
90
- gridHash[key].points.push({
91
- source: pt,
92
- index: objectInfo.index
93
- });
94
- }
95
- }
96
- }
97
- return { gridHash, gridOffset, offsets: [offsets[0] * -1, offsets[1] * -1] };
98
- }
99
- /* eslint-enable max-statements, complexity */
100
- function getGridLayerDataFromGridHash({ gridHash, gridOffset, offsets }) {
101
- const data = new Array(Object.keys(gridHash).length);
102
- let i = 0;
103
- for (const key in gridHash) {
104
- const idxs = key.split('-');
105
- const latIdx = parseInt(idxs[0], 10);
106
- const lonIdx = parseInt(idxs[1], 10);
107
- const index = i++;
108
- data[index] = {
109
- index,
110
- position: [
111
- offsets[0] + gridOffset.xOffset * lonIdx,
112
- offsets[1] + gridOffset.yOffset * latIdx
113
- ],
114
- ...gridHash[key]
115
- };
116
- }
117
- return data;
118
- }
119
- // Calculate bounding box of position attribute
120
- function getPositionBoundingBox(positionAttribute, numInstance) {
121
- // TODO - value might not exist (e.g. attribute transition)
122
- const positions = positionAttribute.value;
123
- const { size } = positionAttribute.getAccessor();
124
- let yMin = Infinity;
125
- let yMax = -Infinity;
126
- let xMin = Infinity;
127
- let xMax = -Infinity;
128
- let y;
129
- let x;
130
- for (let i = 0; i < numInstance; i++) {
131
- x = positions[i * size];
132
- y = positions[i * size + 1];
133
- if (Number.isFinite(x) && Number.isFinite(y)) {
134
- yMin = y < yMin ? y : yMin;
135
- yMax = y > yMax ? y : yMax;
136
- xMin = x < xMin ? x : xMin;
137
- xMax = x > xMax ? x : xMax;
138
- }
139
- }
140
- return { xMin, xMax, yMin, yMax };
141
- }
@@ -1,3 +0,0 @@
1
- declare const _default: "#version 300 es\n#define SHADER_NAME gpu-grid-cell-layer-fragment-shader\n\nprecision highp float;\n\nin vec4 vColor;\n\nout vec4 fragColor;\n\nvoid main(void) {\n fragColor = vColor;\n fragColor = picking_filterColor(fragColor);\n}\n";
2
- export default _default;
3
- //# sourceMappingURL=gpu-grid-cell-layer-fragment.glsl.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"gpu-grid-cell-layer-fragment.glsl.d.ts","sourceRoot":"","sources":["../../src/gpu-grid-layer/gpu-grid-cell-layer-fragment.glsl.ts"],"names":[],"mappings":";AAoBA,wBAcE"}
@@ -1,30 +0,0 @@
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.
20
- export default `\
21
- #version 300 es
22
- #define SHADER_NAME gpu-grid-cell-layer-fragment-shader
23
- precision highp float;
24
- in vec4 vColor;
25
- out vec4 fragColor;
26
- void main(void) {
27
- fragColor = vColor;
28
- fragColor = picking_filterColor(fragColor);
29
- }
30
- `;
@@ -1,3 +0,0 @@
1
- declare const _default: "#version 300 es\n#define SHADER_NAME gpu-grid-cell-layer-vertex-shader\n#define RANGE_COUNT 6\n\nin vec3 positions;\nin vec3 normals;\n\nin vec4 colors;\nin vec4 elevations;\nin vec3 instancePickingColors;\n\n// Custom uniforms\nuniform vec2 offset;\nuniform bool extruded;\nuniform float cellSize;\nuniform float coverage;\nuniform float opacity;\nuniform float elevationScale;\n\nuniform ivec2 gridSize;\nuniform vec2 gridOrigin;\nuniform vec2 gridOriginLow;\nuniform vec2 gridOffset;\nuniform vec2 gridOffsetLow;\nuniform vec4 colorRange[RANGE_COUNT];\nuniform vec2 elevationRange;\n\n// Domain uniforms\nuniform vec2 colorDomain;\nuniform bool colorDomainValid;\nuniform vec2 elevationDomain;\nuniform bool elevationDomainValid;\n\nlayout(std140) uniform;\nuniform ColorData\n{\n vec4 maxMinCount;\n} colorData;\nuniform ElevationData\n{\n vec4 maxMinCount;\n} elevationData;\n\n#define EPSILON 0.00001\n\n// Result\nout vec4 vColor;\n\nvec4 quantizeScale(vec2 domain, vec4 range[RANGE_COUNT], float value) {\n vec4 outColor = vec4(0., 0., 0., 0.);\n if (value >= (domain.x - EPSILON) && value <= (domain.y + EPSILON)) {\n float domainRange = domain.y - domain.x;\n if (domainRange <= 0.) {\n outColor = colorRange[0];\n } else {\n float rangeCount = float(RANGE_COUNT);\n float rangeStep = domainRange / rangeCount;\n float idx = floor((value - domain.x) / rangeStep);\n idx = clamp(idx, 0., rangeCount - 1.);\n int intIdx = int(idx);\n outColor = colorRange[intIdx];\n }\n }\n return outColor;\n}\n\nfloat linearScale(vec2 domain, vec2 range, float value) {\n if (value >= (domain.x - EPSILON) && value <= (domain.y + EPSILON)) {\n return ((value - domain.x) / (domain.y - domain.x)) * (range.y - range.x) + range.x;\n }\n return -1.;\n}\n\nvoid main(void) {\n vec2 clrDomain = colorDomainValid ? colorDomain : vec2(colorData.maxMinCount.a, colorData.maxMinCount.r);\n vec4 color = quantizeScale(clrDomain, colorRange, colors.r);\n\n float elevation = 0.0;\n\n if (extruded) {\n vec2 elvDomain = elevationDomainValid ? elevationDomain : vec2(elevationData.maxMinCount.a, elevationData.maxMinCount.r);\n elevation = linearScale(elvDomain, elevationRange, elevations.r);\n elevation = elevation * (positions.z + 1.0) / 2.0 * elevationScale;\n }\n\n // if aggregated color or elevation is 0 do not render\n float shouldRender = float(color.r > 0.0 && elevations.r >= 0.0);\n float dotRadius = cellSize / 2. * coverage * shouldRender;\n\n int yIndex = (gl_InstanceID / gridSize[0]);\n int xIndex = gl_InstanceID - (yIndex * gridSize[0]);\n\n vec2 instancePositionXFP64 = mul_fp64(vec2(gridOffset[0], gridOffsetLow[0]), vec2(float(xIndex), 0.));\n instancePositionXFP64 = sum_fp64(instancePositionXFP64, vec2(gridOrigin[0], gridOriginLow[0]));\n vec2 instancePositionYFP64 = mul_fp64(vec2(gridOffset[1], gridOffsetLow[1]), vec2(float(yIndex), 0.));\n instancePositionYFP64 = sum_fp64(instancePositionYFP64, vec2(gridOrigin[1], gridOriginLow[1]));\n\n vec3 centroidPosition = vec3(instancePositionXFP64[0], instancePositionYFP64[0], elevation);\n vec3 centroidPosition64Low = vec3(instancePositionXFP64[1], instancePositionYFP64[1], 0.0);\n geometry.worldPosition = centroidPosition;\n vec3 pos = vec3(project_size(positions.xy + offset) * dotRadius, 0.);\n\n // Set color to be rendered to picking fbo (also used to check for selection highlight).\n picking_setPickingColor(instancePickingColors);\n\n gl_Position = project_position_to_clipspace(centroidPosition, centroidPosition64Low, pos, geometry.position);\n\n // Light calculations\n // Worldspace is the linear space after Mercator projection\n\n vec3 normals_commonspace = project_normal(normals);\n\n if (extruded) {\n vec3 lightColor = lighting_getLightColor(color.rgb, project_uCameraPosition, geometry.position.xyz, normals_commonspace);\n vColor = vec4(lightColor, color.a * opacity) / 255.;\n } else {\n vColor = vec4(color.rgb, color.a * opacity) / 255.;\n }\n}\n";
2
- export default _default;
3
- //# sourceMappingURL=gpu-grid-cell-layer-vertex.glsl.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"gpu-grid-cell-layer-vertex.glsl.d.ts","sourceRoot":"","sources":["../../src/gpu-grid-layer/gpu-grid-cell-layer-vertex.glsl.ts"],"names":[],"mappings":";AAsBA,wBAwHE"}
@@ -1,112 +0,0 @@
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.
20
- // Inspired by screen-grid-layer vertex shader in deck.gl
21
- export default `\
22
- #version 300 es
23
- #define SHADER_NAME gpu-grid-cell-layer-vertex-shader
24
- #define RANGE_COUNT 6
25
- in vec3 positions;
26
- in vec3 normals;
27
- in vec4 colors;
28
- in vec4 elevations;
29
- in vec3 instancePickingColors;
30
- uniform vec2 offset;
31
- uniform bool extruded;
32
- uniform float cellSize;
33
- uniform float coverage;
34
- uniform float opacity;
35
- uniform float elevationScale;
36
- uniform ivec2 gridSize;
37
- uniform vec2 gridOrigin;
38
- uniform vec2 gridOriginLow;
39
- uniform vec2 gridOffset;
40
- uniform vec2 gridOffsetLow;
41
- uniform vec4 colorRange[RANGE_COUNT];
42
- uniform vec2 elevationRange;
43
- uniform vec2 colorDomain;
44
- uniform bool colorDomainValid;
45
- uniform vec2 elevationDomain;
46
- uniform bool elevationDomainValid;
47
- layout(std140) uniform;
48
- uniform ColorData
49
- {
50
- vec4 maxMinCount;
51
- } colorData;
52
- uniform ElevationData
53
- {
54
- vec4 maxMinCount;
55
- } elevationData;
56
- #define EPSILON 0.00001
57
- out vec4 vColor;
58
- vec4 quantizeScale(vec2 domain, vec4 range[RANGE_COUNT], float value) {
59
- vec4 outColor = vec4(0., 0., 0., 0.);
60
- if (value >= (domain.x - EPSILON) && value <= (domain.y + EPSILON)) {
61
- float domainRange = domain.y - domain.x;
62
- if (domainRange <= 0.) {
63
- outColor = colorRange[0];
64
- } else {
65
- float rangeCount = float(RANGE_COUNT);
66
- float rangeStep = domainRange / rangeCount;
67
- float idx = floor((value - domain.x) / rangeStep);
68
- idx = clamp(idx, 0., rangeCount - 1.);
69
- int intIdx = int(idx);
70
- outColor = colorRange[intIdx];
71
- }
72
- }
73
- return outColor;
74
- }
75
- float linearScale(vec2 domain, vec2 range, float value) {
76
- if (value >= (domain.x - EPSILON) && value <= (domain.y + EPSILON)) {
77
- return ((value - domain.x) / (domain.y - domain.x)) * (range.y - range.x) + range.x;
78
- }
79
- return -1.;
80
- }
81
- void main(void) {
82
- vec2 clrDomain = colorDomainValid ? colorDomain : vec2(colorData.maxMinCount.a, colorData.maxMinCount.r);
83
- vec4 color = quantizeScale(clrDomain, colorRange, colors.r);
84
- float elevation = 0.0;
85
- if (extruded) {
86
- vec2 elvDomain = elevationDomainValid ? elevationDomain : vec2(elevationData.maxMinCount.a, elevationData.maxMinCount.r);
87
- elevation = linearScale(elvDomain, elevationRange, elevations.r);
88
- elevation = elevation * (positions.z + 1.0) / 2.0 * elevationScale;
89
- }
90
- float shouldRender = float(color.r > 0.0 && elevations.r >= 0.0);
91
- float dotRadius = cellSize / 2. * coverage * shouldRender;
92
- int yIndex = (gl_InstanceID / gridSize[0]);
93
- int xIndex = gl_InstanceID - (yIndex * gridSize[0]);
94
- vec2 instancePositionXFP64 = mul_fp64(vec2(gridOffset[0], gridOffsetLow[0]), vec2(float(xIndex), 0.));
95
- instancePositionXFP64 = sum_fp64(instancePositionXFP64, vec2(gridOrigin[0], gridOriginLow[0]));
96
- vec2 instancePositionYFP64 = mul_fp64(vec2(gridOffset[1], gridOffsetLow[1]), vec2(float(yIndex), 0.));
97
- instancePositionYFP64 = sum_fp64(instancePositionYFP64, vec2(gridOrigin[1], gridOriginLow[1]));
98
- vec3 centroidPosition = vec3(instancePositionXFP64[0], instancePositionYFP64[0], elevation);
99
- vec3 centroidPosition64Low = vec3(instancePositionXFP64[1], instancePositionYFP64[1], 0.0);
100
- geometry.worldPosition = centroidPosition;
101
- vec3 pos = vec3(project_size(positions.xy + offset) * dotRadius, 0.);
102
- picking_setPickingColor(instancePickingColors);
103
- gl_Position = project_position_to_clipspace(centroidPosition, centroidPosition64Low, pos, geometry.position);
104
- vec3 normals_commonspace = project_normal(normals);
105
- if (extruded) {
106
- vec3 lightColor = lighting_getLightColor(color.rgb, project_uCameraPosition, geometry.position.xyz, normals_commonspace);
107
- vColor = vec4(lightColor, color.a * opacity) / 255.;
108
- } else {
109
- vColor = vec4(color.rgb, color.a * opacity) / 255.;
110
- }
111
- }
112
- `;
@@ -1,48 +0,0 @@
1
- import { Layer, LayerProps, DefaultProps } from '@deck.gl/core';
2
- import { Model } from '@luma.gl/engine';
3
- import { Buffer } from '@luma.gl/core';
4
- import type { _GPUGridLayerProps } from "./gpu-grid-layer.js";
5
- type _GPUGridCellLayerProps = _GPUGridLayerProps<any> & {
6
- cellSize: number;
7
- offset: number[];
8
- coverage: number;
9
- extruded: boolean;
10
- elevationScale: number;
11
- elevationRange: [number, number];
12
- gridSize: number[];
13
- gridOrigin: number[];
14
- gridOffset: number[];
15
- colorMaxMinBuffer: Buffer;
16
- elevationMaxMinBuffer: Buffer;
17
- };
18
- export default class GPUGridCellLayer extends Layer<_GPUGridCellLayerProps> {
19
- static layerName: string;
20
- static defaultProps: DefaultProps<_GPUGridLayerProps<any> & {
21
- cellSize: number;
22
- offset: number[];
23
- coverage: number;
24
- extruded: boolean;
25
- elevationScale: number;
26
- elevationRange: [number, number];
27
- gridSize: number[];
28
- gridOrigin: number[];
29
- gridOffset: number[];
30
- colorMaxMinBuffer: Buffer;
31
- elevationMaxMinBuffer: Buffer;
32
- } & LayerProps>;
33
- state: {
34
- model?: Model;
35
- };
36
- getShaders(): any;
37
- initializeState(): void;
38
- _getModel(): Model;
39
- draw({ uniforms }: {
40
- uniforms: any;
41
- }): void;
42
- bindUniformBuffers(colorMaxMinBuffer: any, elevationMaxMinBuffer: any): void;
43
- unbindUniformBuffers(colorMaxMinBuffer: any, elevationMaxMinBuffer: any): void;
44
- getDomainUniforms(): Record<string, any>;
45
- private _setupUniformBuffer;
46
- }
47
- export {};
48
- //# sourceMappingURL=gpu-grid-cell-layer.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"gpu-grid-cell-layer.d.ts","sourceRoot":"","sources":["../../src/gpu-grid-layer/gpu-grid-cell-layer.ts"],"names":[],"mappings":"AAoBA,OAAO,EACL,KAAK,EAKL,UAAU,EACV,YAAY,EACb,MAAM,eAAe,CAAC;AAGvB,OAAO,EAAC,KAAK,EAAC,MAAM,iBAAiB,CAAC;AACtC,OAAO,EAAC,MAAM,EAAC,MAAM,eAAe,CAAC;AAGrC,OAAO,KAAK,EAAC,kBAAkB,EAAC,4BAAyB;AA8BzD,KAAK,sBAAsB,GAAG,kBAAkB,CAAC,GAAG,CAAC,GAAG;IACtD,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,OAAO,CAAC;IAClB,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,qBAAqB,EAAE,MAAM,CAAC;CAC/B,CAAC;AAEF,MAAM,CAAC,OAAO,OAAO,gBAAiB,SAAQ,KAAK,CAAC,sBAAsB,CAAC;IACzE,MAAM,CAAC,SAAS,SAAsB;IACtC,MAAM,CAAC,YAAY;;;;;;;;;;;;oBAAgB;IAEnC,KAAK,EAAG;QACN,KAAK,CAAC,EAAE,KAAK,CAAC;KACf,CAAC;IAEF,UAAU;IAQV,eAAe,IAAI,IAAI;IAiBvB,SAAS,IAAI,KAAK;IASlB,IAAI,CAAC,EAAC,QAAQ,EAAC;;KAAA;IAyCf,kBAAkB,CAAC,iBAAiB,KAAA,EAAE,qBAAqB,KAAA;IAK3D,oBAAoB,CAAC,iBAAiB,KAAA,EAAE,qBAAqB,KAAA;IAK7D,iBAAiB;IAkBjB,OAAO,CAAC,mBAAmB;CAU5B"}