@carto/kepler.gl 0.0.81 → 0.0.82

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 (1747) hide show
  1. package/dist/actions/action-wrapper.d.ts +115 -0
  2. package/dist/actions/action-wrapper.js +5 -5
  3. package/dist/actions/actions.d.ts +195 -0
  4. package/dist/actions/actions.js +20 -15
  5. package/dist/actions/identity-actions.d.ts +61 -0
  6. package/dist/actions/identity-actions.js +15 -10
  7. package/dist/actions/index.d.ts +9 -0
  8. package/dist/actions/index.js +1 -1
  9. package/dist/actions/map-state-actions.d.ts +69 -0
  10. package/dist/actions/map-state-actions.js +15 -12
  11. package/dist/actions/map-style-actions.d.ts +146 -0
  12. package/dist/actions/map-style-actions.js +53 -29
  13. package/dist/actions/provider-actions.d.ts +153 -0
  14. package/dist/actions/provider-actions.js +73 -42
  15. package/dist/actions/ui-state-actions.d.ts +300 -0
  16. package/dist/actions/ui-state-actions.js +135 -67
  17. package/dist/actions/vis-state-actions.d.ts +821 -0
  18. package/dist/actions/vis-state-actions.js +26 -111
  19. package/dist/cloud-providers/index.d.ts +2 -0
  20. package/dist/cloud-providers/index.js +2 -2
  21. package/dist/cloud-providers/provider.d.ts +176 -0
  22. package/dist/cloud-providers/provider.js +15 -16
  23. package/dist/components/bottom-widget.d.ts +47 -0
  24. package/dist/components/bottom-widget.js +10 -7
  25. package/dist/components/common/action-panel.d.ts +27 -0
  26. package/dist/components/common/action-panel.js +5 -7
  27. package/dist/components/common/animation-control/animation-control.d.ts +24 -0
  28. package/dist/components/common/animation-control/animation-control.js +7 -6
  29. package/dist/components/common/animation-control/animation-controller.d.ts +16 -0
  30. package/dist/components/common/animation-control/animation-controller.js +51 -31
  31. package/dist/components/common/animation-control/animation-speed-slider.d.ts +12 -0
  32. package/dist/components/common/animation-control/animation-speed-slider.js +6 -9
  33. package/dist/components/common/animation-control/floating-time-display.d.ts +9 -0
  34. package/dist/components/common/animation-control/floating-time-display.js +7 -4
  35. package/dist/components/common/animation-control/playback-controls.d.ts +72 -0
  36. package/dist/components/common/animation-control/playback-controls.js +4 -5
  37. package/dist/components/common/animation-control/speed-control.d.ts +13 -0
  38. package/dist/components/common/animation-control/speed-control.js +1 -1
  39. package/dist/components/common/checkbox.d.ts +35 -0
  40. package/dist/components/common/checkbox.js +10 -27
  41. package/dist/components/common/color-legend.d.ts +43 -0
  42. package/dist/components/common/color-legend.js +11 -23
  43. package/dist/components/common/data-table/button.d.ts +8 -0
  44. package/dist/components/common/data-table/button.js +2 -2
  45. package/dist/components/common/data-table/canvas.d.ts +2 -0
  46. package/dist/components/common/data-table/canvas.js +1 -1
  47. package/dist/components/common/data-table/cell-size.d.ts +36 -0
  48. package/dist/components/common/data-table/cell-size.js +1 -1
  49. package/dist/components/common/data-table/grid.d.ts +7 -0
  50. package/dist/components/common/data-table/grid.js +18 -11
  51. package/dist/components/common/data-table/index.d.ts +143 -0
  52. package/dist/components/common/data-table/index.js +44 -47
  53. package/dist/components/common/data-table/option-dropdown.d.ts +14 -0
  54. package/dist/components/common/data-table/option-dropdown.js +2 -2
  55. package/dist/components/common/dataset-label.d.ts +10 -0
  56. package/dist/components/common/dataset-label.js +3 -3
  57. package/dist/components/common/error-boundary.d.ts +16 -0
  58. package/dist/components/common/error-boundary.js +4 -6
  59. package/dist/components/common/field-selector.d.ts +47 -0
  60. package/dist/components/common/field-selector.js +14 -48
  61. package/dist/components/common/field-token.d.ts +45 -0
  62. package/dist/components/common/field-token.js +2 -2
  63. package/dist/components/common/file-uploader/file-drop.d.ts +54 -0
  64. package/dist/components/common/file-uploader/file-drop.js +22 -21
  65. package/dist/components/common/file-uploader/file-upload-progress.d.ts +8 -0
  66. package/dist/components/common/file-uploader/file-upload-progress.js +7 -8
  67. package/dist/components/common/file-uploader/file-upload.d.ts +27 -0
  68. package/dist/components/common/file-uploader/file-upload.js +12 -14
  69. package/dist/components/common/file-uploader/upload-button.d.ts +8 -0
  70. package/dist/components/common/file-uploader/upload-button.js +37 -61
  71. package/dist/components/common/histogram-plot.d.ts +3 -0
  72. package/dist/components/common/histogram-plot.js +10 -5
  73. package/dist/components/common/icons/add.d.ts +9 -0
  74. package/dist/components/common/icons/add.js +4 -10
  75. package/dist/components/common/icons/anchor_window.d.ts +11 -0
  76. package/dist/components/common/icons/anchor_window.js +1 -6
  77. package/dist/components/common/icons/arrow-down-alt.d.ts +9 -0
  78. package/dist/components/common/icons/arrow-down-alt.js +4 -10
  79. package/dist/components/common/icons/arrow-down-solid.d.ts +9 -0
  80. package/dist/components/common/icons/arrow-down-solid.js +58 -0
  81. package/dist/components/common/icons/arrow-down.d.ts +9 -0
  82. package/dist/components/common/icons/arrow-down.js +4 -10
  83. package/dist/components/common/icons/arrow-left.d.ts +9 -0
  84. package/dist/components/common/icons/arrow-left.js +4 -10
  85. package/dist/components/common/icons/arrow-right.d.ts +9 -0
  86. package/dist/components/common/icons/arrow-right.js +4 -10
  87. package/dist/components/common/icons/arrow-up-alt.d.ts +9 -0
  88. package/dist/components/common/icons/arrow-up-alt.js +4 -10
  89. package/dist/components/common/icons/arrow-up-solid.d.ts +9 -0
  90. package/dist/components/common/icons/arrow-up-solid.js +4 -10
  91. package/dist/components/common/icons/arrow-up.d.ts +9 -0
  92. package/dist/components/common/icons/arrow-up.js +4 -10
  93. package/dist/components/common/icons/base.d.ts +29 -0
  94. package/dist/components/common/icons/base.js +7 -19
  95. package/dist/components/common/icons/bug.d.ts +9 -0
  96. package/dist/components/common/icons/bug.js +4 -10
  97. package/dist/components/common/icons/cancel.d.ts +9 -0
  98. package/dist/components/common/icons/cancel.js +4 -10
  99. package/dist/components/common/icons/checkmark.d.ts +10 -0
  100. package/dist/components/common/icons/checkmark.js +4 -10
  101. package/dist/components/common/icons/chevron-right.js +5 -6
  102. package/dist/components/common/icons/clipboard.d.ts +9 -0
  103. package/dist/components/common/icons/clipboard.js +4 -10
  104. package/dist/components/common/icons/clock.d.ts +9 -0
  105. package/dist/components/common/icons/clock.js +4 -10
  106. package/dist/components/common/icons/close.d.ts +9 -0
  107. package/dist/components/common/icons/close.js +4 -10
  108. package/dist/components/common/icons/code-alt.d.ts +9 -0
  109. package/dist/components/common/icons/code-alt.js +4 -10
  110. package/dist/components/common/icons/copy.d.ts +9 -0
  111. package/dist/components/common/icons/copy.js +4 -10
  112. package/dist/components/common/icons/crosshairs.d.ts +9 -0
  113. package/dist/components/common/icons/crosshairs.js +4 -10
  114. package/dist/components/common/icons/cube-3d.d.ts +9 -0
  115. package/dist/components/common/icons/cube-3d.js +4 -10
  116. package/dist/components/common/icons/cursor-click.d.ts +9 -0
  117. package/dist/components/common/icons/cursor-click.js +4 -10
  118. package/dist/components/common/icons/data-table.d.ts +10 -0
  119. package/dist/components/common/icons/data-table.js +4 -10
  120. package/dist/components/common/icons/db.d.ts +10 -0
  121. package/dist/components/common/icons/db.js +4 -10
  122. package/dist/components/common/icons/delete.d.ts +9 -0
  123. package/dist/components/common/icons/delete.js +4 -9
  124. package/dist/components/common/icons/docs.d.ts +9 -0
  125. package/dist/components/common/icons/docs.js +4 -10
  126. package/dist/components/common/icons/drag-n-drop.d.ts +9 -0
  127. package/dist/components/common/icons/drag-n-drop.js +4 -10
  128. package/dist/components/common/icons/draw-polygon.d.ts +10 -0
  129. package/dist/components/common/icons/draw-polygon.js +4 -13
  130. package/dist/components/common/icons/email.d.ts +9 -0
  131. package/dist/components/common/icons/email.js +4 -10
  132. package/dist/components/common/icons/expand.d.ts +9 -0
  133. package/dist/components/common/icons/expand.js +4 -10
  134. package/dist/components/common/icons/eye-seen.d.ts +9 -0
  135. package/dist/components/common/icons/eye-seen.js +4 -10
  136. package/dist/components/common/icons/eye-unseen.d.ts +9 -0
  137. package/dist/components/common/icons/eye-unseen.js +4 -10
  138. package/dist/components/common/icons/file-type.d.ts +8 -0
  139. package/dist/components/common/icons/file-type.js +1 -1
  140. package/dist/components/common/icons/file.d.ts +9 -0
  141. package/dist/components/common/icons/file.js +4 -10
  142. package/dist/components/common/icons/files.d.ts +9 -0
  143. package/dist/components/common/icons/files.js +3 -9
  144. package/dist/components/common/icons/filter-funnel.d.ts +9 -0
  145. package/dist/components/common/icons/filter-funnel.js +4 -10
  146. package/dist/components/common/icons/free-window.d.ts +11 -0
  147. package/dist/components/common/icons/free-window.js +1 -6
  148. package/dist/components/common/icons/gear.d.ts +9 -0
  149. package/dist/components/common/icons/gear.js +4 -10
  150. package/dist/components/common/icons/hash.d.ts +9 -0
  151. package/dist/components/common/icons/hash.js +4 -10
  152. package/dist/components/common/icons/histogram.d.ts +9 -0
  153. package/dist/components/common/icons/histogram.js +3 -8
  154. package/dist/components/common/icons/index.d.ts +78 -0
  155. package/dist/components/common/icons/index.js +15 -1
  156. package/dist/components/common/icons/info.d.ts +12 -0
  157. package/dist/components/common/icons/info.js +4 -10
  158. package/dist/components/common/icons/layers.d.ts +9 -0
  159. package/dist/components/common/icons/layers.js +4 -10
  160. package/dist/components/common/icons/left-arrow.d.ts +9 -0
  161. package/dist/components/common/icons/left-arrow.js +4 -10
  162. package/dist/components/common/icons/legend.d.ts +9 -0
  163. package/dist/components/common/icons/legend.js +4 -10
  164. package/dist/components/common/icons/line-chart.d.ts +9 -0
  165. package/dist/components/common/icons/line-chart.js +4 -9
  166. package/dist/components/common/icons/login.d.ts +9 -0
  167. package/dist/components/common/icons/login.js +4 -9
  168. package/dist/components/common/icons/logout.d.ts +9 -0
  169. package/dist/components/common/icons/logout.js +4 -9
  170. package/dist/components/common/icons/map-icon.d.ts +11 -0
  171. package/dist/components/common/icons/map-icon.js +4 -11
  172. package/dist/components/common/icons/map.d.ts +11 -0
  173. package/dist/components/common/icons/map.js +4 -11
  174. package/dist/components/common/icons/messages.d.ts +9 -0
  175. package/dist/components/common/icons/messages.js +4 -10
  176. package/dist/components/common/icons/minus.d.ts +9 -0
  177. package/dist/components/common/icons/minus.js +4 -10
  178. package/dist/components/common/icons/order-by-dataset.d.ts +12 -0
  179. package/dist/components/common/icons/order-by-dataset.js +51 -0
  180. package/dist/components/common/icons/order-by-list.d.ts +12 -0
  181. package/dist/components/common/icons/order-by-list.js +43 -0
  182. package/dist/components/common/icons/pause.d.ts +9 -0
  183. package/dist/components/common/icons/pause.js +4 -10
  184. package/dist/components/common/icons/picture.d.ts +9 -0
  185. package/dist/components/common/icons/picture.js +3 -9
  186. package/dist/components/common/icons/pin.d.ts +9 -0
  187. package/dist/components/common/icons/pin.js +12 -14
  188. package/dist/components/common/icons/play.d.ts +9 -0
  189. package/dist/components/common/icons/play.js +4 -10
  190. package/dist/components/common/icons/polygon.d.ts +10 -0
  191. package/dist/components/common/icons/polygon.js +4 -13
  192. package/dist/components/common/icons/rectangle.d.ts +10 -0
  193. package/dist/components/common/icons/rectangle.js +4 -13
  194. package/dist/components/common/icons/reduce.d.ts +9 -0
  195. package/dist/components/common/icons/reduce.js +4 -10
  196. package/dist/components/common/icons/reset.d.ts +9 -0
  197. package/dist/components/common/icons/reset.js +4 -10
  198. package/dist/components/common/icons/rocket.d.ts +9 -0
  199. package/dist/components/common/icons/rocket.js +4 -10
  200. package/dist/components/common/icons/save.d.ts +9 -0
  201. package/dist/components/common/icons/save.js +4 -10
  202. package/dist/components/common/icons/save2.d.ts +9 -0
  203. package/dist/components/common/icons/save2.js +4 -10
  204. package/dist/components/common/icons/search.d.ts +9 -0
  205. package/dist/components/common/icons/search.js +4 -10
  206. package/dist/components/common/icons/settings.d.ts +9 -0
  207. package/dist/components/common/icons/settings.js +4 -10
  208. package/dist/components/common/icons/share.d.ts +9 -0
  209. package/dist/components/common/icons/share.js +4 -10
  210. package/dist/components/common/icons/split.d.ts +9 -0
  211. package/dist/components/common/icons/split.js +4 -10
  212. package/dist/components/common/icons/square-select.d.ts +9 -0
  213. package/dist/components/common/icons/square-select.js +4 -10
  214. package/dist/components/common/icons/swap-horizontal.js +5 -6
  215. package/dist/components/common/icons/table.d.ts +9 -0
  216. package/dist/components/common/icons/table.js +4 -9
  217. package/dist/components/common/icons/trash.d.ts +9 -0
  218. package/dist/components/common/icons/trash.js +4 -10
  219. package/dist/components/common/icons/upload.d.ts +9 -0
  220. package/dist/components/common/icons/upload.js +4 -11
  221. package/dist/components/common/icons/vert-dots.d.ts +9 -0
  222. package/dist/components/common/icons/vert-dots.js +4 -10
  223. package/dist/components/common/icons/vert-three-dots.d.ts +9 -0
  224. package/dist/components/common/icons/vert-three-dots.js +4 -10
  225. package/dist/components/common/icons/warning.d.ts +10 -0
  226. package/dist/components/common/icons/warning.js +4 -10
  227. package/dist/components/common/image-preview.d.ts +15 -0
  228. package/dist/components/common/image-preview.js +1 -2
  229. package/dist/components/common/info-helper.d.ts +11 -0
  230. package/dist/components/common/info-helper.js +1 -7
  231. package/dist/components/common/item-selector/accessor.d.ts +7 -0
  232. package/dist/components/common/item-selector/accessor.js +1 -1
  233. package/dist/components/common/item-selector/chickleted-input.d.ts +21 -0
  234. package/dist/components/common/item-selector/chickleted-input.js +4 -24
  235. package/dist/components/common/item-selector/dropdown-list.d.ts +68 -0
  236. package/dist/components/common/item-selector/dropdown-list.js +30 -40
  237. package/dist/components/common/item-selector/item-selector-submenu.js +8 -9
  238. package/dist/components/common/item-selector/item-selector.d.ts +91 -0
  239. package/dist/components/common/item-selector/item-selector.js +33 -66
  240. package/dist/components/common/item-selector/typeahead.d.ts +115 -0
  241. package/dist/components/common/item-selector/typeahead.js +47 -72
  242. package/dist/components/common/line-chart.d.ts +34 -0
  243. package/dist/components/common/line-chart.js +9 -10
  244. package/dist/components/common/loading-spinner.d.ts +9 -0
  245. package/dist/components/common/loading-spinner.js +2 -4
  246. package/dist/components/common/logo.d.ts +8 -0
  247. package/dist/components/common/logo.js +5 -14
  248. package/dist/components/common/map-layer-selector.d.ts +13 -0
  249. package/dist/components/common/map-layer-selector.js +1 -2
  250. package/dist/components/common/modal.d.ts +49 -0
  251. package/dist/components/common/modal.js +7 -21
  252. package/dist/components/common/portaled.d.ts +527 -0
  253. package/dist/components/common/portaled.js +29 -28
  254. package/dist/components/common/progress-bar.d.ts +12 -0
  255. package/dist/components/common/progress-bar.js +1 -2
  256. package/dist/components/common/range-brush.d.ts +19 -0
  257. package/dist/components/common/range-brush.js +29 -30
  258. package/dist/components/common/range-plot.d.ts +35 -0
  259. package/dist/components/common/range-plot.js +2 -15
  260. package/dist/components/common/range-slider.d.ts +32 -0
  261. package/dist/components/common/range-slider.js +31 -46
  262. package/dist/components/common/slider/mouse-event.d.ts +27 -0
  263. package/dist/components/common/slider/mouse-event.js +49 -44
  264. package/dist/components/common/slider/slider-bar-handle.d.ts +29 -0
  265. package/dist/components/common/slider/slider-bar-handle.js +7 -16
  266. package/dist/components/common/slider/slider-handle.d.ts +33 -0
  267. package/dist/components/common/slider/slider-handle.js +12 -19
  268. package/dist/components/common/slider/slider.d.ts +70 -0
  269. package/dist/components/common/slider/slider.js +42 -62
  270. package/dist/components/common/styled-components.d.ts +119 -0
  271. package/dist/components/common/styled-components.js +21 -11
  272. package/dist/components/common/switch.d.ts +16 -0
  273. package/dist/components/common/switch.js +1 -16
  274. package/dist/components/common/time-range-slider-time-title.d.ts +9 -0
  275. package/dist/components/common/time-range-slider-time-title.js +1 -1
  276. package/dist/components/common/time-range-slider.d.ts +32 -0
  277. package/dist/components/common/time-range-slider.js +4 -22
  278. package/dist/components/common/time-slider-marker.d.ts +21 -0
  279. package/dist/components/common/time-slider-marker.js +2 -2
  280. package/dist/components/common/tippy-tooltip.d.ts +4 -0
  281. package/dist/components/common/tippy-tooltip.js +115 -0
  282. package/dist/components/common/toolbar-item.d.ts +14 -0
  283. package/dist/components/common/toolbar-item.js +8 -6
  284. package/dist/components/common/toolbar.d.ts +5 -0
  285. package/dist/components/common/toolbar.js +1 -1
  286. package/dist/components/common/vertical-toolbar.d.ts +3 -0
  287. package/dist/components/common/vertical-toolbar.js +1 -1
  288. package/dist/components/container.d.ts +39 -0
  289. package/dist/components/container.js +38 -31
  290. package/dist/components/context.d.ts +7 -0
  291. package/dist/components/context.js +1 -1
  292. package/dist/components/editor/constants.d.ts +17 -0
  293. package/dist/components/editor/constants.js +1 -1
  294. package/dist/components/editor/editor.d.ts +29 -0
  295. package/dist/components/editor/editor.js +26 -42
  296. package/dist/components/editor/feature-action-panel.d.ts +27 -0
  297. package/dist/components/editor/feature-action-panel.js +13 -18
  298. package/dist/components/editor/feature-styles.d.ts +24 -0
  299. package/dist/components/editor/feature-styles.js +3 -3
  300. package/dist/components/editor/handle-style.d.ts +38 -0
  301. package/dist/components/editor/handle-style.js +3 -3
  302. package/dist/components/filters/components.d.ts +1 -0
  303. package/dist/components/filters/components.js +1 -1
  304. package/dist/components/filters/filter-panels/filter-panel-with-field-select.d.ts +10 -0
  305. package/dist/components/filters/filter-panels/filter-panel-with-field-select.js +5 -8
  306. package/dist/components/filters/filter-panels/multi-select-filter-panel.d.ts +9 -0
  307. package/dist/components/filters/filter-panels/multi-select-filter-panel.js +3 -10
  308. package/dist/components/filters/filter-panels/new-filter-panel.d.ts +12 -0
  309. package/dist/components/filters/filter-panels/new-filter-panel.js +4 -10
  310. package/dist/components/filters/filter-panels/polygon-filter-panel.d.ts +9 -0
  311. package/dist/components/filters/filter-panels/polygon-filter-panel.js +6 -11
  312. package/dist/components/filters/filter-panels/range-filter-panel.d.ts +9 -0
  313. package/dist/components/filters/filter-panels/range-filter-panel.js +3 -10
  314. package/dist/components/filters/filter-panels/single-select-filter-panel.d.ts +9 -0
  315. package/dist/components/filters/filter-panels/single-select-filter-panel.js +3 -10
  316. package/dist/components/filters/filter-panels/time-range-filter-panel.d.ts +8 -0
  317. package/dist/components/filters/filter-panels/time-range-filter-panel.js +6 -9
  318. package/dist/components/filters/filter-panels/types.d.ts +36 -0
  319. package/dist/components/filters/filter-panels/types.js +6 -0
  320. package/dist/components/filters/index.d.ts +5 -0
  321. package/dist/components/filters/index.js +1 -1
  322. package/dist/components/filters/multi-select-filter.d.ts +3 -0
  323. package/dist/components/filters/multi-select-filter.js +1 -1
  324. package/dist/components/filters/polygon-filter.d.ts +4 -0
  325. package/dist/components/filters/polygon-filter.js +3 -4
  326. package/dist/components/filters/range-filter.d.ts +8 -0
  327. package/dist/components/filters/range-filter.js +2 -2
  328. package/dist/components/filters/single-select-filter.d.ts +3 -0
  329. package/dist/components/filters/single-select-filter.js +1 -1
  330. package/dist/components/filters/time-range-filter.d.ts +28 -0
  331. package/dist/components/filters/time-range-filter.js +1 -1
  332. package/dist/components/filters/time-widget.d.ts +14 -0
  333. package/dist/components/filters/time-widget.js +2 -3
  334. package/dist/components/filters/types.d.ts +53 -0
  335. package/dist/components/filters/types.js +6 -0
  336. package/dist/components/geocoder/geocoder.d.ts +33 -0
  337. package/dist/components/geocoder/geocoder.js +17 -17
  338. package/dist/components/geocoder-panel.d.ts +28 -0
  339. package/dist/components/geocoder-panel.js +24 -31
  340. package/dist/components/index.d.ts +165 -0
  341. package/dist/components/index.js +98 -15
  342. package/dist/components/injector.d.ts +25 -0
  343. package/dist/components/injector.js +4 -4
  344. package/dist/components/kepler-gl.d.ts +302 -0
  345. package/dist/components/kepler-gl.js +60 -43
  346. package/dist/components/map/coordinate-info.d.ts +7 -0
  347. package/dist/components/map/coordinate-info.js +1 -1
  348. package/dist/components/map/layer-hover-info.d.ts +13 -0
  349. package/dist/components/map/layer-hover-info.js +1 -2
  350. package/dist/components/map/layer-selector-panel.d.ts +22 -0
  351. package/dist/components/map/layer-selector-panel.js +2 -2
  352. package/dist/components/map/locale-panel.d.ts +16 -0
  353. package/dist/components/map/locale-panel.js +17 -13
  354. package/dist/components/map/map-control-panel.d.ts +14 -0
  355. package/dist/components/map/map-control-panel.js +20 -5
  356. package/dist/components/map/map-control-toolbar.d.ts +2 -0
  357. package/dist/components/map/map-control-toolbar.js +1 -1
  358. package/dist/components/map/map-control-tooltip.d.ts +7 -0
  359. package/dist/components/map/map-control-tooltip.js +3 -3
  360. package/dist/components/map/map-control.d.ts +44 -0
  361. package/dist/components/map/map-control.js +2 -2
  362. package/dist/components/map/map-draw-panel.d.ts +21 -0
  363. package/dist/components/map/map-draw-panel.js +19 -13
  364. package/dist/components/map/map-legend-panel.d.ts +23 -0
  365. package/dist/components/map/map-legend-panel.js +101 -56
  366. package/dist/components/map/map-legend.d.ts +55 -0
  367. package/dist/components/map/map-legend.js +20 -12
  368. package/dist/components/map/map-popover.d.ts +37 -0
  369. package/dist/components/map/map-popover.js +7 -4
  370. package/dist/components/map/split-map-button.d.ts +19 -0
  371. package/dist/components/map/split-map-button.js +18 -15
  372. package/dist/components/map/toggle-3d-button.d.ts +16 -0
  373. package/dist/components/map/toggle-3d-button.js +19 -15
  374. package/dist/components/map-container.d.ts +58 -0
  375. package/dist/components/map-container.js +60 -73
  376. package/dist/components/maps-layout.d.ts +10 -0
  377. package/dist/components/maps-layout.js +6 -5
  378. package/dist/components/modal-container.d.ts +65 -0
  379. package/dist/components/modal-container.js +29 -54
  380. package/dist/components/modals/add-map-style-modal.d.ts +17 -0
  381. package/dist/components/modals/add-map-style-modal.js +10 -18
  382. package/dist/components/modals/cloud-tile.d.ts +15 -0
  383. package/dist/components/modals/cloud-tile.js +1 -1
  384. package/dist/components/modals/data-table-modal.d.ts +29 -0
  385. package/dist/components/modals/data-table-modal.js +33 -29
  386. package/dist/components/modals/delete-data-modal.d.ts +10 -0
  387. package/dist/components/modals/delete-data-modal.js +1 -1
  388. package/dist/components/modals/error-display.d.ts +6 -0
  389. package/dist/components/modals/error-display.js +1 -1
  390. package/dist/components/modals/export-data-modal.d.ts +25 -0
  391. package/dist/components/modals/export-data-modal.js +12 -28
  392. package/dist/components/modals/export-image-modal.d.ts +18 -0
  393. package/dist/components/modals/export-image-modal.js +2 -2
  394. package/dist/components/modals/export-map-modal/components.d.ts +8 -0
  395. package/dist/components/modals/export-map-modal/components.js +1 -1
  396. package/dist/components/modals/export-map-modal/export-html-map.d.ts +12 -0
  397. package/dist/components/modals/export-map-modal/export-html-map.js +1 -2
  398. package/dist/components/modals/export-map-modal/export-json-map.d.ts +9 -0
  399. package/dist/components/modals/export-map-modal/export-json-map.js +20 -9
  400. package/dist/components/modals/export-map-modal/export-map-modal.d.ts +27 -0
  401. package/dist/components/modals/export-map-modal/export-map-modal.js +6 -18
  402. package/dist/components/modals/image-modal-container.d.ts +18 -0
  403. package/dist/components/modals/image-modal-container.js +5 -5
  404. package/dist/components/modals/load-data-modal.d.ts +33 -0
  405. package/dist/components/modals/load-data-modal.js +4 -4
  406. package/dist/components/modals/load-storage-map.d.ts +26 -0
  407. package/dist/components/modals/load-storage-map.js +10 -12
  408. package/dist/components/modals/loading-dialog.d.ts +7 -0
  409. package/dist/components/modals/loading-dialog.js +1 -1
  410. package/dist/components/modals/modal-dialog.d.ts +2 -0
  411. package/dist/components/modals/modal-dialog.js +1 -1
  412. package/dist/components/modals/modal-tabs.d.ts +27 -0
  413. package/dist/components/modals/modal-tabs.js +2 -2
  414. package/dist/components/modals/overwrite-map-modal.d.ts +16 -0
  415. package/dist/components/modals/overwrite-map-modal.js +1 -1
  416. package/dist/components/modals/provider-modal-container.d.ts +23 -0
  417. package/dist/components/modals/provider-modal-container.js +8 -13
  418. package/dist/components/modals/save-map-modal.d.ts +29 -0
  419. package/dist/components/modals/save-map-modal.js +5 -6
  420. package/dist/components/modals/share-map-modal.d.ts +30 -0
  421. package/dist/components/modals/share-map-modal.js +19 -22
  422. package/dist/components/modals/status-panel.d.ts +13 -0
  423. package/dist/components/modals/status-panel.js +1 -1
  424. package/dist/components/modals/storage-map-viewer.d.ts +21 -0
  425. package/dist/components/modals/storage-map-viewer.js +5 -12
  426. package/dist/components/notification-panel/notification-item.d.ts +66 -0
  427. package/dist/components/notification-panel/notification-item.js +7 -18
  428. package/dist/components/notification-panel.d.ts +61 -0
  429. package/dist/components/notification-panel.js +6 -13
  430. package/dist/components/performance.d.ts +4 -0
  431. package/dist/components/performance.js +2 -1
  432. package/dist/components/plot-container.d.ts +24 -0
  433. package/dist/components/plot-container.js +35 -40
  434. package/dist/components/side-panel/cloud-storage-dropdown.d.ts +6 -0
  435. package/dist/components/side-panel/cloud-storage-dropdown.js +1 -1
  436. package/dist/components/side-panel/common/dataset-info.d.ts +3 -0
  437. package/dist/components/side-panel/common/dataset-info.js +1 -1
  438. package/dist/components/side-panel/common/dataset-tag.d.ts +3 -0
  439. package/dist/components/side-panel/common/dataset-tag.js +37 -13
  440. package/dist/components/side-panel/common/dataset-title.d.ts +8 -0
  441. package/dist/components/side-panel/common/dataset-title.js +49 -19
  442. package/dist/components/side-panel/common/source-data-catalog.d.ts +9 -0
  443. package/dist/components/side-panel/common/source-data-catalog.js +5 -3
  444. package/dist/components/side-panel/common/source-data-selector.d.ts +8 -0
  445. package/dist/components/side-panel/common/source-data-selector.js +18 -13
  446. package/dist/components/side-panel/common/types.d.ts +58 -0
  447. package/dist/components/side-panel/common/types.js +6 -0
  448. package/dist/components/side-panel/custom-panel.d.ts +9 -0
  449. package/dist/components/side-panel/custom-panel.js +1 -1
  450. package/dist/components/side-panel/filter-manager.d.ts +20 -0
  451. package/dist/components/side-panel/filter-manager.js +7 -15
  452. package/dist/components/side-panel/filter-panel/filter-panel-header.d.ts +21 -0
  453. package/dist/components/side-panel/filter-panel/filter-panel-header.js +3 -6
  454. package/dist/components/side-panel/filter-panel/filter-panel.d.ts +23 -0
  455. package/dist/components/side-panel/filter-panel/filter-panel.js +15 -31
  456. package/dist/components/side-panel/interaction-manager.d.ts +14 -0
  457. package/dist/components/side-panel/interaction-manager.js +1 -1
  458. package/dist/components/side-panel/interaction-panel/brush-config.d.ts +15 -0
  459. package/dist/components/side-panel/interaction-panel/brush-config.js +1 -1
  460. package/dist/components/side-panel/interaction-panel/interaction-panel.d.ts +19 -0
  461. package/dist/components/side-panel/interaction-panel/interaction-panel.js +9 -17
  462. package/dist/components/side-panel/interaction-panel/tooltip-config/tooltip-chicklet.d.ts +28 -0
  463. package/dist/components/side-panel/interaction-panel/tooltip-config/tooltip-chicklet.js +15 -21
  464. package/dist/components/side-panel/interaction-panel/tooltip-config.d.ts +38 -0
  465. package/dist/components/side-panel/interaction-panel/tooltip-config.js +7 -3
  466. package/dist/components/side-panel/layer-manager.d.ts +46 -0
  467. package/dist/components/side-panel/layer-manager.js +87 -192
  468. package/dist/components/side-panel/layer-panel/add-layer-button.d.ts +10 -0
  469. package/dist/components/side-panel/layer-panel/add-layer-button.js +147 -0
  470. package/dist/components/side-panel/layer-panel/color-dimension-scale-selector.d.ts +8 -0
  471. package/dist/components/side-panel/layer-panel/color-dimension-scale-selector.js +2 -2
  472. package/dist/components/side-panel/layer-panel/color-palette.d.ts +13 -0
  473. package/dist/components/side-panel/layer-panel/color-palette.js +7 -15
  474. package/dist/components/side-panel/layer-panel/color-range-selector.d.ts +129 -0
  475. package/dist/components/side-panel/layer-panel/color-range-selector.js +105 -142
  476. package/dist/components/side-panel/layer-panel/color-selector.d.ts +101 -0
  477. package/dist/components/side-panel/layer-panel/color-selector.js +16 -37
  478. package/dist/components/side-panel/layer-panel/column-selector.d.ts +22 -0
  479. package/dist/components/side-panel/layer-panel/column-selector.js +3 -3
  480. package/dist/components/side-panel/layer-panel/custom-markers-config-group.d.ts +6 -0
  481. package/dist/components/side-panel/layer-panel/custom-markers-config-group.js +2 -2
  482. package/dist/components/side-panel/layer-panel/custom-palette.d.ts +38 -0
  483. package/dist/components/side-panel/layer-panel/custom-palette.js +55 -61
  484. package/dist/components/side-panel/layer-panel/custom-picker.d.ts +67 -0
  485. package/dist/components/side-panel/layer-panel/custom-picker.js +7 -16
  486. package/dist/components/side-panel/layer-panel/dataset-layer-group.d.ts +24 -0
  487. package/dist/components/side-panel/layer-panel/dataset-layer-group.js +81 -0
  488. package/dist/components/side-panel/layer-panel/dataset-layer-section.d.ts +25 -0
  489. package/dist/components/side-panel/layer-panel/dataset-layer-section.js +74 -0
  490. package/dist/components/side-panel/layer-panel/dataset-section.d.ts +26 -0
  491. package/dist/components/side-panel/layer-panel/dataset-section.js +91 -0
  492. package/dist/components/side-panel/layer-panel/dimension-scale-selector.d.ts +10 -0
  493. package/dist/components/side-panel/layer-panel/dimension-scale-selector.js +1 -1
  494. package/dist/components/side-panel/layer-panel/hex-column-config.d.ts +62 -0
  495. package/dist/components/side-panel/layer-panel/hex-column-config.js +4 -5
  496. package/dist/components/side-panel/layer-panel/layer-aggregation-resolution.d.ts +8 -0
  497. package/dist/components/side-panel/layer-panel/layer-aggregation-resolution.js +1 -1
  498. package/dist/components/side-panel/layer-panel/layer-column-config.d.ts +20 -0
  499. package/dist/components/side-panel/layer-panel/layer-column-config.js +2 -13
  500. package/dist/components/side-panel/layer-panel/layer-config-group.d.ts +37 -0
  501. package/dist/components/side-panel/layer-panel/layer-config-group.js +11 -13
  502. package/dist/components/side-panel/layer-panel/layer-configurator.d.ts +415 -0
  503. package/dist/components/side-panel/layer-panel/layer-configurator.js +70 -63
  504. package/dist/components/side-panel/layer-panel/layer-list.d.ts +20 -0
  505. package/dist/components/side-panel/layer-panel/layer-list.js +168 -0
  506. package/dist/components/side-panel/layer-panel/layer-panel-header.d.ts +43 -0
  507. package/dist/components/side-panel/layer-panel/layer-panel-header.js +10 -24
  508. package/dist/components/side-panel/layer-panel/layer-panel.d.ts +40 -0
  509. package/dist/components/side-panel/layer-panel/layer-panel.js +19 -38
  510. package/dist/components/side-panel/layer-panel/layer-type-dropdown-list.d.ts +17 -0
  511. package/dist/components/side-panel/layer-panel/layer-type-dropdown-list.js +2 -2
  512. package/dist/components/side-panel/layer-panel/layer-type-list-item.d.ts +11 -0
  513. package/dist/components/side-panel/layer-panel/layer-type-list-item.js +1 -1
  514. package/dist/components/side-panel/layer-panel/layer-type-selector.d.ts +23 -0
  515. package/dist/components/side-panel/layer-panel/layer-type-selector.js +2 -8
  516. package/dist/components/side-panel/layer-panel/layer-visibility-by-zoom.d.ts +23 -0
  517. package/dist/components/side-panel/layer-panel/layer-visibility-by-zoom.js +3 -3
  518. package/dist/components/side-panel/layer-panel/panel-view-list-toggle.d.ts +36 -0
  519. package/dist/components/side-panel/layer-panel/panel-view-list-toggle.js +116 -0
  520. package/dist/components/side-panel/layer-panel/single-color-palette.d.ts +12 -0
  521. package/dist/components/side-panel/layer-panel/single-color-palette.js +27 -58
  522. package/dist/components/side-panel/layer-panel/text-label-panel.d.ts +18 -0
  523. package/dist/components/side-panel/layer-panel/text-label-panel.js +9 -16
  524. package/dist/components/side-panel/layer-panel/vis-config-by-field-selector.d.ts +35 -0
  525. package/dist/components/side-panel/layer-panel/vis-config-by-field-selector.js +22 -35
  526. package/dist/components/side-panel/layer-panel/vis-config-slider.d.ts +20 -0
  527. package/dist/components/side-panel/layer-panel/vis-config-slider.js +130 -34
  528. package/dist/components/side-panel/layer-panel/vis-config-switch.d.ts +16 -0
  529. package/dist/components/side-panel/layer-panel/vis-config-switch.js +1 -11
  530. package/dist/components/side-panel/map-manager.d.ts +21 -0
  531. package/dist/components/side-panel/map-manager.js +9 -17
  532. package/dist/components/side-panel/map-style-panel/map-layer-selector.d.ts +19 -0
  533. package/dist/components/side-panel/map-style-panel/map-layer-selector.js +1 -1
  534. package/dist/components/side-panel/map-style-panel/map-style-selector.d.ts +16 -0
  535. package/dist/components/side-panel/map-style-panel/map-style-selector.js +1 -1
  536. package/dist/components/side-panel/panel-dropdown.d.ts +18 -0
  537. package/dist/components/side-panel/panel-dropdown.js +5 -13
  538. package/dist/components/side-panel/panel-header-action.d.ts +20 -0
  539. package/dist/components/side-panel/panel-header-action.js +5 -18
  540. package/dist/components/side-panel/panel-header.d.ts +78 -0
  541. package/dist/components/side-panel/panel-header.js +17 -29
  542. package/dist/components/side-panel/panel-tab.d.ts +20 -0
  543. package/dist/components/side-panel/panel-tab.js +1 -1
  544. package/dist/components/side-panel/panel-title.d.ts +4 -0
  545. package/dist/components/side-panel/panel-title.js +7 -2
  546. package/dist/components/side-panel/panel-toggle.d.ts +14 -0
  547. package/dist/components/side-panel/panel-toggle.js +2 -9
  548. package/dist/components/side-panel/side-bar.d.ts +76 -0
  549. package/dist/components/side-panel/side-bar.js +6 -14
  550. package/dist/components/side-panel.d.ts +134 -0
  551. package/dist/components/side-panel.js +19 -17
  552. package/dist/components/types.d.ts +44 -0
  553. package/dist/components/types.js +6 -0
  554. package/dist/connect/keplergl-connect.d.ts +5 -0
  555. package/dist/connect/keplergl-connect.js +1 -1
  556. package/dist/connect/with-local-selector.d.ts +6 -0
  557. package/dist/connect/with-local-selector.js +10 -13
  558. package/dist/constants/action-types.d.ts +111 -0
  559. package/dist/constants/action-types.js +8 -3
  560. package/dist/constants/color-palette.d.ts +491 -0
  561. package/dist/constants/color-palette.js +1 -1
  562. package/dist/constants/color-ranges.d.ts +24 -0
  563. package/dist/constants/color-ranges.js +3 -1
  564. package/dist/constants/custom-color-ranges.d.ts +37 -0
  565. package/dist/constants/custom-color-ranges.js +1 -1
  566. package/dist/constants/default-settings.d.ts +773 -0
  567. package/dist/constants/default-settings.js +25 -13
  568. package/dist/constants/index.d.ts +9 -0
  569. package/dist/constants/index.js +1 -1
  570. package/dist/constants/keyevent.d.ts +2 -0
  571. package/dist/constants/keyevent.js +1 -1
  572. package/dist/constants/tooltip.d.ts +165 -0
  573. package/dist/constants/tooltip.js +1 -1
  574. package/dist/constants/user-feedbacks.d.ts +5 -0
  575. package/dist/constants/user-feedbacks.js +1 -1
  576. package/dist/constants/user-guides.d.ts +9 -0
  577. package/dist/constants/user-guides.js +1 -1
  578. package/dist/deckgl-layers/3d-building-layer/3d-building-layer.d.ts +13 -0
  579. package/dist/deckgl-layers/3d-building-layer/3d-building-layer.js +13 -6
  580. package/dist/deckgl-layers/3d-building-layer/3d-building-utils.d.ts +7 -0
  581. package/dist/deckgl-layers/3d-building-layer/3d-building-utils.js +1 -1
  582. package/dist/deckgl-layers/3d-building-layer/types.d.ts +37 -0
  583. package/dist/deckgl-layers/3d-building-layer/types.js +6 -0
  584. package/dist/deckgl-layers/cluster-layer/cluster-layer.js +4 -5
  585. package/dist/deckgl-layers/column-layer/enhanced-column-layer.d.ts +6 -0
  586. package/dist/deckgl-layers/column-layer/enhanced-column-layer.js +9 -9
  587. package/dist/deckgl-layers/grid-layer/enhanced-cpu-grid-layer.d.ts +13 -0
  588. package/dist/deckgl-layers/grid-layer/enhanced-cpu-grid-layer.js +15 -14
  589. package/dist/deckgl-layers/hexagon-layer/enhanced-hexagon-layer.d.ts +13 -0
  590. package/dist/deckgl-layers/hexagon-layer/enhanced-hexagon-layer.js +15 -14
  591. package/dist/deckgl-layers/layer-utils/cluster-utils.js +4 -5
  592. package/dist/deckgl-layers/layer-utils/cpu-aggregator.d.ts +91 -0
  593. package/dist/deckgl-layers/layer-utils/cpu-aggregator.js +9 -10
  594. package/dist/deckgl-layers/layer-utils/shader-utils.d.ts +1 -0
  595. package/dist/deckgl-layers/layer-utils/shader-utils.js +1 -1
  596. package/dist/deckgl-layers/line-layer/line-layer.d.ts +12 -0
  597. package/dist/deckgl-layers/line-layer/line-layer.js +17 -15
  598. package/dist/deckgl-layers/svg-icon-layer/scatterplot-icon-layer.d.ts +8 -0
  599. package/dist/deckgl-layers/svg-icon-layer/scatterplot-icon-layer.js +18 -12
  600. package/dist/deckgl-layers/svg-icon-layer/svg-icon-layer.d.ts +18 -0
  601. package/dist/deckgl-layers/svg-icon-layer/svg-icon-layer.js +14 -5
  602. package/dist/index.d.ts +11 -0
  603. package/dist/index.js +2 -2
  604. package/dist/layers/aggregation-layer.d.ts +70 -0
  605. package/dist/layers/aggregation-layer.js +34 -24
  606. package/dist/layers/arc-layer/arc-layer-icon.d.ts +16 -0
  607. package/dist/layers/arc-layer/arc-layer-icon.js +4 -5
  608. package/dist/layers/arc-layer/arc-layer.d.ts +143 -0
  609. package/dist/layers/arc-layer/arc-layer.js +21 -19
  610. package/dist/layers/base-layer.d.ts +436 -0
  611. package/dist/layers/base-layer.js +96 -80
  612. package/dist/layers/cluster-layer/cluster-layer-icon.d.ts +16 -0
  613. package/dist/layers/cluster-layer/cluster-layer-icon.js +4 -5
  614. package/dist/layers/cluster-layer/cluster-layer.d.ts +39 -0
  615. package/dist/layers/cluster-layer/cluster-layer.js +4 -5
  616. package/dist/layers/default-layer-icon.d.ts +14 -0
  617. package/dist/layers/default-layer-icon.js +4 -5
  618. package/dist/layers/geojson-layer/geojson-layer-icon.d.ts +15 -0
  619. package/dist/layers/geojson-layer/geojson-layer-icon.js +4 -5
  620. package/dist/layers/geojson-layer/geojson-layer.d.ts +227 -0
  621. package/dist/layers/geojson-layer/geojson-layer.js +25 -15
  622. package/dist/layers/geojson-layer/geojson-utils.d.ts +44 -0
  623. package/dist/layers/geojson-layer/geojson-utils.js +19 -6
  624. package/dist/layers/grid-layer/grid-layer-icon.d.ts +15 -0
  625. package/dist/layers/grid-layer/grid-layer-icon.js +4 -5
  626. package/dist/layers/grid-layer/grid-layer.d.ts +74 -0
  627. package/dist/layers/grid-layer/grid-layer.js +5 -5
  628. package/dist/layers/grid-layer/grid-utils.d.ts +24 -0
  629. package/dist/layers/grid-layer/grid-utils.js +7 -7
  630. package/dist/layers/h3-hexagon-layer/h3-hexagon-layer-icon.d.ts +16 -0
  631. package/dist/layers/h3-hexagon-layer/h3-hexagon-layer-icon.js +4 -5
  632. package/dist/layers/h3-hexagon-layer/h3-hexagon-layer.d.ts +170 -0
  633. package/dist/layers/h3-hexagon-layer/h3-hexagon-layer.js +15 -8
  634. package/dist/layers/h3-hexagon-layer/h3-utils.d.ts +20 -0
  635. package/dist/layers/h3-hexagon-layer/h3-utils.js +2 -2
  636. package/dist/layers/heatmap-layer/heatmap-layer-icon.d.ts +15 -0
  637. package/dist/layers/heatmap-layer/heatmap-layer-icon.js +4 -5
  638. package/dist/layers/heatmap-layer/heatmap-layer.d.ts +144 -0
  639. package/dist/layers/heatmap-layer/heatmap-layer.js +26 -32
  640. package/dist/layers/hexagon-layer/hexagon-layer-icon.d.ts +15 -0
  641. package/dist/layers/hexagon-layer/hexagon-layer-icon.js +4 -5
  642. package/dist/layers/hexagon-layer/hexagon-layer.d.ts +78 -0
  643. package/dist/layers/hexagon-layer/hexagon-layer.js +5 -5
  644. package/dist/layers/hexagon-layer/hexagon-utils.d.ts +7 -0
  645. package/dist/layers/hexagon-layer/hexagon-utils.js +1 -1
  646. package/dist/layers/icon-layer/icon-info-modal.d.ts +3 -0
  647. package/dist/layers/icon-layer/icon-info-modal.js +3 -2
  648. package/dist/layers/icon-layer/icon-layer-icon.d.ts +15 -0
  649. package/dist/layers/icon-layer/icon-layer-icon.js +4 -5
  650. package/dist/layers/icon-layer/icon-layer.d.ts +119 -0
  651. package/dist/layers/icon-layer/icon-layer.js +24 -12
  652. package/dist/layers/index.d.ts +53 -0
  653. package/dist/layers/index.js +3 -3
  654. package/dist/layers/layer-factory.d.ts +150 -0
  655. package/dist/layers/layer-factory.js +54 -39
  656. package/dist/layers/layer-text-label.d.ts +7 -0
  657. package/dist/layers/layer-text-label.js +1 -3
  658. package/dist/layers/layer-update.d.ts +9 -0
  659. package/dist/layers/layer-update.js +1 -2
  660. package/dist/layers/line-layer/line-layer-icon.d.ts +15 -0
  661. package/dist/layers/line-layer/line-layer-icon.js +4 -5
  662. package/dist/layers/line-layer/line-layer.d.ts +136 -0
  663. package/dist/layers/line-layer/line-layer.js +28 -26
  664. package/dist/layers/mapbox-utils.d.ts +57 -0
  665. package/dist/layers/mapbox-utils.js +9 -14
  666. package/dist/layers/mapboxgl-layer.d.ts +87 -0
  667. package/dist/layers/mapboxgl-layer.js +19 -13
  668. package/dist/layers/point-layer/point-layer-icon.d.ts +15 -0
  669. package/dist/layers/point-layer/point-layer-icon.js +4 -5
  670. package/dist/layers/point-layer/point-layer.d.ts +272 -0
  671. package/dist/layers/point-layer/point-layer.js +31 -17
  672. package/dist/layers/s2-geometry-layer/s2-geometry-layer.d.ts +189 -0
  673. package/dist/layers/s2-geometry-layer/s2-geometry-layer.js +15 -11
  674. package/dist/layers/s2-geometry-layer/s2-layer-icon.d.ts +15 -0
  675. package/dist/layers/s2-geometry-layer/s2-layer-icon.js +4 -5
  676. package/dist/layers/s2-geometry-layer/s2-utils.d.ts +7 -0
  677. package/dist/layers/s2-geometry-layer/s2-utils.js +7 -1
  678. package/dist/layers/scenegraph-layer/scenegraph-info-modal.d.ts +3 -0
  679. package/dist/layers/scenegraph-layer/scenegraph-info-modal.js +1 -1
  680. package/dist/layers/scenegraph-layer/scenegraph-layer-icon.d.ts +15 -0
  681. package/dist/layers/scenegraph-layer/scenegraph-layer-icon.js +4 -5
  682. package/dist/layers/scenegraph-layer/scenegraph-layer.d.ts +80 -0
  683. package/dist/layers/scenegraph-layer/scenegraph-layer.js +9 -6
  684. package/dist/layers/trip-layer/trip-info-modal.d.ts +3 -0
  685. package/dist/layers/trip-layer/trip-info-modal.js +1 -1
  686. package/dist/layers/trip-layer/trip-layer-icon.d.ts +15 -0
  687. package/dist/layers/trip-layer/trip-layer-icon.js +4 -5
  688. package/dist/layers/trip-layer/trip-layer.d.ts +157 -0
  689. package/dist/layers/trip-layer/trip-layer.js +21 -13
  690. package/dist/layers/trip-layer/trip-utils.d.ts +31 -0
  691. package/dist/layers/trip-layer/trip-utils.js +13 -14
  692. package/dist/layers/types.d.ts +15 -0
  693. package/dist/layers/types.js +1 -1
  694. package/dist/localization/formatted-message.d.ts +12 -0
  695. package/dist/localization/formatted-message.js +6 -7
  696. package/dist/localization/index.d.ts +5 -0
  697. package/dist/localization/index.js +2 -2
  698. package/dist/localization/locales.d.ts +27 -0
  699. package/dist/localization/locales.js +1 -1
  700. package/dist/localization/messages.d.ts +4 -0
  701. package/dist/localization/messages.js +37 -0
  702. package/dist/localization/translations/ca.d.ts +438 -0
  703. package/dist/localization/translations/ca.js +466 -0
  704. package/dist/localization/translations/cn.d.ts +441 -0
  705. package/dist/localization/translations/cn.js +469 -0
  706. package/dist/localization/translations/en.d.ts +466 -0
  707. package/dist/localization/translations/en.js +494 -0
  708. package/dist/localization/translations/es.d.ts +438 -0
  709. package/dist/localization/translations/es.js +466 -0
  710. package/dist/localization/translations/fi.d.ts +410 -0
  711. package/dist/localization/translations/fi.js +438 -0
  712. package/dist/localization/translations/ja.d.ts +439 -0
  713. package/dist/localization/translations/ja.js +467 -0
  714. package/dist/localization/translations/pt.d.ts +410 -0
  715. package/dist/localization/translations/pt.js +438 -0
  716. package/dist/localization/translations/ru.d.ts +447 -0
  717. package/dist/localization/translations/ru.js +475 -0
  718. package/dist/middleware/index.d.ts +8 -0
  719. package/dist/middleware/index.js +3 -3
  720. package/dist/processors/data-processor.d.ts +242 -0
  721. package/dist/processors/data-processor.js +44 -43
  722. package/dist/processors/file-handler.d.ts +28 -0
  723. package/dist/processors/file-handler.js +18 -17
  724. package/dist/processors/index.d.ts +3 -0
  725. package/dist/processors/index.js +12 -1
  726. package/dist/processors/types.d.ts +21 -0
  727. package/dist/processors/types.js +6 -0
  728. package/dist/reducers/combined-updaters.d.ts +52 -0
  729. package/dist/reducers/combined-updaters.js +3 -7
  730. package/dist/reducers/composer-helpers.d.ts +21 -0
  731. package/dist/reducers/composer-helpers.js +7 -7
  732. package/dist/reducers/composers.d.ts +12 -0
  733. package/dist/reducers/composers.js +2 -2
  734. package/dist/reducers/core.d.ts +65 -0
  735. package/dist/reducers/core.js +2 -6
  736. package/dist/reducers/index.d.ts +19 -0
  737. package/dist/reducers/index.js +14 -2
  738. package/dist/reducers/map-state-updaters.d.ts +96 -0
  739. package/dist/reducers/map-state-updaters.js +4 -11
  740. package/dist/reducers/map-state.d.ts +4 -0
  741. package/dist/reducers/map-state.js +3 -3
  742. package/dist/reducers/map-style-updaters.d.ts +204 -0
  743. package/dist/reducers/map-style-updaters.js +23 -37
  744. package/dist/reducers/map-style.d.ts +16 -0
  745. package/dist/reducers/map-style.js +3 -3
  746. package/dist/reducers/provider-state-updaters.d.ts +41 -0
  747. package/dist/reducers/provider-state-updaters.js +27 -72
  748. package/dist/reducers/provider-state.d.ts +4 -0
  749. package/dist/reducers/provider-state.js +3 -3
  750. package/dist/reducers/root.d.ts +24 -0
  751. package/dist/reducers/root.js +4 -4
  752. package/dist/reducers/types.d.ts +16 -0
  753. package/dist/reducers/types.js +6 -0
  754. package/dist/reducers/ui-state-updaters.d.ts +434 -0
  755. package/dist/reducers/ui-state-updaters.js +27 -38
  756. package/dist/reducers/ui-state.d.ts +3 -0
  757. package/dist/reducers/ui-state.js +5 -4
  758. package/dist/reducers/vis-state-merger.d.ts +110 -0
  759. package/dist/reducers/vis-state-merger.js +47 -43
  760. package/dist/reducers/vis-state-selectors.d.ts +10 -0
  761. package/dist/reducers/vis-state-selectors.js +1 -1
  762. package/dist/reducers/vis-state-updaters.d.ts +645 -0
  763. package/dist/reducers/vis-state-updaters.js +72 -126
  764. package/dist/reducers/vis-state.d.ts +4 -0
  765. package/dist/reducers/vis-state.js +4 -4
  766. package/dist/schemas/dataset-schema.d.ts +17 -0
  767. package/dist/schemas/dataset-schema.js +9 -12
  768. package/dist/schemas/index.d.ts +8 -0
  769. package/dist/schemas/index.js +2 -2
  770. package/dist/schemas/map-state-schema.d.ts +23 -0
  771. package/dist/schemas/map-state-schema.js +1 -1
  772. package/dist/schemas/map-style-schema.d.ts +38 -0
  773. package/dist/schemas/map-style-schema.js +5 -7
  774. package/dist/schemas/schema-manager.d.ts +271 -0
  775. package/dist/schemas/schema-manager.js +7 -5
  776. package/dist/schemas/schema-utils.d.ts +11 -0
  777. package/dist/schemas/schema-utils.js +1 -1
  778. package/dist/schemas/schema.d.ts +37 -0
  779. package/dist/schemas/schema.js +4 -4
  780. package/dist/schemas/versions.d.ts +5 -0
  781. package/dist/schemas/versions.js +1 -1
  782. package/dist/schemas/vis-state-schema.d.ts +214 -0
  783. package/dist/schemas/vis-state-schema.js +57 -77
  784. package/dist/styles/base.d.ts +1530 -0
  785. package/dist/styles/base.js +8 -4
  786. package/dist/styles/index.d.ts +2 -0
  787. package/dist/styles/index.js +1 -1
  788. package/dist/styles/media-breakpoints.d.ts +13 -0
  789. package/dist/styles/media-breakpoints.js +26 -7
  790. package/dist/tasks/tasks.d.ts +15 -0
  791. package/dist/tasks/tasks.js +12 -12
  792. package/dist/templates/export-map-html.d.ts +9 -0
  793. package/dist/templates/export-map-html.js +1 -1
  794. package/dist/utils/aggregate-utils.d.ts +3 -0
  795. package/dist/utils/aggregate-utils.js +1 -1
  796. package/dist/utils/color-utils.d.ts +44 -0
  797. package/dist/utils/color-utils.js +24 -9
  798. package/dist/utils/custom-scales.js +1 -1
  799. package/dist/utils/data-scale-utils.d.ts +23 -0
  800. package/dist/utils/data-scale-utils.js +1 -6
  801. package/dist/utils/data-utils.d.ts +115 -0
  802. package/dist/utils/data-utils.js +18 -39
  803. package/dist/utils/dataset-utils.d.ts +38 -0
  804. package/dist/utils/dataset-utils.js +4 -5
  805. package/dist/utils/dom-to-image.d.ts +73 -0
  806. package/dist/utils/dom-to-image.js +5 -5
  807. package/dist/utils/dom-utils.d.ts +20 -0
  808. package/dist/utils/dom-utils.js +1 -1
  809. package/dist/utils/export-utils.d.ts +56 -0
  810. package/dist/utils/export-utils.js +31 -25
  811. package/dist/utils/filter-utils.d.ts +267 -0
  812. package/dist/utils/filter-utils.js +40 -95
  813. package/dist/utils/gl-utils.d.ts +1 -0
  814. package/dist/utils/gl-utils.js +1 -1
  815. package/dist/utils/gpu-filter-utils.d.ts +28 -0
  816. package/dist/utils/gpu-filter-utils.js +13 -20
  817. package/dist/utils/index.d.ts +22 -0
  818. package/dist/utils/index.js +136 -38
  819. package/dist/utils/interaction-utils.d.ts +36 -0
  820. package/dist/utils/interaction-utils.js +10 -17
  821. package/dist/utils/layer-utils.d.ts +54 -0
  822. package/dist/utils/layer-utils.js +2 -3
  823. package/dist/utils/locale-utils.d.ts +2 -0
  824. package/dist/utils/locale-utils.js +5 -5
  825. package/dist/utils/map-info-utils.d.ts +1 -0
  826. package/dist/utils/map-info-utils.js +1 -1
  827. package/dist/utils/map-style-utils/mapbox-gl-style-editor.d.ts +64 -0
  828. package/dist/utils/map-style-utils/mapbox-gl-style-editor.js +18 -18
  829. package/dist/utils/map-style-utils/mapbox-utils.d.ts +3 -0
  830. package/dist/utils/map-style-utils/mapbox-utils.js +1 -1
  831. package/dist/utils/mapbox-utils.d.ts +7 -0
  832. package/dist/utils/mapbox-utils.js +1 -1
  833. package/dist/utils/notifications-utils.d.ts +54 -0
  834. package/dist/utils/notifications-utils.js +8 -8
  835. package/dist/utils/observe-dimensions.d.ts +15 -0
  836. package/dist/utils/observe-dimensions.js +8 -8
  837. package/dist/utils/projection-utils.d.ts +12 -0
  838. package/dist/utils/projection-utils.js +1 -1
  839. package/dist/utils/searcher-utils.d.ts +1 -0
  840. package/dist/utils/searcher-utils.js +1 -1
  841. package/dist/utils/split-map-utils.d.ts +29 -0
  842. package/dist/utils/split-map-utils.js +4 -4
  843. package/dist/utils/table-utils/data-container-interface.d.ts +115 -0
  844. package/dist/utils/table-utils/data-container-interface.js +6 -0
  845. package/dist/utils/table-utils/data-container-utils.d.ts +29 -0
  846. package/dist/utils/table-utils/data-container-utils.js +18 -7
  847. package/dist/utils/table-utils/data-row.d.ts +59 -0
  848. package/dist/utils/table-utils/data-row.js +61 -8
  849. package/dist/utils/table-utils/index.d.ts +1 -0
  850. package/dist/utils/table-utils/index.js +1 -1
  851. package/dist/utils/table-utils/indexed-data-container.d.ts +34 -0
  852. package/dist/utils/table-utils/indexed-data-container.js +18 -12
  853. package/dist/utils/table-utils/kepler-table.d.ts +168 -0
  854. package/dist/utils/table-utils/kepler-table.js +56 -22
  855. package/dist/utils/table-utils/row-data-container.d.ts +31 -0
  856. package/dist/utils/table-utils/row-data-container.js +11 -8
  857. package/dist/utils/utils.d.ts +98 -0
  858. package/dist/utils/utils.js +28 -4
  859. package/package.json +139 -60
  860. package/src/actions/action-wrapper.ts +183 -0
  861. package/src/actions/actions.ts +259 -0
  862. package/src/actions/identity-actions.ts +116 -0
  863. package/src/actions/map-state-actions.ts +116 -0
  864. package/src/actions/map-style-actions.ts +243 -0
  865. package/src/actions/provider-actions.ts +218 -0
  866. package/src/actions/ui-state-actions.ts +490 -0
  867. package/src/actions/vis-state-actions.ts +1279 -0
  868. package/src/cloud-providers/index.ts +22 -0
  869. package/src/cloud-providers/provider.ts +276 -0
  870. package/src/components/bottom-widget.tsx +277 -0
  871. package/src/components/common/action-panel.tsx +207 -0
  872. package/src/components/common/animation-control/animation-control.tsx +157 -0
  873. package/src/components/common/animation-control/animation-controller.ts +250 -0
  874. package/src/components/common/animation-control/animation-speed-slider.tsx +86 -0
  875. package/src/components/common/animation-control/floating-time-display.tsx +209 -0
  876. package/src/components/common/animation-control/playback-controls.tsx +316 -0
  877. package/src/components/common/animation-control/speed-control.tsx +71 -0
  878. package/src/components/common/checkbox.tsx +137 -0
  879. package/src/components/common/color-legend.tsx +203 -0
  880. package/src/components/common/data-table/button.tsx +54 -0
  881. package/src/components/common/data-table/cell-size.ts +185 -0
  882. package/src/components/common/data-table/grid.tsx +57 -0
  883. package/src/components/common/data-table/index.tsx +693 -0
  884. package/src/components/common/data-table/option-dropdown.tsx +122 -0
  885. package/src/components/common/dataset-label.tsx +48 -0
  886. package/src/components/common/error-boundary.tsx +47 -0
  887. package/src/components/common/field-selector.tsx +242 -0
  888. package/src/components/common/field-token.tsx +60 -0
  889. package/src/components/common/file-uploader/file-drop.tsx +209 -0
  890. package/src/components/common/file-uploader/file-upload-progress.tsx +123 -0
  891. package/src/components/common/file-uploader/file-upload.tsx +319 -0
  892. package/src/components/common/file-uploader/upload-button.tsx +89 -0
  893. package/src/components/common/histogram-plot.tsx +125 -0
  894. package/src/components/common/icons/add.tsx +37 -0
  895. package/src/components/common/icons/anchor_window.tsx +49 -0
  896. package/src/components/common/icons/arrow-down-alt.tsx +37 -0
  897. package/src/components/common/icons/arrow-down-solid.tsx +37 -0
  898. package/src/components/common/icons/arrow-down.tsx +40 -0
  899. package/src/components/common/icons/arrow-left.tsx +42 -0
  900. package/src/components/common/icons/arrow-right.tsx +40 -0
  901. package/src/components/common/icons/arrow-up-alt.tsx +40 -0
  902. package/src/components/common/icons/arrow-up-solid.tsx +37 -0
  903. package/src/components/common/icons/arrow-up.tsx +40 -0
  904. package/src/components/common/icons/base.tsx +95 -0
  905. package/src/components/common/icons/bug.tsx +40 -0
  906. package/src/components/common/icons/cancel.tsx +37 -0
  907. package/src/components/common/icons/checkmark.tsx +39 -0
  908. package/src/components/common/icons/chevron-right.js +2 -2
  909. package/src/components/common/icons/clipboard.tsx +40 -0
  910. package/src/components/common/icons/clock.tsx +38 -0
  911. package/src/components/common/icons/close.tsx +43 -0
  912. package/src/components/common/icons/code-alt.tsx +37 -0
  913. package/src/components/common/icons/copy.tsx +38 -0
  914. package/src/components/common/icons/crosshairs.tsx +37 -0
  915. package/src/components/common/icons/cube-3d.tsx +39 -0
  916. package/src/components/common/icons/cursor-click.tsx +43 -0
  917. package/src/components/common/icons/data-table.tsx +40 -0
  918. package/src/components/common/icons/db.tsx +40 -0
  919. package/src/components/common/icons/delete.tsx +39 -0
  920. package/src/components/common/icons/docs.tsx +40 -0
  921. package/src/components/common/icons/drag-n-drop.tsx +38 -0
  922. package/src/components/common/icons/draw-polygon.tsx +51 -0
  923. package/src/components/common/icons/email.tsx +39 -0
  924. package/src/components/common/icons/expand.tsx +39 -0
  925. package/src/components/common/icons/eye-seen.tsx +38 -0
  926. package/src/components/common/icons/eye-unseen.tsx +38 -0
  927. package/src/components/common/icons/file-type.tsx +71 -0
  928. package/src/components/common/icons/file.tsx +37 -0
  929. package/src/components/common/icons/files.tsx +37 -0
  930. package/src/components/common/icons/filter-funnel.tsx +37 -0
  931. package/src/components/common/icons/free-window.tsx +48 -0
  932. package/src/components/common/icons/gear.tsx +40 -0
  933. package/src/components/common/icons/hash.tsx +37 -0
  934. package/src/components/common/icons/histogram.tsx +42 -0
  935. package/src/components/common/icons/index.tsx +98 -0
  936. package/src/components/common/icons/info.tsx +48 -0
  937. package/src/components/common/icons/layers.tsx +37 -0
  938. package/src/components/common/icons/left-arrow.tsx +37 -0
  939. package/src/components/common/icons/legend.tsx +37 -0
  940. package/src/components/common/icons/line-chart.tsx +40 -0
  941. package/src/components/common/icons/login.tsx +41 -0
  942. package/src/components/common/icons/logout.tsx +38 -0
  943. package/src/components/common/icons/map-icon.tsx +62 -0
  944. package/src/components/common/icons/map.tsx +62 -0
  945. package/src/components/common/icons/messages.tsx +37 -0
  946. package/src/components/common/icons/minus.tsx +39 -0
  947. package/src/components/common/icons/order-by-dataset.tsx +49 -0
  948. package/src/components/common/icons/order-by-list.tsx +39 -0
  949. package/src/components/common/icons/pause.tsx +37 -0
  950. package/src/components/common/icons/picture.tsx +37 -0
  951. package/src/components/common/icons/pin.tsx +42 -0
  952. package/src/components/common/icons/play.tsx +37 -0
  953. package/src/components/common/icons/polygon.tsx +65 -0
  954. package/src/components/common/icons/rectangle.tsx +66 -0
  955. package/src/components/common/icons/reduce.tsx +42 -0
  956. package/src/components/common/icons/reset.tsx +37 -0
  957. package/src/components/common/icons/rocket.tsx +37 -0
  958. package/src/components/common/icons/save.tsx +38 -0
  959. package/src/components/common/icons/save2.tsx +42 -0
  960. package/src/components/common/icons/search.tsx +38 -0
  961. package/src/components/common/icons/settings.tsx +39 -0
  962. package/src/components/common/icons/share.tsx +37 -0
  963. package/src/components/common/icons/split.tsx +57 -0
  964. package/src/components/common/icons/square-select.tsx +38 -0
  965. package/src/components/common/icons/swap-horizontal.js +1 -1
  966. package/src/components/common/icons/table.tsx +41 -0
  967. package/src/components/common/icons/trash.tsx +45 -0
  968. package/src/components/common/icons/upload.tsx +37 -0
  969. package/src/components/common/icons/vert-dots.tsx +44 -0
  970. package/src/components/common/icons/vert-three-dots.tsx +39 -0
  971. package/src/components/common/icons/warning.tsx +40 -0
  972. package/src/components/common/image-preview.tsx +118 -0
  973. package/src/components/common/info-helper.tsx +91 -0
  974. package/src/components/common/item-selector/accessor.ts +45 -0
  975. package/src/components/common/item-selector/chickleted-input.tsx +153 -0
  976. package/src/components/common/item-selector/dropdown-list.tsx +269 -0
  977. package/src/components/common/item-selector/item-selector-submenu.js +2 -1
  978. package/src/components/common/item-selector/item-selector.d.ts +24 -27
  979. package/src/components/common/item-selector/item-selector.tsx +373 -0
  980. package/src/components/common/item-selector/typeahead.tsx +533 -0
  981. package/src/components/common/line-chart.tsx +170 -0
  982. package/src/components/common/loading-spinner.tsx +75 -0
  983. package/src/components/common/logo.tsx +88 -0
  984. package/src/components/common/map-layer-selector.tsx +64 -0
  985. package/src/components/common/modal.tsx +238 -0
  986. package/src/components/common/portaled.tsx +311 -0
  987. package/src/components/common/progress-bar.tsx +74 -0
  988. package/src/components/common/range-brush.tsx +276 -0
  989. package/src/components/common/range-plot.tsx +145 -0
  990. package/src/components/common/range-slider.tsx +320 -0
  991. package/src/components/common/slider/mouse-event.ts +122 -0
  992. package/src/components/common/slider/slider-bar-handle.tsx +106 -0
  993. package/src/components/common/slider/slider-handle.tsx +210 -0
  994. package/src/components/common/slider/slider.tsx +234 -0
  995. package/src/components/common/styled-components.tsx +714 -0
  996. package/src/components/common/switch.tsx +47 -0
  997. package/src/components/common/time-range-slider-time-title.tsx +87 -0
  998. package/src/components/common/time-range-slider.tsx +171 -0
  999. package/src/components/common/time-slider-marker.tsx +187 -0
  1000. package/src/components/common/tippy-tooltip.tsx +130 -0
  1001. package/src/components/common/toolbar-item.tsx +99 -0
  1002. package/src/components/common/toolbar.tsx +49 -0
  1003. package/src/components/common/vertical-toolbar.tsx +35 -0
  1004. package/src/components/container.d.ts +8 -0
  1005. package/src/components/container.tsx +189 -0
  1006. package/src/components/context.ts +32 -0
  1007. package/src/components/editor/editor.tsx +234 -0
  1008. package/src/components/editor/feature-action-panel.tsx +155 -0
  1009. package/src/components/editor/feature-styles.ts +76 -0
  1010. package/src/components/editor/handle-style.ts +89 -0
  1011. package/src/components/filters/filter-panels/filter-panel-with-field-select.tsx +118 -0
  1012. package/src/components/filters/filter-panels/multi-select-filter-panel.tsx +63 -0
  1013. package/src/components/filters/filter-panels/new-filter-panel.tsx +100 -0
  1014. package/src/components/filters/filter-panels/polygon-filter-panel.tsx +84 -0
  1015. package/src/components/filters/filter-panels/range-filter-panel.tsx +63 -0
  1016. package/src/components/filters/filter-panels/single-select-filter-panel.tsx +63 -0
  1017. package/src/components/filters/filter-panels/time-range-filter-panel.tsx +92 -0
  1018. package/src/components/filters/filter-panels/types.ts +40 -0
  1019. package/src/components/filters/multi-select-filter.tsx +37 -0
  1020. package/src/components/filters/polygon-filter.tsx +74 -0
  1021. package/src/components/filters/range-filter.tsx +44 -0
  1022. package/src/components/filters/single-select-filter.tsx +50 -0
  1023. package/src/components/filters/time-range-filter.tsx +76 -0
  1024. package/src/components/filters/time-widget.tsx +240 -0
  1025. package/src/components/filters/types.ts +78 -0
  1026. package/src/components/geocoder/geocoder.tsx +307 -0
  1027. package/src/components/geocoder-panel.tsx +199 -0
  1028. package/src/components/index.ts +269 -0
  1029. package/src/components/injector.d.ts +33 -0
  1030. package/src/components/injector.tsx +171 -0
  1031. package/src/components/kepler-gl.d.ts +1 -2
  1032. package/src/components/kepler-gl.tsx +585 -0
  1033. package/src/components/map/coordinate-info.tsx +58 -0
  1034. package/src/components/map/layer-hover-info.tsx +192 -0
  1035. package/src/components/map/layer-selector-panel.tsx +122 -0
  1036. package/src/components/map/locale-panel.tsx +110 -0
  1037. package/src/components/map/map-control-panel.tsx +142 -0
  1038. package/src/components/map/map-control-tooltip.tsx +45 -0
  1039. package/src/components/map/map-control.tsx +138 -0
  1040. package/src/components/map/map-draw-panel.tsx +145 -0
  1041. package/src/components/map/map-legend-panel.tsx +167 -0
  1042. package/src/components/map/map-legend.tsx +284 -0
  1043. package/src/components/map/map-popover.tsx +268 -0
  1044. package/src/components/map/split-map-button.tsx +98 -0
  1045. package/src/components/map/toggle-3d-button.tsx +90 -0
  1046. package/src/components/map-container.tsx +549 -0
  1047. package/src/components/maps-layout.tsx +45 -0
  1048. package/src/components/modal-container.tsx +555 -0
  1049. package/src/components/modals/add-map-style-modal.tsx +304 -0
  1050. package/src/components/modals/cloud-tile.tsx +181 -0
  1051. package/src/components/modals/data-table-modal.tsx +241 -0
  1052. package/src/components/modals/delete-data-modal.tsx +55 -0
  1053. package/src/components/modals/error-display.tsx +43 -0
  1054. package/src/components/modals/export-data-modal.tsx +201 -0
  1055. package/src/components/modals/export-image-modal.tsx +155 -0
  1056. package/src/components/modals/export-map-modal/export-html-map.tsx +164 -0
  1057. package/src/components/modals/export-map-modal/export-json-map.tsx +112 -0
  1058. package/src/components/modals/export-map-modal/export-map-modal.tsx +109 -0
  1059. package/src/components/modals/image-modal-container.tsx +86 -0
  1060. package/src/components/modals/load-data-modal.tsx +120 -0
  1061. package/src/components/modals/load-storage-map.tsx +414 -0
  1062. package/src/components/modals/loading-dialog.tsx +77 -0
  1063. package/src/components/modals/modal-tabs.tsx +137 -0
  1064. package/src/components/modals/overwrite-map-modal.tsx +113 -0
  1065. package/src/components/modals/provider-modal-container.tsx +62 -0
  1066. package/src/components/modals/save-map-modal.tsx +277 -0
  1067. package/src/components/modals/share-map-modal.tsx +217 -0
  1068. package/src/components/modals/status-panel.tsx +106 -0
  1069. package/src/components/modals/storage-map-viewer.tsx +190 -0
  1070. package/src/components/notification-panel/notification-item.tsx +143 -0
  1071. package/src/components/notification-panel.tsx +75 -0
  1072. package/src/components/performance.tsx +105 -0
  1073. package/src/components/plot-container.tsx +243 -0
  1074. package/src/components/side-panel/common/dataset-info.tsx +46 -0
  1075. package/src/components/side-panel/common/dataset-tag.tsx +86 -0
  1076. package/src/components/side-panel/common/dataset-title.tsx +187 -0
  1077. package/src/components/side-panel/common/source-data-catalog.tsx +67 -0
  1078. package/src/components/side-panel/common/source-data-selector.tsx +90 -0
  1079. package/src/components/side-panel/common/types.ts +76 -0
  1080. package/src/components/side-panel/filter-manager.tsx +120 -0
  1081. package/src/components/side-panel/filter-panel/filter-panel-header.tsx +96 -0
  1082. package/src/components/side-panel/filter-panel/filter-panel.tsx +125 -0
  1083. package/src/components/side-panel/interaction-manager.tsx +59 -0
  1084. package/src/components/side-panel/interaction-panel/brush-config.tsx +58 -0
  1085. package/src/components/side-panel/interaction-panel/interaction-panel.tsx +124 -0
  1086. package/src/components/side-panel/interaction-panel/tooltip-config/tooltip-chicklet.tsx +243 -0
  1087. package/src/components/side-panel/interaction-panel/tooltip-config.tsx +238 -0
  1088. package/src/components/side-panel/layer-manager.tsx +242 -0
  1089. package/src/components/side-panel/layer-panel/add-layer-button.tsx +208 -0
  1090. package/src/components/side-panel/layer-panel/color-dimension-scale-selector.tsx +33 -0
  1091. package/src/components/side-panel/layer-panel/color-palette.tsx +98 -0
  1092. package/src/components/side-panel/layer-panel/color-range-selector.tsx +388 -0
  1093. package/src/components/side-panel/layer-panel/color-selector.tsx +200 -0
  1094. package/src/components/side-panel/layer-panel/column-selector.tsx +102 -0
  1095. package/src/components/side-panel/layer-panel/custom-markers-config-group.tsx +30 -0
  1096. package/src/components/side-panel/layer-panel/custom-palette.tsx +301 -0
  1097. package/src/components/side-panel/layer-panel/custom-picker.tsx +99 -0
  1098. package/src/components/side-panel/layer-panel/dataset-layer-group.tsx +99 -0
  1099. package/src/components/side-panel/layer-panel/dataset-layer-section.tsx +100 -0
  1100. package/src/components/side-panel/layer-panel/dataset-section.tsx +125 -0
  1101. package/src/components/side-panel/layer-panel/dimension-scale-selector.tsx +64 -0
  1102. package/src/components/side-panel/layer-panel/hex-column-config.tsx +53 -0
  1103. package/src/components/side-panel/layer-panel/layer-column-config.tsx +115 -0
  1104. package/src/components/side-panel/layer-panel/layer-config-group.tsx +259 -0
  1105. package/src/components/side-panel/layer-panel/layer-configurator.tsx +1419 -0
  1106. package/src/components/side-panel/layer-panel/layer-list.tsx +193 -0
  1107. package/src/components/side-panel/layer-panel/layer-panel-header.tsx +273 -0
  1108. package/src/components/side-panel/layer-panel/layer-panel.tsx +197 -0
  1109. package/src/components/side-panel/layer-panel/layer-type-dropdown-list.tsx +118 -0
  1110. package/src/components/side-panel/layer-panel/layer-type-list-item.tsx +92 -0
  1111. package/src/components/side-panel/layer-panel/layer-type-selector.tsx +115 -0
  1112. package/src/components/side-panel/layer-panel/layer-visibility-by-zoom.tsx +123 -0
  1113. package/src/components/side-panel/layer-panel/panel-view-list-toggle.tsx +132 -0
  1114. package/src/components/side-panel/layer-panel/single-color-palette.tsx +94 -0
  1115. package/src/components/side-panel/layer-panel/text-label-panel.tsx +189 -0
  1116. package/src/components/side-panel/layer-panel/vis-config-by-field-selector.tsx +187 -0
  1117. package/src/components/side-panel/layer-panel/vis-config-slider.tsx +237 -0
  1118. package/src/components/side-panel/layer-panel/vis-config-switch.tsx +86 -0
  1119. package/src/components/side-panel/map-manager.tsx +123 -0
  1120. package/src/components/side-panel/map-style-panel/map-layer-selector.tsx +145 -0
  1121. package/src/components/side-panel/map-style-panel/map-style-selector.tsx +122 -0
  1122. package/src/components/side-panel/panel-dropdown.tsx +54 -0
  1123. package/src/components/side-panel/panel-header-action.tsx +114 -0
  1124. package/src/components/side-panel/panel-header.tsx +386 -0
  1125. package/src/components/side-panel/panel-tab.tsx +79 -0
  1126. package/src/components/side-panel/panel-title.tsx +35 -0
  1127. package/src/components/side-panel/panel-toggle.tsx +72 -0
  1128. package/src/components/side-panel/side-bar.tsx +141 -0
  1129. package/src/components/side-panel.tsx +261 -0
  1130. package/src/components/types.ts +41 -0
  1131. package/src/connect/keplergl-connect.ts +48 -0
  1132. package/src/connect/with-local-selector.tsx +70 -0
  1133. package/src/constants/action-types.ts +188 -0
  1134. package/src/constants/color-ranges.ts +87 -0
  1135. package/src/constants/default-settings.ts +1051 -0
  1136. package/src/deckgl-layers/3d-building-layer/3d-building-layer.ts +63 -0
  1137. package/src/deckgl-layers/3d-building-layer/3d-building-utils.ts +211 -0
  1138. package/src/deckgl-layers/3d-building-layer/types.ts +29 -0
  1139. package/src/deckgl-layers/column-layer/enhanced-column-layer.ts +63 -0
  1140. package/src/deckgl-layers/grid-layer/enhanced-cpu-grid-layer.ts +70 -0
  1141. package/src/deckgl-layers/hexagon-layer/enhanced-hexagon-layer.ts +70 -0
  1142. package/src/deckgl-layers/layer-utils/cluster-utils.ts +78 -0
  1143. package/src/deckgl-layers/layer-utils/cpu-aggregator.ts +671 -0
  1144. package/src/deckgl-layers/layer-utils/shader-utils.ts +41 -0
  1145. package/src/deckgl-layers/line-layer/line-layer.ts +126 -0
  1146. package/src/deckgl-layers/svg-icon-layer/scatterplot-icon-layer.ts +68 -0
  1147. package/src/deckgl-layers/svg-icon-layer/svg-icon-layer.ts +102 -0
  1148. package/src/index.ts +52 -0
  1149. package/src/layers/aggregation-layer.ts +400 -0
  1150. package/src/layers/arc-layer/arc-layer-icon.tsx +67 -0
  1151. package/src/layers/arc-layer/arc-layer.ts +294 -0
  1152. package/src/layers/base-layer.ts +1744 -0
  1153. package/src/layers/cluster-layer/cluster-layer.ts +162 -0
  1154. package/src/layers/geojson-layer/geojson-layer-icon.tsx +68 -0
  1155. package/src/layers/geojson-layer/geojson-layer.ts +462 -0
  1156. package/src/layers/geojson-layer/geojson-utils.ts +200 -0
  1157. package/src/layers/grid-layer/grid-layer-icon.tsx +53 -0
  1158. package/src/layers/grid-layer/grid-layer.ts +154 -0
  1159. package/src/layers/grid-layer/grid-utils.ts +84 -0
  1160. package/src/layers/h3-hexagon-layer/h3-hexagon-layer.ts +340 -0
  1161. package/src/layers/h3-hexagon-layer/h3-utils.ts +67 -0
  1162. package/src/layers/heatmap-layer/heatmap-layer.ts +255 -0
  1163. package/src/layers/hexagon-layer/hexagon-layer.ts +157 -0
  1164. package/src/layers/hexagon-layer/hexagon-utils.ts +64 -0
  1165. package/src/layers/icon-layer/icon-info-modal.tsx +155 -0
  1166. package/src/layers/icon-layer/icon-layer.ts +396 -0
  1167. package/src/layers/index.ts +81 -0
  1168. package/src/layers/layer-factory.ts +707 -0
  1169. package/src/layers/layer-text-label.ts +62 -0
  1170. package/src/layers/layer-update.ts +70 -0
  1171. package/src/layers/line-layer/line-layer.ts +223 -0
  1172. package/src/layers/mapbox-utils.ts +204 -0
  1173. package/src/layers/mapboxgl-layer.ts +176 -0
  1174. package/src/layers/point-layer/point-layer.ts +507 -0
  1175. package/src/layers/s2-geometry-layer/s2-geometry-layer.ts +369 -0
  1176. package/src/layers/s2-geometry-layer/s2-utils.ts +42 -0
  1177. package/src/layers/scenegraph-layer/scenegraph-layer.ts +237 -0
  1178. package/src/layers/trip-layer/trip-layer.ts +356 -0
  1179. package/src/layers/trip-layer/trip-utils.ts +177 -0
  1180. package/src/localization/formatted-message.tsx +42 -0
  1181. package/src/localization/index.ts +29 -0
  1182. package/src/localization/locales.ts +53 -0
  1183. package/src/localization/messages.ts +40 -0
  1184. package/src/localization/translations/ca.ts +476 -0
  1185. package/src/localization/translations/cn.ts +477 -0
  1186. package/src/localization/translations/en.ts +504 -0
  1187. package/src/localization/translations/es.ts +477 -0
  1188. package/src/localization/translations/fi.ts +448 -0
  1189. package/src/localization/translations/ja.ts +477 -0
  1190. package/src/localization/translations/pt.ts +449 -0
  1191. package/src/localization/translations/ru.ts +488 -0
  1192. package/src/middleware/index.ts +35 -0
  1193. package/src/processors/data-processor.ts +723 -0
  1194. package/src/processors/file-handler.ts +250 -0
  1195. package/src/processors/index.ts +23 -0
  1196. package/src/processors/types.ts +22 -0
  1197. package/src/reducers/combined-updaters.ts +215 -0
  1198. package/src/reducers/composer-helpers.ts +75 -0
  1199. package/src/reducers/core.ts +111 -0
  1200. package/src/reducers/index.ts +116 -0
  1201. package/src/reducers/map-state-updaters.ts +271 -0
  1202. package/src/reducers/map-state.ts +47 -0
  1203. package/src/reducers/map-style-updaters.ts +638 -0
  1204. package/src/reducers/map-style.ts +53 -0
  1205. package/src/reducers/provider-state-updaters.ts +454 -0
  1206. package/src/reducers/provider-state.ts +53 -0
  1207. package/src/reducers/root.ts +230 -0
  1208. package/src/reducers/types.ts +18 -0
  1209. package/src/reducers/ui-state-updaters.ts +925 -0
  1210. package/src/reducers/ui-state.ts +75 -0
  1211. package/src/reducers/vis-state-merger.ts +625 -0
  1212. package/src/reducers/vis-state-selectors.ts +35 -0
  1213. package/src/reducers/vis-state-updaters.ts +2567 -0
  1214. package/src/reducers/vis-state.ts +157 -0
  1215. package/src/schemas/dataset-schema.ts +141 -0
  1216. package/src/schemas/index.ts +52 -0
  1217. package/src/schemas/schema-manager.ts +445 -0
  1218. package/src/schemas/schema.ts +122 -0
  1219. package/src/schemas/vis-state-schema.ts +761 -0
  1220. package/src/styles/base.ts +1642 -0
  1221. package/src/styles/media-breakpoints.ts +56 -0
  1222. package/src/tasks/tasks.ts +92 -0
  1223. package/src/typedefs/deckgl.d.ts +25 -0
  1224. package/src/utils/aggregate-utils.ts +71 -0
  1225. package/src/utils/color-utils.ts +135 -0
  1226. package/src/utils/data-scale-utils.ts +73 -0
  1227. package/src/utils/data-utils.ts +459 -0
  1228. package/src/utils/dataset-utils.ts +261 -0
  1229. package/src/utils/dom-to-image.ts +533 -0
  1230. package/src/utils/dom-utils.ts +354 -0
  1231. package/src/utils/export-utils.ts +265 -0
  1232. package/src/utils/filter-utils.ts +1181 -0
  1233. package/src/utils/gpu-filter-utils.ts +249 -0
  1234. package/src/utils/index.ts +72 -0
  1235. package/src/utils/interaction-utils.ts +212 -0
  1236. package/src/utils/layer-utils.ts +248 -0
  1237. package/src/utils/map-style-utils/mapbox-gl-style-editor.ts +227 -0
  1238. package/src/utils/notifications-utils.ts +89 -0
  1239. package/src/utils/observe-dimensions.ts +127 -0
  1240. package/src/utils/split-map-utils.ts +104 -0
  1241. package/src/utils/table-utils/data-container-interface.ts +140 -0
  1242. package/src/utils/table-utils/data-container-utils.ts +90 -0
  1243. package/src/utils/table-utils/data-row.ts +110 -0
  1244. package/src/utils/table-utils/indexed-data-container.ts +184 -0
  1245. package/src/utils/table-utils/kepler-table.ts +638 -0
  1246. package/src/utils/table-utils/row-data-container.ts +178 -0
  1247. package/src/utils/utils.ts +228 -0
  1248. package/actions.js +0 -21
  1249. package/cloud-providers.js +0 -21
  1250. package/components.js +0 -21
  1251. package/constants.js +0 -21
  1252. package/dist/components/common/icons/arrow-down-solid .js +0 -64
  1253. package/dist/localization/en.js +0 -494
  1254. package/layers.js +0 -21
  1255. package/localization.js +0 -21
  1256. package/middleware.js +0 -21
  1257. package/processors.js +0 -21
  1258. package/reducers.js +0 -21
  1259. package/schemas.js +0 -21
  1260. package/src/actions/action-wrapper.js +0 -183
  1261. package/src/actions/actions.d.ts +0 -104
  1262. package/src/actions/actions.js +0 -178
  1263. package/src/actions/identity-actions.d.ts +0 -53
  1264. package/src/actions/identity-actions.js +0 -83
  1265. package/src/actions/index.d.ts +0 -23
  1266. package/src/actions/map-state-actions.d.ts +0 -46
  1267. package/src/actions/map-state-actions.js +0 -90
  1268. package/src/actions/map-style-actions.d.ts +0 -116
  1269. package/src/actions/map-style-actions.js +0 -135
  1270. package/src/actions/provider-actions.d.ts +0 -203
  1271. package/src/actions/provider-actions.js +0 -94
  1272. package/src/actions/ui-state-actions.d.ts +0 -200
  1273. package/src/actions/ui-state-actions.js +0 -272
  1274. package/src/actions/vis-state-actions.d.ts +0 -502
  1275. package/src/actions/vis-state-actions.js +0 -919
  1276. package/src/cloud-providers/index.d.ts +0 -53
  1277. package/src/cloud-providers/index.js +0 -21
  1278. package/src/cloud-providers/provider.js +0 -233
  1279. package/src/components/bottom-widget.d.ts +0 -33
  1280. package/src/components/bottom-widget.js +0 -235
  1281. package/src/components/common/action-panel.d.ts +0 -24
  1282. package/src/components/common/action-panel.js +0 -177
  1283. package/src/components/common/animation-control/animation-control.js +0 -155
  1284. package/src/components/common/animation-control/animation-controller.js +0 -224
  1285. package/src/components/common/animation-control/animation-speed-slider.js +0 -79
  1286. package/src/components/common/animation-control/floating-time-display.js +0 -192
  1287. package/src/components/common/animation-control/playback-controls.js +0 -278
  1288. package/src/components/common/animation-control/speed-control.js +0 -71
  1289. package/src/components/common/checkbox.js +0 -128
  1290. package/src/components/common/color-legend.js +0 -198
  1291. package/src/components/common/data-table/button.js +0 -47
  1292. package/src/components/common/data-table/cell-size.js +0 -180
  1293. package/src/components/common/data-table/grid.js +0 -55
  1294. package/src/components/common/data-table/index.js +0 -620
  1295. package/src/components/common/data-table/option-dropdown.js +0 -110
  1296. package/src/components/common/dataset-label.js +0 -40
  1297. package/src/components/common/error-boundary.js +0 -43
  1298. package/src/components/common/field-selector.js +0 -233
  1299. package/src/components/common/field-token.js +0 -56
  1300. package/src/components/common/file-uploader/file-drop.d.ts +0 -19
  1301. package/src/components/common/file-uploader/file-drop.js +0 -196
  1302. package/src/components/common/file-uploader/file-upload-progress.d.ts +0 -11
  1303. package/src/components/common/file-uploader/file-upload-progress.js +0 -110
  1304. package/src/components/common/file-uploader/file-upload.d.ts +0 -22
  1305. package/src/components/common/file-uploader/file-upload.js +0 -301
  1306. package/src/components/common/file-uploader/upload-button.d.ts.wip +0 -11
  1307. package/src/components/common/file-uploader/upload-button.js +0 -83
  1308. package/src/components/common/histogram-plot.js +0 -102
  1309. package/src/components/common/icons/add.js +0 -43
  1310. package/src/components/common/icons/anchor_window.js +0 -53
  1311. package/src/components/common/icons/arrow-down-alt.js +0 -43
  1312. package/src/components/common/icons/arrow-down-solid .js +0 -43
  1313. package/src/components/common/icons/arrow-down.js +0 -46
  1314. package/src/components/common/icons/arrow-left.js +0 -48
  1315. package/src/components/common/icons/arrow-right.js +0 -46
  1316. package/src/components/common/icons/arrow-up-alt.js +0 -46
  1317. package/src/components/common/icons/arrow-up-solid.js +0 -43
  1318. package/src/components/common/icons/arrow-up.js +0 -46
  1319. package/src/components/common/icons/base.js +0 -90
  1320. package/src/components/common/icons/bug.js +0 -46
  1321. package/src/components/common/icons/cancel.js +0 -43
  1322. package/src/components/common/icons/checkmark.js +0 -45
  1323. package/src/components/common/icons/clipboard.js +0 -46
  1324. package/src/components/common/icons/clock.js +0 -44
  1325. package/src/components/common/icons/close.js +0 -49
  1326. package/src/components/common/icons/code-alt.js +0 -43
  1327. package/src/components/common/icons/copy.js +0 -44
  1328. package/src/components/common/icons/crosshairs.js +0 -43
  1329. package/src/components/common/icons/cube-3d.js +0 -45
  1330. package/src/components/common/icons/cursor-click.js +0 -49
  1331. package/src/components/common/icons/data-table.js +0 -45
  1332. package/src/components/common/icons/db.js +0 -45
  1333. package/src/components/common/icons/delete.js +0 -44
  1334. package/src/components/common/icons/docs.js +0 -46
  1335. package/src/components/common/icons/drag-n-drop.js +0 -44
  1336. package/src/components/common/icons/draw-polygon.js +0 -60
  1337. package/src/components/common/icons/email.js +0 -45
  1338. package/src/components/common/icons/expand.js +0 -45
  1339. package/src/components/common/icons/eye-seen.js +0 -44
  1340. package/src/components/common/icons/eye-unseen.js +0 -44
  1341. package/src/components/common/icons/file-type.js +0 -57
  1342. package/src/components/common/icons/file.js +0 -43
  1343. package/src/components/common/icons/files.js +0 -42
  1344. package/src/components/common/icons/filter-funnel.js +0 -43
  1345. package/src/components/common/icons/free-window.js +0 -53
  1346. package/src/components/common/icons/gear.js +0 -45
  1347. package/src/components/common/icons/hash.js +0 -43
  1348. package/src/components/common/icons/histogram.js +0 -47
  1349. package/src/components/common/icons/index.js +0 -96
  1350. package/src/components/common/icons/info.js +0 -54
  1351. package/src/components/common/icons/layers.js +0 -43
  1352. package/src/components/common/icons/left-arrow.js +0 -43
  1353. package/src/components/common/icons/legend.js +0 -43
  1354. package/src/components/common/icons/line-chart.js +0 -45
  1355. package/src/components/common/icons/login.js +0 -46
  1356. package/src/components/common/icons/logout.js +0 -43
  1357. package/src/components/common/icons/map-icon.js +0 -69
  1358. package/src/components/common/icons/map.js +0 -69
  1359. package/src/components/common/icons/messages.js +0 -43
  1360. package/src/components/common/icons/minus.js +0 -45
  1361. package/src/components/common/icons/pause.js +0 -43
  1362. package/src/components/common/icons/picture.js +0 -43
  1363. package/src/components/common/icons/pin.js +0 -43
  1364. package/src/components/common/icons/play.js +0 -43
  1365. package/src/components/common/icons/polygon.js +0 -74
  1366. package/src/components/common/icons/rectangle.js +0 -75
  1367. package/src/components/common/icons/reduce.js +0 -48
  1368. package/src/components/common/icons/reset.js +0 -43
  1369. package/src/components/common/icons/rocket.js +0 -43
  1370. package/src/components/common/icons/save.js +0 -44
  1371. package/src/components/common/icons/save2.js +0 -47
  1372. package/src/components/common/icons/search.js +0 -44
  1373. package/src/components/common/icons/settings.js +0 -45
  1374. package/src/components/common/icons/share.js +0 -43
  1375. package/src/components/common/icons/split.js +0 -63
  1376. package/src/components/common/icons/square-select.js +0 -44
  1377. package/src/components/common/icons/table.js +0 -46
  1378. package/src/components/common/icons/trash.js +0 -51
  1379. package/src/components/common/icons/upload.js +0 -44
  1380. package/src/components/common/icons/vert-dots.js +0 -50
  1381. package/src/components/common/icons/vert-three-dots.js +0 -45
  1382. package/src/components/common/icons/warning.js +0 -46
  1383. package/src/components/common/image-preview.js +0 -111
  1384. package/src/components/common/info-helper.js +0 -84
  1385. package/src/components/common/item-selector/accessor.js +0 -45
  1386. package/src/components/common/item-selector/chickleted-input.js +0 -143
  1387. package/src/components/common/item-selector/dropdown-list.js +0 -258
  1388. package/src/components/common/item-selector/item-selector.js +0 -360
  1389. package/src/components/common/item-selector/typeahead.js +0 -507
  1390. package/src/components/common/line-chart.js +0 -134
  1391. package/src/components/common/loading-spinner.js +0 -64
  1392. package/src/components/common/logo.js +0 -92
  1393. package/src/components/common/map-layer-selector.d.ts +0 -10
  1394. package/src/components/common/map-layer-selector.js +0 -54
  1395. package/src/components/common/modal.js +0 -233
  1396. package/src/components/common/portaled.js +0 -264
  1397. package/src/components/common/progress-bar.d.ts +0 -13
  1398. package/src/components/common/progress-bar.js +0 -49
  1399. package/src/components/common/range-brush.js +0 -256
  1400. package/src/components/common/range-plot.js +0 -139
  1401. package/src/components/common/range-slider.js +0 -299
  1402. package/src/components/common/slider/mouse-event.js +0 -97
  1403. package/src/components/common/slider/slider-bar-handle.js +0 -97
  1404. package/src/components/common/slider/slider-handle.js +0 -181
  1405. package/src/components/common/slider/slider.js +0 -213
  1406. package/src/components/common/styled-components.js +0 -657
  1407. package/src/components/common/switch.js +0 -50
  1408. package/src/components/common/time-range-slider-time-title.js +0 -76
  1409. package/src/components/common/time-range-slider.js +0 -163
  1410. package/src/components/common/time-slider-marker.js +0 -168
  1411. package/src/components/common/toolbar-item.d.ts +0 -14
  1412. package/src/components/common/toolbar-item.js +0 -83
  1413. package/src/components/common/toolbar.js +0 -45
  1414. package/src/components/common/vertical-toolbar.js +0 -35
  1415. package/src/components/container.js +0 -173
  1416. package/src/components/context.d.ts +0 -10
  1417. package/src/components/context.js +0 -32
  1418. package/src/components/editor/editor.js +0 -218
  1419. package/src/components/editor/feature-action-panel.js +0 -143
  1420. package/src/components/editor/feature-styles.js +0 -75
  1421. package/src/components/editor/handle-style.js +0 -89
  1422. package/src/components/filters/filter-panels/filter-panel-types.d.ts +0 -28
  1423. package/src/components/filters/filter-panels/filter-panel-with-field-select.js +0 -124
  1424. package/src/components/filters/filter-panels/multi-select-filter-panel.js +0 -75
  1425. package/src/components/filters/filter-panels/new-filter-panel.js +0 -99
  1426. package/src/components/filters/filter-panels/polygon-filter-panel.js +0 -96
  1427. package/src/components/filters/filter-panels/range-filter-panel.js +0 -75
  1428. package/src/components/filters/filter-panels/single-select-filter-panel.js +0 -75
  1429. package/src/components/filters/filter-panels/time-range-filter-panel.js +0 -95
  1430. package/src/components/filters/multi-select-filter.js +0 -36
  1431. package/src/components/filters/polygon-filter.d.ts +0 -13
  1432. package/src/components/filters/polygon-filter.js +0 -73
  1433. package/src/components/filters/range-filter.js +0 -43
  1434. package/src/components/filters/single-select-filter.js +0 -49
  1435. package/src/components/filters/time-range-filter.js +0 -68
  1436. package/src/components/filters/time-widget.js +0 -228
  1437. package/src/components/geocoder/geocoder.d.ts +0 -33
  1438. package/src/components/geocoder/geocoder.js +0 -272
  1439. package/src/components/geocoder-panel.js +0 -191
  1440. package/src/components/index.js +0 -254
  1441. package/src/components/injector.js +0 -161
  1442. package/src/components/kepler-gl.js +0 -518
  1443. package/src/components/map/coordinate-info.js +0 -53
  1444. package/src/components/map/layer-hover-info.d.ts +0 -12
  1445. package/src/components/map/layer-hover-info.js +0 -185
  1446. package/src/components/map/layer-selector-panel.d.ts +0 -16
  1447. package/src/components/map/layer-selector-panel.js +0 -106
  1448. package/src/components/map/locale-panel.d.ts +0 -12
  1449. package/src/components/map/locale-panel.js +0 -91
  1450. package/src/components/map/map-control-panel.d.ts +0 -11
  1451. package/src/components/map/map-control-panel.js +0 -98
  1452. package/src/components/map/map-control-tooltip.d.ts +0 -8
  1453. package/src/components/map/map-control-tooltip.js +0 -40
  1454. package/src/components/map/map-control.d.ts +0 -37
  1455. package/src/components/map/map-control.js +0 -100
  1456. package/src/components/map/map-draw-panel.d.ts +0 -16
  1457. package/src/components/map/map-draw-panel.js +0 -125
  1458. package/src/components/map/map-legend-panel.d.ts +0 -20
  1459. package/src/components/map/map-legend-panel.js +0 -100
  1460. package/src/components/map/map-legend.d.ts +0 -58
  1461. package/src/components/map/map-legend.js +0 -228
  1462. package/src/components/map/map-popover.d.ts +0 -28
  1463. package/src/components/map/map-popover.js +0 -250
  1464. package/src/components/map/split-map-button.d.ts +0 -19
  1465. package/src/components/map/split-map-button.js +0 -82
  1466. package/src/components/map/toggle-3d-button.d.ts +0 -16
  1467. package/src/components/map/toggle-3d-button.js +0 -75
  1468. package/src/components/map-container.d.ts +0 -18
  1469. package/src/components/map-container.js +0 -499
  1470. package/src/components/maps-layout.d.ts +0 -5
  1471. package/src/components/maps-layout.js +0 -40
  1472. package/src/components/modal-container.d.ts +0 -37
  1473. package/src/components/modal-container.js +0 -543
  1474. package/src/components/modals/add-map-style-modal.js +0 -298
  1475. package/src/components/modals/cloud-tile.js +0 -147
  1476. package/src/components/modals/data-table-modal.js +0 -217
  1477. package/src/components/modals/delete-data-modal.js +0 -48
  1478. package/src/components/modals/error-display.js +0 -39
  1479. package/src/components/modals/export-data-modal.js +0 -193
  1480. package/src/components/modals/export-image-modal.d.ts +0 -21
  1481. package/src/components/modals/export-image-modal.js +0 -144
  1482. package/src/components/modals/export-map-modal/export-html-map.d.ts +0 -21
  1483. package/src/components/modals/export-map-modal/export-html-map.js +0 -145
  1484. package/src/components/modals/export-map-modal/export-json-map.js +0 -100
  1485. package/src/components/modals/export-map-modal/export-map-modal.js +0 -114
  1486. package/src/components/modals/image-modal-container.d.ts +0 -13
  1487. package/src/components/modals/image-modal-container.js +0 -76
  1488. package/src/components/modals/load-data-modal.d.ts +0 -30
  1489. package/src/components/modals/load-data-modal.js +0 -94
  1490. package/src/components/modals/load-storage-map.js +0 -381
  1491. package/src/components/modals/loading-dialog.js +0 -69
  1492. package/src/components/modals/modal-tabs.js +0 -126
  1493. package/src/components/modals/overwrite-map-modal.d.ts +0 -18
  1494. package/src/components/modals/overwrite-map-modal.js +0 -97
  1495. package/src/components/modals/provider-modal-container.d.ts +0 -12
  1496. package/src/components/modals/provider-modal-container.js +0 -60
  1497. package/src/components/modals/save-map-modal.d.ts +0 -32
  1498. package/src/components/modals/save-map-modal.js +0 -244
  1499. package/src/components/modals/share-map-modal.js +0 -208
  1500. package/src/components/modals/status-panel.js +0 -95
  1501. package/src/components/modals/storage-map-viewer.js +0 -177
  1502. package/src/components/notification-panel/notification-item.js +0 -132
  1503. package/src/components/notification-panel.js +0 -72
  1504. package/src/components/performance.js +0 -103
  1505. package/src/components/plot-container.js +0 -228
  1506. package/src/components/side-panel/common/dataset-info.js +0 -45
  1507. package/src/components/side-panel/common/dataset-tag.js +0 -55
  1508. package/src/components/side-panel/common/dataset-title.js +0 -146
  1509. package/src/components/side-panel/common/source-data-catalog.js +0 -61
  1510. package/src/components/side-panel/common/source-data-selector.js +0 -79
  1511. package/src/components/side-panel/filter-manager.js +0 -105
  1512. package/src/components/side-panel/filter-panel/filter-panel-header.js +0 -83
  1513. package/src/components/side-panel/filter-panel/filter-panel.js +0 -126
  1514. package/src/components/side-panel/interaction-manager.js +0 -46
  1515. package/src/components/side-panel/interaction-panel/brush-config.js +0 -51
  1516. package/src/components/side-panel/interaction-panel/interaction-panel.js +0 -115
  1517. package/src/components/side-panel/interaction-panel/tooltip-config/tooltip-chicklet.js +0 -199
  1518. package/src/components/side-panel/interaction-panel/tooltip-config.js +0 -190
  1519. package/src/components/side-panel/layer-manager.js +0 -290
  1520. package/src/components/side-panel/layer-panel/color-dimension-scale-selector.js +0 -33
  1521. package/src/components/side-panel/layer-panel/color-palette.js +0 -90
  1522. package/src/components/side-panel/layer-panel/color-range-selector.js +0 -359
  1523. package/src/components/side-panel/layer-panel/color-selector.js +0 -196
  1524. package/src/components/side-panel/layer-panel/column-selector.js +0 -70
  1525. package/src/components/side-panel/layer-panel/custom-markers-config-group.js +0 -30
  1526. package/src/components/side-panel/layer-panel/custom-palette.js +0 -296
  1527. package/src/components/side-panel/layer-panel/custom-picker.js +0 -88
  1528. package/src/components/side-panel/layer-panel/dimension-scale-selector.js +0 -48
  1529. package/src/components/side-panel/layer-panel/hex-column-config.js +0 -45
  1530. package/src/components/side-panel/layer-panel/layer-column-config.js +0 -113
  1531. package/src/components/side-panel/layer-panel/layer-config-group.js +0 -237
  1532. package/src/components/side-panel/layer-panel/layer-configurator.js +0 -1412
  1533. package/src/components/side-panel/layer-panel/layer-panel-header.js +0 -236
  1534. package/src/components/side-panel/layer-panel/layer-panel.js +0 -171
  1535. package/src/components/side-panel/layer-panel/layer-type-dropdown-list.js +0 -105
  1536. package/src/components/side-panel/layer-panel/layer-type-list-item.js +0 -83
  1537. package/src/components/side-panel/layer-panel/layer-type-selector.js +0 -89
  1538. package/src/components/side-panel/layer-panel/layer-visibility-by-zoom.js +0 -123
  1539. package/src/components/side-panel/layer-panel/single-color-palette.js +0 -98
  1540. package/src/components/side-panel/layer-panel/text-label-panel.js +0 -179
  1541. package/src/components/side-panel/layer-panel/vis-config-by-field-selector.js +0 -163
  1542. package/src/components/side-panel/layer-panel/vis-config-slider.js +0 -82
  1543. package/src/components/side-panel/layer-panel/vis-config-switch.js +0 -87
  1544. package/src/components/side-panel/map-manager.js +0 -114
  1545. package/src/components/side-panel/map-style-panel/map-layer-selector.js +0 -128
  1546. package/src/components/side-panel/map-style-panel/map-style-selector.js +0 -111
  1547. package/src/components/side-panel/panel-dropdown.js +0 -53
  1548. package/src/components/side-panel/panel-header-action.js +0 -106
  1549. package/src/components/side-panel/panel-header.js +0 -321
  1550. package/src/components/side-panel/panel-tab.js +0 -62
  1551. package/src/components/side-panel/panel-title.js +0 -32
  1552. package/src/components/side-panel/panel-toggle.js +0 -70
  1553. package/src/components/side-panel/side-bar.js +0 -136
  1554. package/src/components/side-panel.d.ts +0 -33
  1555. package/src/components/side-panel.js +0 -253
  1556. package/src/connect/keplergl-connect.js +0 -47
  1557. package/src/connect/with-local-selector.d.ts +0 -11
  1558. package/src/connect/with-local-selector.js +0 -67
  1559. package/src/constants/action-types.d.ts +0 -135
  1560. package/src/constants/action-types.js +0 -184
  1561. package/src/constants/color-ranges.js +0 -72
  1562. package/src/constants/default-settings.js +0 -994
  1563. package/src/deckgl-layers/3d-building-layer/3d-building-layer.js +0 -56
  1564. package/src/deckgl-layers/3d-building-layer/3d-building-utils.js +0 -192
  1565. package/src/deckgl-layers/column-layer/enhanced-column-layer.js +0 -63
  1566. package/src/deckgl-layers/grid-layer/enhanced-cpu-grid-layer.js +0 -70
  1567. package/src/deckgl-layers/hexagon-layer/enhanced-hexagon-layer.js +0 -70
  1568. package/src/deckgl-layers/layer-utils/cluster-utils.js +0 -76
  1569. package/src/deckgl-layers/layer-utils/cpu-aggregator.js +0 -583
  1570. package/src/deckgl-layers/layer-utils/shader-utils.js +0 -41
  1571. package/src/deckgl-layers/line-layer/line-layer.js +0 -122
  1572. package/src/deckgl-layers/svg-icon-layer/scatterplot-icon-layer.js +0 -57
  1573. package/src/deckgl-layers/svg-icon-layer/svg-icon-layer.js +0 -85
  1574. package/src/index.js +0 -52
  1575. package/src/layers/aggregation-layer.js +0 -356
  1576. package/src/layers/arc-layer/arc-layer-icon.js +0 -67
  1577. package/src/layers/arc-layer/arc-layer.js +0 -221
  1578. package/src/layers/base-layer.js +0 -1545
  1579. package/src/layers/cluster-layer/cluster-layer.js +0 -125
  1580. package/src/layers/geojson-layer/geojson-layer-icon.js +0 -68
  1581. package/src/layers/geojson-layer/geojson-layer.js +0 -344
  1582. package/src/layers/geojson-layer/geojson-utils.js +0 -179
  1583. package/src/layers/grid-layer/grid-layer-icon.js +0 -53
  1584. package/src/layers/grid-layer/grid-layer.js +0 -95
  1585. package/src/layers/grid-layer/grid-utils.js +0 -71
  1586. package/src/layers/h3-hexagon-layer/h3-hexagon-layer.js +0 -264
  1587. package/src/layers/h3-hexagon-layer/h3-utils.js +0 -65
  1588. package/src/layers/heatmap-layer/heatmap-layer.js +0 -226
  1589. package/src/layers/hexagon-layer/hexagon-layer.js +0 -95
  1590. package/src/layers/hexagon-layer/hexagon-utils.js +0 -63
  1591. package/src/layers/icon-layer/icon-info-modal.js +0 -155
  1592. package/src/layers/icon-layer/icon-layer.js +0 -324
  1593. package/src/layers/index.d.ts +0 -128
  1594. package/src/layers/index.js +0 -76
  1595. package/src/layers/layer-factory.d.ts +0 -149
  1596. package/src/layers/layer-factory.js +0 -487
  1597. package/src/layers/layer-text-label.js +0 -62
  1598. package/src/layers/layer-update.js +0 -71
  1599. package/src/layers/line-layer/line-layer.js +0 -161
  1600. package/src/layers/mapbox-utils.js +0 -195
  1601. package/src/layers/mapboxgl-layer.js +0 -154
  1602. package/src/layers/point-layer/point-layer.js +0 -412
  1603. package/src/layers/s2-geometry-layer/s2-geometry-layer.js +0 -265
  1604. package/src/layers/s2-geometry-layer/s2-utils.js +0 -36
  1605. package/src/layers/scenegraph-layer/scenegraph-layer.js +0 -182
  1606. package/src/layers/trip-layer/trip-layer.js +0 -295
  1607. package/src/layers/trip-layer/trip-utils.js +0 -169
  1608. package/src/localization/en.js +0 -504
  1609. package/src/localization/formatted-message.js +0 -33
  1610. package/src/localization/index.js +0 -32
  1611. package/src/localization/locales.js +0 -46
  1612. package/src/middleware/index.js +0 -34
  1613. package/src/processors/data-processor.d.ts +0 -57
  1614. package/src/processors/data-processor.js +0 -684
  1615. package/src/processors/file-handler.d.ts +0 -46
  1616. package/src/processors/file-handler.js +0 -220
  1617. package/src/processors/index.js +0 -22
  1618. package/src/reducers/combined-updaters.d.ts +0 -26
  1619. package/src/reducers/combined-updaters.js +0 -198
  1620. package/src/reducers/composer-helpers.d.ts +0 -32
  1621. package/src/reducers/composer-helpers.js +0 -70
  1622. package/src/reducers/core.d.ts +0 -25
  1623. package/src/reducers/core.js +0 -97
  1624. package/src/reducers/index.d.ts +0 -118
  1625. package/src/reducers/index.js +0 -53
  1626. package/src/reducers/map-state-updaters.d.ts +0 -64
  1627. package/src/reducers/map-state-updaters.js +0 -224
  1628. package/src/reducers/map-state.js +0 -47
  1629. package/src/reducers/map-style-updaters.d.ts +0 -76
  1630. package/src/reducers/map-style-updaters.js +0 -541
  1631. package/src/reducers/map-style.js +0 -53
  1632. package/src/reducers/provider-state-updaters.d.ts +0 -88
  1633. package/src/reducers/provider-state-updaters.js +0 -428
  1634. package/src/reducers/provider-state.js +0 -53
  1635. package/src/reducers/root.js +0 -230
  1636. package/src/reducers/types.d.ts +0 -10
  1637. package/src/reducers/ui-state-updaters.d.ts +0 -198
  1638. package/src/reducers/ui-state-updaters.js +0 -766
  1639. package/src/reducers/ui-state.js +0 -73
  1640. package/src/reducers/vis-state-merger.d.ts +0 -78
  1641. package/src/reducers/vis-state-merger.js +0 -557
  1642. package/src/reducers/vis-state-selectors.js +0 -35
  1643. package/src/reducers/vis-state-updaters.d.ts +0 -534
  1644. package/src/reducers/vis-state-updaters.js +0 -2137
  1645. package/src/reducers/vis-state.js +0 -155
  1646. package/src/schemas/dataset-schema.js +0 -141
  1647. package/src/schemas/index.d.ts +0 -24
  1648. package/src/schemas/index.js +0 -42
  1649. package/src/schemas/schema-manager.d.ts +0 -229
  1650. package/src/schemas/schema-manager.js +0 -228
  1651. package/src/schemas/schema.d.ts +0 -47
  1652. package/src/schemas/schema.js +0 -90
  1653. package/src/schemas/versions.d.ts +0 -23
  1654. package/src/schemas/vis-state-schema.js +0 -754
  1655. package/src/styles/base.js +0 -1620
  1656. package/src/styles/media-breakpoints.js +0 -47
  1657. package/src/tasks/tasks.js +0 -92
  1658. package/src/typedefs/README.md +0 -3
  1659. package/src/typedefs/deck.gl__core.d.ts +0 -64
  1660. package/src/typedefs/deck.gl__mesh-layers.d.ts +0 -33
  1661. package/src/utils/aggregate-utils.js +0 -71
  1662. package/src/utils/color-utils.js +0 -115
  1663. package/src/utils/data-scale-utils.d.ts +0 -26
  1664. package/src/utils/data-scale-utils.js +0 -61
  1665. package/src/utils/data-utils.d.ts +0 -46
  1666. package/src/utils/data-utils.js +0 -447
  1667. package/src/utils/dataset-utils.d.ts +0 -10
  1668. package/src/utils/dataset-utils.js +0 -255
  1669. package/src/utils/dom-to-image.js +0 -533
  1670. package/src/utils/dom-utils.js +0 -354
  1671. package/src/utils/export-utils.js +0 -247
  1672. package/src/utils/filter-utils.d.ts +0 -192
  1673. package/src/utils/filter-utils.js +0 -1114
  1674. package/src/utils/gpu-filter-utils.d.ts +0 -28
  1675. package/src/utils/gpu-filter-utils.js +0 -253
  1676. package/src/utils/index.d.ts +0 -5
  1677. package/src/utils/index.js +0 -57
  1678. package/src/utils/interaction-utils.d.ts +0 -36
  1679. package/src/utils/interaction-utils.js +0 -185
  1680. package/src/utils/layer-utils.d.ts +0 -78
  1681. package/src/utils/layer-utils.js +0 -206
  1682. package/src/utils/map-style-utils/mapbox-gl-style-editor.js +0 -201
  1683. package/src/utils/notifications-utils.js +0 -83
  1684. package/src/utils/observe-dimensions.d.ts +0 -18
  1685. package/src/utils/observe-dimensions.js +0 -115
  1686. package/src/utils/split-map-utils.js +0 -104
  1687. package/src/utils/table-utils/data-container-interface.d.ts +0 -140
  1688. package/src/utils/table-utils/data-container-utils.d.ts +0 -43
  1689. package/src/utils/table-utils/data-container-utils.js +0 -61
  1690. package/src/utils/table-utils/data-row.d.ts +0 -65
  1691. package/src/utils/table-utils/data-row.js +0 -54
  1692. package/src/utils/table-utils/index.d.ts +0 -1
  1693. package/src/utils/table-utils/indexed-data-container.d.ts +0 -26
  1694. package/src/utils/table-utils/indexed-data-container.js +0 -152
  1695. package/src/utils/table-utils/kepler-table.d.ts +0 -114
  1696. package/src/utils/table-utils/kepler-table.js +0 -508
  1697. package/src/utils/table-utils/row-data-container.d.ts +0 -30
  1698. package/src/utils/table-utils/row-data-container.js +0 -151
  1699. package/src/utils/utils.js +0 -202
  1700. package/styles.js +0 -21
  1701. /package/src/actions/{index.js → index.ts} +0 -0
  1702. /package/src/components/common/data-table/{canvas.js → canvas.tsx} +0 -0
  1703. /package/src/components/editor/{constants.js → constants.ts} +0 -0
  1704. /package/src/components/filters/{components.js → components.ts} +0 -0
  1705. /package/src/components/filters/{index.js → index.ts} +0 -0
  1706. /package/src/components/map/{map-control-toolbar.js → map-control-toolbar.tsx} +0 -0
  1707. /package/src/components/modals/export-map-modal/{components.js → components.tsx} +0 -0
  1708. /package/src/components/modals/{modal-dialog.js → modal-dialog.tsx} +0 -0
  1709. /package/src/components/side-panel/{cloud-storage-dropdown.js → cloud-storage-dropdown.tsx} +0 -0
  1710. /package/src/components/side-panel/{custom-panel.js → custom-panel.tsx} +0 -0
  1711. /package/src/components/side-panel/layer-panel/{layer-aggregation-resolution.js → layer-aggregation-resolution.tsx} +0 -0
  1712. /package/src/constants/{color-palette.js → color-palette.ts} +0 -0
  1713. /package/src/constants/{custom-color-ranges.js → custom-color-ranges.ts} +0 -0
  1714. /package/src/constants/{index.js → index.ts} +0 -0
  1715. /package/src/constants/{keyevent.js → keyevent.ts} +0 -0
  1716. /package/src/constants/{tooltip.js → tooltip.ts} +0 -0
  1717. /package/src/constants/{user-feedbacks.js → user-feedbacks.ts} +0 -0
  1718. /package/src/constants/{user-guides.js → user-guides.ts} +0 -0
  1719. /package/src/layers/cluster-layer/{cluster-layer-icon.js → cluster-layer-icon.tsx} +0 -0
  1720. /package/src/layers/{default-layer-icon.js → default-layer-icon.tsx} +0 -0
  1721. /package/src/layers/h3-hexagon-layer/{h3-hexagon-layer-icon.js → h3-hexagon-layer-icon.tsx} +0 -0
  1722. /package/src/layers/heatmap-layer/{heatmap-layer-icon.js → heatmap-layer-icon.tsx} +0 -0
  1723. /package/src/layers/hexagon-layer/{hexagon-layer-icon.js → hexagon-layer-icon.tsx} +0 -0
  1724. /package/src/layers/icon-layer/{icon-layer-icon.js → icon-layer-icon.tsx} +0 -0
  1725. /package/src/layers/line-layer/{line-layer-icon.js → line-layer-icon.tsx} +0 -0
  1726. /package/src/layers/point-layer/{point-layer-icon.js → point-layer-icon.tsx} +0 -0
  1727. /package/src/layers/s2-geometry-layer/{s2-layer-icon.js → s2-layer-icon.tsx} +0 -0
  1728. /package/src/layers/scenegraph-layer/{scenegraph-info-modal.js → scenegraph-info-modal.tsx} +0 -0
  1729. /package/src/layers/scenegraph-layer/{scenegraph-layer-icon.js → scenegraph-layer-icon.tsx} +0 -0
  1730. /package/src/layers/trip-layer/{trip-info-modal.js → trip-info-modal.tsx} +0 -0
  1731. /package/src/layers/trip-layer/{trip-layer-icon.js → trip-layer-icon.tsx} +0 -0
  1732. /package/src/layers/{types.js → types.ts} +0 -0
  1733. /package/src/reducers/{composers.js → composers.ts} +0 -0
  1734. /package/src/schemas/{map-state-schema.js → map-state-schema.ts} +0 -0
  1735. /package/src/schemas/{map-style-schema.js → map-style-schema.ts} +0 -0
  1736. /package/src/schemas/{schema-utils.js → schema-utils.ts} +0 -0
  1737. /package/src/schemas/{versions.js → versions.ts} +0 -0
  1738. /package/src/styles/{index.js → index.ts} +0 -0
  1739. /package/src/templates/{export-map-html.js → export-map-html.ts} +0 -0
  1740. /package/src/utils/{gl-utils.js → gl-utils.ts} +0 -0
  1741. /package/src/utils/{locale-utils.js → locale-utils.ts} +0 -0
  1742. /package/src/utils/{map-info-utils.js → map-info-utils.ts} +0 -0
  1743. /package/src/utils/map-style-utils/{mapbox-utils.js → mapbox-utils.ts} +0 -0
  1744. /package/src/utils/{mapbox-utils.js → mapbox-utils.ts} +0 -0
  1745. /package/src/utils/{projection-utils.js → projection-utils.ts} +0 -0
  1746. /package/src/utils/{searcher-utils.js → searcher-utils.ts} +0 -0
  1747. /package/src/utils/table-utils/{index.js → index.ts} +0 -0
@@ -0,0 +1,2567 @@
1
+ // Copyright (c) 2022 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
+
21
+ import {console as Console} from 'global/window';
22
+ import {disableStackCapturing, withTask} from 'react-palm/tasks/index.js';
23
+ import cloneDeep from 'lodash.clonedeep';
24
+ import uniq from 'lodash.uniq';
25
+ import get from 'lodash.get';
26
+ import xor from 'lodash.xor';
27
+ import copy from 'copy-to-clipboard';
28
+ import {parseFieldValue} from 'utils/data-utils';
29
+ // Tasks
30
+ import {LOAD_FILE_TASK, UNWRAP_TASK, PROCESS_FILE_DATA, DELAY_TASK} from 'tasks/tasks';
31
+ // Actions
32
+ import {
33
+ loadFilesErr,
34
+ loadFilesSuccess,
35
+ loadFileStepSuccess,
36
+ loadNextFile,
37
+ nextFileBatch
38
+ } from 'actions/vis-state-actions';
39
+ // Utils
40
+ import {findFieldsToShow, getDefaultInteraction} from 'utils/interaction-utils';
41
+ import {
42
+ applyFilterFieldName,
43
+ applyFiltersToDatasets,
44
+ featureToFilterValue,
45
+ FILTER_UPDATER_PROPS,
46
+ filterDatasetCPU,
47
+ generatePolygonFilter,
48
+ getDefaultFilter,
49
+ getDefaultFilterPlotType,
50
+ getFilterIdInFeature,
51
+ getFilterPlot,
52
+ getTimeWidgetTitleFormatter,
53
+ isInRange,
54
+ LIMITED_FILTER_EFFECT_PROPS,
55
+ updateFilterDataId
56
+ } from 'utils/filter-utils';
57
+ import {assignGpuChannel, setFilterGpuMode} from 'utils/gpu-filter-utils';
58
+ import {createNewDataEntry} from 'utils/dataset-utils';
59
+ import {
60
+ pinTableColumns,
61
+ sortDatasetByColumn,
62
+ copyTableAndUpdate,
63
+ Field
64
+ } from 'utils/table-utils/kepler-table';
65
+ import {set, toArray, arrayInsert, generateHashId} from 'utils/utils';
66
+
67
+ import {calculateLayerData, findDefaultLayer} from 'utils/layer-utils';
68
+
69
+ import {
70
+ isValidMerger,
71
+ VIS_STATE_MERGERS,
72
+ validateLayerWithData,
73
+ createLayerFromConfig,
74
+ serializeLayer,
75
+ VisStateMergers
76
+ } from './vis-state-merger';
77
+
78
+ import {
79
+ addNewLayersToSplitMap,
80
+ computeSplitMapLayers,
81
+ removeLayerFromSplitMaps
82
+ } from 'utils/split-map-utils';
83
+
84
+ import {Layer, LayerClasses, LayerClassesType, LAYER_ID_LENGTH} from 'layers';
85
+ import {DEFAULT_TEXT_LABEL, DEFAULT_SECONDARY_TEXT_LABEL} from 'layers/layer-factory';
86
+ import {
87
+ EDITOR_MODES,
88
+ SORT_ORDER,
89
+ FILTER_TYPES,
90
+ MAX_DEFAULT_TOOLTIPS
91
+ } from 'constants/default-settings';
92
+ import {pick_, merge_, swap_} from './composer-helpers';
93
+ import {processFileContent} from 'actions/vis-state-actions';
94
+
95
+ import KeplerGLSchema from 'schemas';
96
+ import {isRgbColor} from 'utils/color-utils';
97
+
98
+ import {Millisecond} from './types';
99
+ import {ReceiveMapConfigPayload} from '../actions/actions';
100
+ import * as VisStateActions from 'actions/vis-state-actions';
101
+ import * as MapStateActions from 'actions/map-state-actions';
102
+ import ActionTypes from 'constants/action-types';
103
+ // @ts-ignore
104
+ import {LoaderObject} from '@loaders.gl/loader-utils';
105
+ import {KeplerTable} from '../utils';
106
+
107
+ export type HistogramBin = {
108
+ x0: number | undefined;
109
+ x1: number | undefined;
110
+ count: number;
111
+ };
112
+
113
+ export type RangeFieldDomain = {
114
+ domain: [number, number];
115
+ step: number;
116
+ histogram: HistogramBin[];
117
+ enlargedHistogram: HistogramBin[];
118
+ };
119
+
120
+ export type SelectFieldDomain = {
121
+ domain: [true, false];
122
+ };
123
+ export type MultiSelectFieldDomain = {
124
+ domain: string[];
125
+ };
126
+
127
+ export type TimeRangeFieldDomain = {
128
+ domain: [number, number];
129
+ step: number;
130
+ histogram: HistogramBin[];
131
+ enlargedHistogram: HistogramBin[];
132
+ mappedValue: (Millisecond | null)[];
133
+ // auto generated based on time domain
134
+ defaultTimeFormat?: string | null;
135
+ // custom ui input
136
+ timeFormat?: string | null;
137
+ // custom ui input
138
+ timezone?: string | null;
139
+ };
140
+ export type FieldDomain =
141
+ | RangeFieldDomain
142
+ | TimeRangeFieldDomain
143
+ | SelectFieldDomain
144
+ | MultiSelectFieldDomain;
145
+
146
+ export type LineChart = {
147
+ series: {x: number; y: number}[];
148
+ yDomain: [number, number];
149
+ xDomain: [number, number];
150
+ };
151
+
152
+ export type FilterBase = {
153
+ dataId: string[];
154
+ id: string;
155
+
156
+ freeze: boolean;
157
+
158
+ // time range filter specific
159
+ fixedDomain: boolean;
160
+ enlarged: boolean;
161
+ isAnimating: boolean;
162
+ speed: number;
163
+ showTimeDisplay?: boolean;
164
+
165
+ // field specific
166
+ name: string[]; // string
167
+ type: string | null;
168
+ fieldIdx: number[]; // [integer]
169
+ domain: any[] | null;
170
+ value: any;
171
+ mappedValue?: number[];
172
+
173
+ // plot
174
+ yAxis: Field | null;
175
+ plotType: string;
176
+ lineChart?: LineChart;
177
+ // gpu filter
178
+ gpu: boolean;
179
+ gpuChannel?: number[];
180
+ fieldType?: string;
181
+
182
+ // polygon
183
+ layerId?: string[];
184
+ };
185
+
186
+ export type RangeFilter = FilterBase &
187
+ RangeFieldDomain & {
188
+ type: 'range';
189
+ fieldType: 'real' | 'integer';
190
+ value: [number, number];
191
+ fixedDomain: true;
192
+ typeOptions: ['range'];
193
+ };
194
+
195
+ export type SelectFilter = FilterBase &
196
+ SelectFieldDomain & {
197
+ type: 'select';
198
+ fieldType: 'boolean';
199
+ value: boolean;
200
+ };
201
+
202
+ export type MultiSelectFilter = FilterBase &
203
+ MultiSelectFieldDomain & {
204
+ type: 'range';
205
+ fieldType: 'string' | 'date';
206
+ value: string[];
207
+ };
208
+ export type TimeRangeFilter = FilterBase &
209
+ TimeRangeFieldDomain & {
210
+ type: 'timeRange';
211
+ fieldType: 'timestamp';
212
+ fixedDomain: true;
213
+ value: [number, number];
214
+ bins?: Object;
215
+ plotType: {
216
+ [key: string]: any;
217
+ };
218
+ animationWindow: string;
219
+ };
220
+
221
+ export type PolygonFilter = FilterBase & {
222
+ layerId: string[];
223
+ type: 'polygon';
224
+ fixedDomain: true;
225
+ value: Feature;
226
+ };
227
+
228
+ export type Filter =
229
+ | FilterBase
230
+ | RangeFilter
231
+ | TimeRangeFilter
232
+ | SelectFilter
233
+ | MultiSelectFilter
234
+ | PolygonFilter;
235
+
236
+ export type Datasets = {
237
+ [key: string]: KeplerTable;
238
+ };
239
+
240
+ export type Feature = {
241
+ id: string;
242
+ properties: any;
243
+ geometry: {
244
+ type: string;
245
+ coordinates: any;
246
+ };
247
+ };
248
+ export type FeatureValue = {
249
+ id: string;
250
+ properties: {
251
+ filterId: string;
252
+ };
253
+ geometry: {
254
+ type: string;
255
+ coordinates: any;
256
+ };
257
+ };
258
+ export type Editor = {
259
+ mode: string;
260
+ features: Feature[];
261
+ selectedFeature: any;
262
+ visible: boolean;
263
+ };
264
+
265
+ export type SplitMapLayers = {[key: string]: boolean};
266
+ export type SplitMap = {
267
+ layers: SplitMapLayers;
268
+ };
269
+ export type AnimationConfig = {
270
+ domain: number[] | null;
271
+ currentTime: number | null;
272
+ speed: number;
273
+ isAnimating?: boolean;
274
+ // auto generated based on time domain
275
+ defaultTimeFormat?: string | null;
276
+ // custom ui input
277
+ timeFormat?: string | null;
278
+ // custom ui input
279
+ timezone?: string | null;
280
+ // hide or show control
281
+ hideControl?: boolean;
282
+ };
283
+
284
+ export type BaseInteraction = {
285
+ id: string;
286
+ label: string;
287
+ enabled: boolean;
288
+ iconComponent: any;
289
+ };
290
+ export type TooltipField = {
291
+ name: string;
292
+ format: string | null;
293
+ };
294
+ export type CompareType = string | null;
295
+ export type TooltipInfo = BaseInteraction & {
296
+ config: {
297
+ fieldsToShow: {
298
+ [key: string]: TooltipField[];
299
+ };
300
+ compareMode: boolean;
301
+ compareType: CompareType;
302
+ };
303
+ };
304
+ export type Geocoder = BaseInteraction & {
305
+ position: number[] | null;
306
+ };
307
+ export type Brush = BaseInteraction & {
308
+ config: {
309
+ size: number;
310
+ };
311
+ };
312
+ export type Coordinate = BaseInteraction & {
313
+ position: number[] | null;
314
+ };
315
+ export type InteractionConfig = {
316
+ tooltip: TooltipInfo;
317
+ geocoder: Geocoder;
318
+ brush: Brush;
319
+ coordinate: Coordinate;
320
+ };
321
+ export type MapInfo = {
322
+ title: string;
323
+ description: string;
324
+ };
325
+ export type FileLoading = {
326
+ filesToLoad: FileList;
327
+ onFinish: (payload: any) => any;
328
+ fileCache: any[];
329
+ };
330
+ export type FileLoadingProgress = {
331
+ [key: string]: {
332
+ percent: number;
333
+ message: string;
334
+ fileName: string;
335
+ error: any;
336
+ };
337
+ };
338
+
339
+ export type VisState = {
340
+ mapInfo: MapInfo;
341
+ layers: Layer[];
342
+ layerData: any[];
343
+ layerToBeMerged: any[];
344
+ layerOrder: number[];
345
+ filters: Filter[];
346
+ filterToBeMerged: any[];
347
+ datasets: Datasets;
348
+ editingDataset: string | undefined;
349
+ interactionConfig: InteractionConfig;
350
+ interactionToBeMerged: any;
351
+ layerBlending: string;
352
+ hoverInfo: any;
353
+ clicked: any;
354
+ mousePos: any;
355
+ maxDefaultTooltips: number;
356
+ layerClasses: LayerClassesType;
357
+ animationConfig: AnimationConfig;
358
+ editor: Editor;
359
+ splitMaps: SplitMap[];
360
+ splitMapsToBeMerged: SplitMap[];
361
+ fileLoading: FileLoading | false;
362
+ fileLoadingProgress: FileLoadingProgress;
363
+ loaders: LoaderObject[];
364
+ loadOptions: object;
365
+ initialState?: Partial<VisState>;
366
+ mergers: VisStateMergers;
367
+ schema: typeof KeplerGLSchema;
368
+ preserveLayerOrder?: number[];
369
+ };
370
+
371
+ // react-palm
372
+ // disable capture exception for react-palm call to withTask
373
+ disableStackCapturing();
374
+
375
+ /**
376
+ * Updaters for `visState` reducer. Can be used in your root reducer to directly modify kepler.gl's state.
377
+ * Read more about [Using updaters](../advanced-usage/using-updaters.md)
378
+ *
379
+ * @public
380
+ * @example
381
+ *
382
+ * import keplerGlReducer, {visStateUpdaters} from 'kepler.gl/reducers';
383
+ * // Root Reducer
384
+ * const reducers = combineReducers({
385
+ * keplerGl: keplerGlReducer,
386
+ * app: appReducer
387
+ * });
388
+ *
389
+ * const composedReducer = (state, action) => {
390
+ * switch (action.type) {
391
+ * case 'CLICK_BUTTON':
392
+ * return {
393
+ * ...state,
394
+ * keplerGl: {
395
+ * ...state.keplerGl,
396
+ * foo: {
397
+ * ...state.keplerGl.foo,
398
+ * visState: visStateUpdaters.enlargeFilterUpdater(
399
+ * state.keplerGl.foo.visState,
400
+ * {idx: 0}
401
+ * )
402
+ * }
403
+ * }
404
+ * };
405
+ * }
406
+ * return reducers(state, action);
407
+ * };
408
+ *
409
+ * export default composedReducer;
410
+ */
411
+ /* eslint-disable no-unused-vars */
412
+ // @ts-ignore
413
+ const visStateUpdaters = null;
414
+ /* eslint-enable no-unused-vars */
415
+
416
+ export const DEFAULT_ANIMATION_CONFIG: AnimationConfig = {
417
+ domain: null,
418
+ currentTime: null,
419
+ speed: 1,
420
+ isAnimating: false,
421
+ timeFormat: null,
422
+ timezone: null,
423
+ defaultTimeFormat: null
424
+ };
425
+
426
+ export const DEFAULT_EDITOR: Editor = {
427
+ mode: EDITOR_MODES.DRAW_POLYGON,
428
+ features: [],
429
+ selectedFeature: null,
430
+ visible: true
431
+ };
432
+
433
+ /**
434
+ * Default initial `visState`
435
+ * @memberof visStateUpdaters
436
+ * @constant
437
+ * @public
438
+ */
439
+ export const INITIAL_VIS_STATE: VisState = {
440
+ // map info
441
+ mapInfo: {
442
+ title: '',
443
+ description: ''
444
+ },
445
+ // layers
446
+ layers: [],
447
+ layerData: [],
448
+ layerToBeMerged: [],
449
+ layerOrder: [],
450
+
451
+ // filters
452
+ filters: [],
453
+ filterToBeMerged: [],
454
+
455
+ // a collection of multiple dataset
456
+ datasets: {},
457
+ editingDataset: undefined,
458
+
459
+ interactionConfig: getDefaultInteraction(),
460
+ interactionToBeMerged: undefined,
461
+
462
+ layerBlending: 'normal',
463
+ hoverInfo: undefined,
464
+ clicked: undefined,
465
+ mousePos: {},
466
+ maxDefaultTooltips: MAX_DEFAULT_TOOLTIPS,
467
+
468
+ // this is used when user split maps
469
+ splitMaps: [
470
+ // this will contain a list of objects to
471
+ // describe the state of layer availability and visibility for each map
472
+ // [
473
+ // {
474
+ // layers: {layer_id: true | false}
475
+ // }
476
+ // ]
477
+ ],
478
+ splitMapsToBeMerged: [],
479
+
480
+ // defaults layer classes
481
+ layerClasses: LayerClasses,
482
+
483
+ // default animation
484
+ // time in unix timestamp (milliseconds) (the number of seconds since the Unix Epoch)
485
+ animationConfig: DEFAULT_ANIMATION_CONFIG,
486
+
487
+ editor: DEFAULT_EDITOR,
488
+
489
+ fileLoading: false,
490
+ fileLoadingProgress: {},
491
+
492
+ loaders: [],
493
+ loadOptions: {},
494
+
495
+ // visStateMergers
496
+ mergers: VIS_STATE_MERGERS,
497
+
498
+ // kepler schemas
499
+ schema: KeplerGLSchema
500
+ };
501
+
502
+ /**
503
+ * Update state with updated layer and layerData
504
+ *
505
+ */
506
+ export function updateStateWithLayerAndData(
507
+ state: VisState,
508
+ {layerData, layer, idx}: {layerData?: any; layer: Layer; idx: number}
509
+ ): VisState {
510
+ return {
511
+ ...state,
512
+ layers: state.layers.map((lyr, i) => (i === idx ? layer : lyr)),
513
+ layerData: layerData
514
+ ? state.layerData.map((d, i) => (i === idx ? layerData : d))
515
+ : state.layerData
516
+ };
517
+ }
518
+
519
+ export function updateStateOnLayerVisibilityChange(state: VisState, layer: Layer): VisState {
520
+ let newState = state;
521
+ if (state.splitMaps.length) {
522
+ newState = {
523
+ ...state,
524
+ splitMaps: layer.config.isVisible
525
+ ? addNewLayersToSplitMap(state.splitMaps, layer)
526
+ : removeLayerFromSplitMaps(state.splitMaps, layer)
527
+ };
528
+ }
529
+
530
+ if (layer.config.animation.enabled) {
531
+ newState = updateAnimationDomain(state);
532
+ }
533
+
534
+ return newState;
535
+ }
536
+
537
+ /**
538
+ * Update layer base config: dataId, label, column, isVisible
539
+ * @memberof visStateUpdaters
540
+ * @returns nextState
541
+ */
542
+ export function layerConfigChangeUpdater(
543
+ state: VisState,
544
+ action: VisStateActions.LayerConfigChangeUpdaterAction
545
+ ): VisState {
546
+ const {oldLayer} = action;
547
+ const idx = state.layers.findIndex(l => l.id === oldLayer.id);
548
+ const props = Object.keys(action.newConfig);
549
+ if (typeof action.newConfig.dataId === 'string') {
550
+ const {dataId, ...restConfig} = action.newConfig;
551
+ const stateWithDataId = layerDataIdChangeUpdater(state, {
552
+ oldLayer,
553
+ newConfig: {dataId}
554
+ });
555
+ const nextLayer = stateWithDataId.layers.find(l => l.id === oldLayer.id);
556
+ return nextLayer && Object.keys(restConfig).length
557
+ ? layerConfigChangeUpdater(stateWithDataId, {oldLayer: nextLayer, newConfig: restConfig})
558
+ : stateWithDataId;
559
+ }
560
+
561
+ let newLayer = oldLayer.updateLayerConfig(action.newConfig);
562
+
563
+ let layerData;
564
+
565
+ // let newLayer;
566
+ if (newLayer.shouldCalculateLayerData(props)) {
567
+ const oldLayerData = state.layerData[idx];
568
+ const updateLayerDataResult = calculateLayerData(newLayer, state, oldLayerData);
569
+
570
+ layerData = updateLayerDataResult.layerData;
571
+ newLayer = updateLayerDataResult.layer;
572
+ }
573
+
574
+ let newState = state;
575
+ if ('isVisible' in action.newConfig) {
576
+ newState = updateStateOnLayerVisibilityChange(state, newLayer);
577
+ }
578
+
579
+ return updateStateWithLayerAndData(newState, {
580
+ layer: newLayer,
581
+ layerData,
582
+ idx
583
+ });
584
+ }
585
+
586
+ function addOrRemoveTextLabels(newFields, textLabel) {
587
+ let newTextLabel = textLabel.slice();
588
+
589
+ const currentFields = textLabel.map(tl => tl.field && tl.field.name).filter(d => d);
590
+
591
+ const addFields = newFields.filter(f => !currentFields.includes(f.name));
592
+ const deleteFields = currentFields.filter(f => !newFields.find(fd => fd.name === f));
593
+
594
+ // delete
595
+ newTextLabel = newTextLabel.filter(tl => tl.field && !deleteFields.includes(tl.field.name));
596
+
597
+ // add
598
+ newTextLabel = newTextLabel.filter(tl => tl.field);
599
+ const defaultLabel = newTextLabel.length ? DEFAULT_SECONDARY_TEXT_LABEL : DEFAULT_TEXT_LABEL;
600
+ newTextLabel = [...newTextLabel, ...addFields.map(af => ({...defaultLabel, field: af}))];
601
+
602
+ // limit to 2 labels (overwrite 2nd label with 3rd)
603
+ if (newTextLabel.length > 2) {
604
+ newTextLabel = [newTextLabel[0], newTextLabel[2]];
605
+ }
606
+
607
+ // default
608
+ newTextLabel = !newTextLabel.length ? [DEFAULT_TEXT_LABEL] : newTextLabel;
609
+
610
+ return newTextLabel;
611
+ }
612
+
613
+ function updateTextLabelPropAndValue(idx, prop, value, textLabel) {
614
+ if (!textLabel[idx].hasOwnProperty(prop)) {
615
+ return textLabel;
616
+ }
617
+
618
+ let newTextLabel = textLabel.slice();
619
+
620
+ if (prop && (value || textLabel.length === 1)) {
621
+ newTextLabel = textLabel.map((tl, i) => (i === idx ? {...tl, [prop]: value} : tl));
622
+ } else if (prop === 'field' && value === null && textLabel.length > 1) {
623
+ // remove label when field value is set to null
624
+ newTextLabel.splice(idx, 1);
625
+ }
626
+
627
+ return newTextLabel;
628
+ }
629
+
630
+ /**
631
+ * Update layer base config: dataId, label, column, isVisible
632
+ * @memberof visStateUpdaters
633
+ * @returns nextState
634
+ */
635
+ export function layerTextLabelChangeUpdater(
636
+ state: VisState,
637
+ action: VisStateActions.LayerTextLabelChangeUpdaterAction
638
+ ): VisState {
639
+ const {oldLayer, idx, prop, value} = action;
640
+ const {textLabel} = oldLayer.config;
641
+
642
+ let newTextLabel = textLabel.slice();
643
+ if (!textLabel[idx] && idx === textLabel.length) {
644
+ // if idx is set to length, add empty text label
645
+ newTextLabel = [...textLabel, idx === 0 ? DEFAULT_TEXT_LABEL : DEFAULT_SECONDARY_TEXT_LABEL];
646
+ }
647
+
648
+ if (idx === 'all' && prop === 'fields') {
649
+ newTextLabel = addOrRemoveTextLabels(value, textLabel);
650
+ } else {
651
+ newTextLabel = updateTextLabelPropAndValue(idx, prop, value, newTextLabel);
652
+ }
653
+ // update text label prop and value
654
+ return layerConfigChangeUpdater(state, {
655
+ oldLayer,
656
+ newConfig: {textLabel: newTextLabel}
657
+ });
658
+ }
659
+
660
+ function validateExistingLayerWithData(dataset, layerClasses, layer) {
661
+ const loadedLayer = serializeLayer(layer);
662
+ return validateLayerWithData(dataset, loadedLayer, layerClasses, {
663
+ allowEmptyColumn: true
664
+ });
665
+ }
666
+
667
+ /**
668
+ * Update layer config dataId
669
+ * @memberof visStateUpdaters
670
+ * @returns nextState
671
+ */
672
+ export function layerDataIdChangeUpdater(
673
+ state: VisState,
674
+ action: {
675
+ oldLayer: Layer;
676
+ newConfig: {
677
+ dataId: string;
678
+ };
679
+ }
680
+ ): VisState {
681
+ const {oldLayer, newConfig} = action;
682
+ const {dataId} = newConfig;
683
+
684
+ if (!oldLayer || !state.datasets[dataId]) {
685
+ return state;
686
+ }
687
+ const idx = state.layers.findIndex(l => l.id === oldLayer.id);
688
+
689
+ let newLayer = oldLayer.updateLayerConfig({dataId});
690
+ // this may happen when a layer is new (type: null and no columns) but it's not ready to be saved
691
+ if (newLayer.isValidToSave()) {
692
+ const validated = validateExistingLayerWithData(
693
+ state.datasets[dataId],
694
+ state.layerClasses,
695
+ newLayer
696
+ );
697
+ // if cant validate it with data create a new one
698
+ if (!validated) {
699
+ newLayer = new state.layerClasses[oldLayer.type]({dataId, id: oldLayer.id});
700
+ } else {
701
+ newLayer = validated;
702
+ }
703
+ }
704
+
705
+ newLayer = newLayer.updateLayerConfig({
706
+ isVisible: oldLayer.config.isVisible,
707
+ isConfigActive: true
708
+ });
709
+
710
+ newLayer.updateLayerDomain(state.datasets);
711
+ const {layerData, layer} = calculateLayerData(newLayer, state, undefined);
712
+
713
+ return updateStateWithLayerAndData(state, {layerData, layer, idx});
714
+ }
715
+
716
+ /**
717
+ * Update layer type. Previews layer config will be copied if applicable.
718
+ * @memberof visStateUpdaters
719
+ * @public
720
+ */
721
+ export function layerTypeChangeUpdater(
722
+ state: VisState,
723
+ action: VisStateActions.LayerTypeChangeUpdaterAction
724
+ ): VisState {
725
+ const {oldLayer, newType} = action;
726
+ if (!oldLayer) {
727
+ return state;
728
+ }
729
+ const oldId = oldLayer.id;
730
+ const idx = state.layers.findIndex(l => l.id === oldId);
731
+
732
+ if (!state.layerClasses[newType]) {
733
+ Console.error(`${newType} is not a valid layer type`);
734
+ return state;
735
+ }
736
+
737
+ // get a mint layer, with new id and type
738
+ // because deck.gl uses id to match between new and old layer.
739
+ // If type has changed but id is the same, it will break
740
+ const newLayer = new state.layerClasses[newType]();
741
+
742
+ newLayer.assignConfigToLayer(oldLayer.config, oldLayer.visConfigSettings);
743
+
744
+ newLayer.updateLayerDomain(state.datasets);
745
+ const {layerData, layer} = calculateLayerData(newLayer, state);
746
+ let newState = updateStateWithLayerAndData(state, {layerData, layer, idx});
747
+
748
+ if (layer.config.animation.enabled || oldLayer.config.animation.enabled) {
749
+ newState = updateAnimationDomain(newState);
750
+ }
751
+
752
+ // update splitMap layer id
753
+ if (state.splitMaps.length) {
754
+ newState = {
755
+ ...newState,
756
+ splitMaps: newState.splitMaps.map(settings => {
757
+ const {[oldId]: oldLayerMap, ...otherLayers} = settings.layers;
758
+ return oldId in settings.layers
759
+ ? {
760
+ ...settings,
761
+ layers: {
762
+ ...otherLayers,
763
+ [layer.id]: oldLayerMap
764
+ }
765
+ }
766
+ : settings;
767
+ })
768
+ };
769
+ }
770
+
771
+ return newState;
772
+ }
773
+
774
+ /**
775
+ * Update layer visual channel
776
+ * @memberof visStateUpdaters
777
+ * @returns {Object} nextState
778
+ * @public
779
+ */
780
+ export function layerVisualChannelChangeUpdater(
781
+ state: VisState,
782
+ action: VisStateActions.LayerVisualChannelConfigChangeUpdaterAction
783
+ ): VisState {
784
+ const {oldLayer, newConfig, channel} = action;
785
+ if (!oldLayer.config.dataId) {
786
+ return state;
787
+ }
788
+ const dataset = state.datasets[oldLayer.config.dataId];
789
+
790
+ const idx = state.layers.findIndex(l => l.id === oldLayer.id);
791
+ const newLayer = oldLayer.updateLayerConfig(newConfig);
792
+
793
+ newLayer.updateLayerVisualChannel(dataset, channel);
794
+
795
+ const oldLayerData = state.layerData[idx];
796
+ const {layerData, layer} = calculateLayerData(newLayer, state, oldLayerData);
797
+
798
+ return updateStateWithLayerAndData(state, {layerData, layer, idx});
799
+ }
800
+
801
+ /**
802
+ * Update layer `visConfig`
803
+ * @memberof visStateUpdaters
804
+ * @public
805
+ */
806
+ export function layerVisConfigChangeUpdater(
807
+ state: VisState,
808
+ action: VisStateActions.LayerVisConfigChangeUpdaterAction
809
+ ): VisState {
810
+ const {oldLayer} = action;
811
+ const idx = state.layers.findIndex(l => l.id === oldLayer.id);
812
+ const props = Object.keys(action.newVisConfig);
813
+ const newVisConfig = {
814
+ ...oldLayer.config.visConfig,
815
+ ...action.newVisConfig
816
+ };
817
+
818
+ const newLayer = oldLayer.updateLayerConfig({visConfig: newVisConfig});
819
+
820
+ if (newLayer.shouldCalculateLayerData(props)) {
821
+ const oldLayerData = state.layerData[idx];
822
+ const {layerData, layer} = calculateLayerData(newLayer, state, oldLayerData);
823
+ return updateStateWithLayerAndData(state, {layerData, layer, idx});
824
+ }
825
+
826
+ return updateStateWithLayerAndData(state, {layer: newLayer, idx});
827
+ }
828
+
829
+ /**
830
+ * Update filter property
831
+ * @memberof visStateUpdaters
832
+ * @public
833
+ */
834
+ export function setFilterAnimationTimeUpdater(
835
+ state: VisState,
836
+ action: VisStateActions.SetFilterAnimationTimeUpdaterAction
837
+ ): VisState {
838
+ return setFilterUpdater(state, action);
839
+ }
840
+
841
+ /**
842
+ * Update filter animation window
843
+ * @memberof visStateUpdaters
844
+ * @public
845
+ */
846
+ export function setFilterAnimationWindowUpdater(
847
+ state: VisState,
848
+ {id, animationWindow}: VisStateActions.SetFilterAnimationWindowUpdaterAction
849
+ ): VisState {
850
+ return {
851
+ ...state,
852
+ filters: state.filters.map(f =>
853
+ f.id === id
854
+ ? {
855
+ ...f,
856
+ animationWindow
857
+ }
858
+ : f
859
+ )
860
+ };
861
+ }
862
+ /**
863
+ * Update filter property
864
+ * @memberof visStateUpdaters
865
+ * @public
866
+ */
867
+ export function setFilterUpdater(
868
+ state: VisState,
869
+ action: VisStateActions.SetFilterUpdaterAction
870
+ ): VisState {
871
+ const {idx, prop, value, valueIndex = 0} = action;
872
+ const oldFilter = state.filters[idx];
873
+
874
+ if (!oldFilter) {
875
+ Console.error(`filters.${idx} is undefined`);
876
+ return state;
877
+ }
878
+ let newFilter = set([prop], value, oldFilter);
879
+ let newState = state;
880
+
881
+ const {dataId} = newFilter;
882
+
883
+ // Ensuring backward compatibility
884
+ let datasetIds = toArray(dataId);
885
+
886
+ switch (prop) {
887
+ // TODO: Next PR for UI if we update dataId, we need to consider two cases:
888
+ // 1. dataId is empty: create a default filter
889
+ // 2. Add a new dataset id
890
+ case FILTER_UPDATER_PROPS.dataId:
891
+ // if trying to update filter dataId. create an empty new filter
892
+ newFilter = updateFilterDataId(dataId);
893
+ break;
894
+
895
+ case FILTER_UPDATER_PROPS.name:
896
+ // we are supporting the current functionality
897
+ // TODO: Next PR for UI filter name will only update filter name but it won't have side effects
898
+ // we are gonna use pair of datasets and fieldIdx to update the filter
899
+ const datasetId = newFilter.dataId[valueIndex];
900
+ const {filter: updatedFilter, dataset: newDataset} = applyFilterFieldName(
901
+ newFilter,
902
+ state.datasets[datasetId],
903
+ value,
904
+ valueIndex,
905
+ {mergeDomain: false}
906
+ );
907
+ if (!updatedFilter) {
908
+ return state;
909
+ }
910
+
911
+ newFilter = updatedFilter;
912
+
913
+ if (newFilter.gpu) {
914
+ newFilter = setFilterGpuMode(newFilter, state.filters);
915
+ newFilter = assignGpuChannel(newFilter, state.filters);
916
+ }
917
+
918
+ newState = set(['datasets', datasetId], newDataset, state);
919
+
920
+ // only filter the current dataset
921
+ break;
922
+ case FILTER_UPDATER_PROPS.layerId:
923
+ // We need to update only datasetId/s if we have added/removed layers
924
+ // - check for layerId changes (XOR works because of string values)
925
+ // if no differences between layerIds, don't do any filtering
926
+ // @ts-ignore
927
+ const layerIdDifference = xor(newFilter.layerId, oldFilter.layerId);
928
+
929
+ const layerDataIds = uniq(
930
+ layerIdDifference
931
+ .map(lid =>
932
+ get(
933
+ state.layers.find(l => l.id === lid),
934
+ ['config', 'dataId']
935
+ )
936
+ )
937
+ .filter(d => d)
938
+ );
939
+
940
+ // only filter datasetsIds
941
+ datasetIds = layerDataIds;
942
+
943
+ // Update newFilter dataIds
944
+ const newDataIds = uniq(
945
+ newFilter.layerId
946
+ .map(lid =>
947
+ get(
948
+ state.layers.find(l => l.id === lid),
949
+ ['config', 'dataId']
950
+ )
951
+ )
952
+ .filter(d => d)
953
+ );
954
+
955
+ newFilter = {
956
+ ...newFilter,
957
+ dataId: newDataIds
958
+ };
959
+
960
+ break;
961
+ default:
962
+ break;
963
+ }
964
+
965
+ const enlargedFilter = state.filters.find(f => f.enlarged);
966
+
967
+ if (enlargedFilter && enlargedFilter.id !== newFilter.id) {
968
+ // there should be only one enlarged filter
969
+ newFilter.enlarged = false;
970
+ }
971
+
972
+ // save new filters to newState
973
+ newState = set(['filters', idx], newFilter, newState);
974
+
975
+ // if we are currently setting a prop that only requires to filter the current
976
+ // dataset we will pass only the current dataset to applyFiltersToDatasets and
977
+ // updateAllLayerDomainData otherwise we pass the all list of datasets as defined in dataId
978
+ const datasetIdsToFilter = LIMITED_FILTER_EFFECT_PROPS[prop]
979
+ ? [datasetIds[valueIndex]]
980
+ : datasetIds;
981
+
982
+ // filter data
983
+ const filteredDatasets = applyFiltersToDatasets(
984
+ datasetIdsToFilter,
985
+ newState.datasets,
986
+ newState.filters,
987
+ newState.layers
988
+ );
989
+
990
+ newState = set(['datasets'], filteredDatasets, newState);
991
+ // dataId is an array
992
+ // pass only the dataset we need to update
993
+ newState = updateAllLayerDomainData(newState, datasetIdsToFilter, newFilter);
994
+
995
+ return newState;
996
+ }
997
+
998
+ /**
999
+ * Set the property of a filter plot
1000
+ * @memberof visStateUpdaters
1001
+ * @public
1002
+ */
1003
+ export const setFilterPlotUpdater = (
1004
+ state: VisState,
1005
+ {idx, newProp, valueIndex = 0}: VisStateActions.SetFilterPlotUpdaterAction
1006
+ ): VisState => {
1007
+ let newFilter = {...state.filters[idx], ...newProp};
1008
+ const prop = Object.keys(newProp)[0];
1009
+ if (prop === 'yAxis') {
1010
+ const plotType = getDefaultFilterPlotType(newFilter);
1011
+ // TODO: plot is not supported in multi dataset filter for now
1012
+ if (plotType) {
1013
+ newFilter = {
1014
+ ...newFilter,
1015
+ ...getFilterPlot({...newFilter, plotType}, state.datasets[newFilter.dataId[valueIndex]]),
1016
+ plotType
1017
+ };
1018
+ }
1019
+ }
1020
+
1021
+ return {
1022
+ ...state,
1023
+ filters: state.filters.map((f, i) => (i === idx ? newFilter : f))
1024
+ };
1025
+ };
1026
+
1027
+ /**
1028
+ * Add a new filter
1029
+ * @memberof visStateUpdaters
1030
+ * @public
1031
+ */
1032
+ export const addFilterUpdater = (
1033
+ state: VisState,
1034
+ action: VisStateActions.AddFilterUpdaterAction
1035
+ ): VisState =>
1036
+ !action.dataId
1037
+ ? state
1038
+ : {
1039
+ ...state,
1040
+ filters: [...state.filters, getDefaultFilter(action.dataId)]
1041
+ };
1042
+
1043
+ /**
1044
+ * Set layer color palette ui state
1045
+ * @memberof visStateUpdaters
1046
+ */
1047
+ export const layerColorUIChangeUpdater = (
1048
+ state: VisState,
1049
+ {oldLayer, prop, newConfig}: VisStateActions.LayerColorUIChangeUpdaterAction
1050
+ ): VisState => {
1051
+ const oldVixConfig = oldLayer.config.visConfig[prop];
1052
+ const newLayer = oldLayer.updateLayerColorUI(prop, newConfig);
1053
+ const newVisConfig = newLayer.config.visConfig[prop];
1054
+ if (oldVixConfig !== newVisConfig) {
1055
+ return layerVisConfigChangeUpdater(state, {
1056
+ oldLayer,
1057
+ newVisConfig: {
1058
+ [prop]: newVisConfig
1059
+ }
1060
+ });
1061
+ }
1062
+ return {
1063
+ ...state,
1064
+ layers: state.layers.map(l => (l.id === oldLayer.id ? newLayer : l))
1065
+ };
1066
+ };
1067
+
1068
+ /**
1069
+ * Start and end filter animation
1070
+ * @memberof visStateUpdaters
1071
+ * @public
1072
+ */
1073
+ export const toggleFilterAnimationUpdater = (
1074
+ state: VisState,
1075
+ action: VisStateActions.ToggleFilterAnimationUpdaterAction
1076
+ ): VisState => ({
1077
+ ...state,
1078
+ filters: state.filters.map((f, i) => (i === action.idx ? {...f, isAnimating: !f.isAnimating} : f))
1079
+ });
1080
+
1081
+ /**
1082
+ * @memberof visStateUpdaters
1083
+ * @public
1084
+ */
1085
+ export const toggleLayerAnimationUpdater = (
1086
+ state: VisState,
1087
+ action: VisStateActions.ToggleLayerAnimationUpdaterAction
1088
+ ): VisState => ({
1089
+ ...state,
1090
+ animationConfig: {
1091
+ ...state.animationConfig,
1092
+ isAnimating: !state.animationConfig.isAnimating
1093
+ }
1094
+ });
1095
+
1096
+ /**
1097
+ * Hide and show layer animation control
1098
+ * @memberof visStateUpdaters
1099
+ * @public
1100
+ */
1101
+ export const toggleLayerAnimationControlUpdater = (
1102
+ state: VisState,
1103
+ action: VisStateActions.ToggleLayerAnimationControlUpdaterAction
1104
+ ): VisState => ({
1105
+ ...state,
1106
+ animationConfig: {
1107
+ ...state.animationConfig,
1108
+ hideControl: !state.animationConfig.hideControl
1109
+ }
1110
+ });
1111
+
1112
+ /**
1113
+ * Change filter animation speed
1114
+ * @memberof visStateUpdaters
1115
+ * @public
1116
+ */
1117
+ export const updateFilterAnimationSpeedUpdater = (
1118
+ state: VisState,
1119
+ action: VisStateActions.UpdateFilterAnimationSpeedUpdaterAction
1120
+ ): VisState => ({
1121
+ ...state,
1122
+ filters: state.filters.map((f, i) => (i === action.idx ? {...f, speed: action.speed} : f))
1123
+ });
1124
+
1125
+ /**
1126
+ * Reset animation config current time to a specified value
1127
+ * @memberof visStateUpdaters
1128
+ * @public
1129
+ *
1130
+ */
1131
+ export const setLayerAnimationTimeUpdater = (
1132
+ state: VisState,
1133
+ {value}: VisStateActions.SetLayerAnimationTimeUpdaterAction
1134
+ ): VisState => ({
1135
+ ...state,
1136
+ animationConfig: {
1137
+ ...state.animationConfig,
1138
+ currentTime: value
1139
+ }
1140
+ });
1141
+
1142
+ /**
1143
+ * Update animation speed with the vertical speed slider
1144
+ * @memberof visStateUpdaters
1145
+ * @public
1146
+ *
1147
+ */
1148
+ export const updateLayerAnimationSpeedUpdater = (
1149
+ state: VisState,
1150
+ {speed}: VisStateActions.UpdateLayerAnimationSpeedUpdaterAction
1151
+ ): VisState => {
1152
+ return {
1153
+ ...state,
1154
+ animationConfig: {
1155
+ ...state.animationConfig,
1156
+ speed
1157
+ }
1158
+ };
1159
+ };
1160
+
1161
+ /**
1162
+ * Show larger time filter at bottom for time playback (apply to time filter only)
1163
+ * @memberof visStateUpdaters
1164
+ * @public
1165
+ */
1166
+ export const enlargeFilterUpdater = (
1167
+ state: VisState,
1168
+ action: VisStateActions.EnlargeFilterUpdaterAction
1169
+ ): VisState => {
1170
+ return {
1171
+ ...state,
1172
+ filters: state.filters.map((f, i) =>
1173
+ i === action.idx
1174
+ ? {
1175
+ ...f,
1176
+ enlarged: !f.enlarged
1177
+ }
1178
+ : f
1179
+ )
1180
+ };
1181
+ };
1182
+
1183
+ /**
1184
+ * Toggles filter feature visibility
1185
+ * @memberof visStateUpdaters
1186
+ */
1187
+ export const toggleFilterFeatureUpdater = (
1188
+ state: VisState,
1189
+ action: VisStateActions.ToggleFilterFeatureUpdaterAction
1190
+ ): VisState => {
1191
+ const filter = state.filters[action.idx];
1192
+ const isVisible = get(filter, ['value', 'properties', 'isVisible']);
1193
+ const newFilter = {
1194
+ ...filter,
1195
+ value: featureToFilterValue(filter.value, filter.id, {
1196
+ isVisible: !isVisible
1197
+ })
1198
+ };
1199
+
1200
+ return {
1201
+ ...state,
1202
+ filters: Object.assign([...state.filters], {[action.idx]: newFilter})
1203
+ };
1204
+ };
1205
+
1206
+ /**
1207
+ * Remove a filter
1208
+ * @memberof visStateUpdaters
1209
+ * @public
1210
+ */
1211
+ export const removeFilterUpdater = (
1212
+ state: VisState,
1213
+ action: VisStateActions.RemoveFilterUpdaterAction
1214
+ ): VisState => {
1215
+ const {idx} = action;
1216
+ const {dataId, id} = state.filters[idx];
1217
+
1218
+ const newFilters = [
1219
+ ...state.filters.slice(0, idx),
1220
+ ...state.filters.slice(idx + 1, state.filters.length)
1221
+ ];
1222
+
1223
+ const filteredDatasets = applyFiltersToDatasets(dataId, state.datasets, newFilters, state.layers);
1224
+ const newEditor =
1225
+ getFilterIdInFeature(state.editor.selectedFeature) === id
1226
+ ? {
1227
+ ...state.editor,
1228
+ selectedFeature: null
1229
+ }
1230
+ : state.editor;
1231
+
1232
+ let newState = set(['filters'], newFilters, state);
1233
+ newState = set(['datasets'], filteredDatasets, newState);
1234
+ newState = set(['editor'], newEditor, newState);
1235
+
1236
+ return updateAllLayerDomainData(newState, dataId, undefined);
1237
+ };
1238
+
1239
+ /**
1240
+ * Add a new layer
1241
+ * @memberof visStateUpdaters
1242
+ * @public
1243
+ */
1244
+ export const addLayerUpdater = (
1245
+ state: VisState,
1246
+ action: VisStateActions.AddLayerUpdaterAction
1247
+ ): VisState => {
1248
+ let newLayer;
1249
+ let newLayerData;
1250
+ if (action.config) {
1251
+ newLayer = createLayerFromConfig(state, action.config);
1252
+ if (!newLayer) {
1253
+ Console.warn(
1254
+ 'Failed to create layer from config, it usually means the config is not be in correct format',
1255
+ action.config
1256
+ );
1257
+ return state;
1258
+ }
1259
+
1260
+ const result = calculateLayerData(newLayer, state);
1261
+ newLayer = result.layer;
1262
+ newLayerData = result.layerData;
1263
+ } else {
1264
+ // create an empty layer with a specific dataset or a default one
1265
+ const defaultDataset = action.datasetId ?? Object.keys(state.datasets)[0];
1266
+ newLayer = new Layer({
1267
+ isVisible: true,
1268
+ isConfigActive: true,
1269
+ dataId: defaultDataset
1270
+ });
1271
+ newLayerData = {};
1272
+ }
1273
+ return {
1274
+ ...state,
1275
+ layers: [...state.layers, newLayer],
1276
+ layerData: [...state.layerData, newLayerData],
1277
+ layerOrder: [...state.layerOrder, state.layerOrder.length],
1278
+ splitMaps: addNewLayersToSplitMap(state.splitMaps, newLayer)
1279
+ };
1280
+ };
1281
+
1282
+ /**
1283
+ * remove layer
1284
+ * @memberof visStateUpdaters
1285
+ * @public
1286
+ */
1287
+ export const removeLayerUpdater = (
1288
+ state: VisState,
1289
+ {idx}: VisStateActions.RemoveLayerUpdaterAction
1290
+ ): VisState => {
1291
+ const {layers, layerData, clicked, hoverInfo} = state;
1292
+ const layerToRemove = state.layers[idx];
1293
+ const newMaps = removeLayerFromSplitMaps(state.splitMaps, layerToRemove);
1294
+
1295
+ const newState = {
1296
+ ...state,
1297
+ layers: [...layers.slice(0, idx), ...layers.slice(idx + 1, layers.length)],
1298
+ layerData: [...layerData.slice(0, idx), ...layerData.slice(idx + 1, layerData.length)],
1299
+ layerOrder: state.layerOrder.filter(i => i !== idx).map(pid => (pid > idx ? pid - 1 : pid)),
1300
+ clicked: layerToRemove.isLayerHovered(clicked) ? undefined : clicked,
1301
+ hoverInfo: layerToRemove.isLayerHovered(hoverInfo) ? undefined : hoverInfo,
1302
+ splitMaps: newMaps
1303
+ // TODO: update filters, create helper to remove layer form filter (remove layerid and dataid) if mapped
1304
+ };
1305
+
1306
+ return updateAnimationDomain(newState);
1307
+ };
1308
+
1309
+ /**
1310
+ * duplicate layer
1311
+ * @memberof visStateUpdaters
1312
+ * @public
1313
+ */
1314
+ export const duplicateLayerUpdater = (
1315
+ state: VisState,
1316
+ {idx}: VisStateActions.DuplicateLayerUpdaterAction
1317
+ ): VisState => {
1318
+ const {layers} = state;
1319
+ const original = state.layers[idx];
1320
+ const originalLayerOrderIdx = state.layerOrder.findIndex(i => i === idx);
1321
+
1322
+ if (!original) {
1323
+ Console.warn(`layer.${idx} is undefined`);
1324
+ return state;
1325
+ }
1326
+ let newLabel = `Copy of ${original.config.label}`;
1327
+ let postfix = 0;
1328
+ // eslint-disable-next-line no-loop-func
1329
+ while (layers.find(l => l.config.label === newLabel)) {
1330
+ newLabel = `Copy of ${original.config.label} ${++postfix}`;
1331
+ }
1332
+
1333
+ // collect layer config from original
1334
+ const loadedLayer = serializeLayer(original);
1335
+
1336
+ // assign new id and label to copied layer
1337
+ if (!loadedLayer.config) {
1338
+ return state;
1339
+ }
1340
+ loadedLayer.config.label = newLabel;
1341
+ loadedLayer.id = generateHashId(LAYER_ID_LENGTH);
1342
+
1343
+ // add layer to state
1344
+ let nextState = addLayerUpdater(state, {config: loadedLayer});
1345
+
1346
+ // new added layer are at the end, move it to be on top of original layer
1347
+ const newLayerOrderIdx = nextState.layerOrder.length - 1;
1348
+ const newLayerOrder = arrayInsert(
1349
+ nextState.layerOrder.slice(0, newLayerOrderIdx),
1350
+ originalLayerOrderIdx,
1351
+ newLayerOrderIdx
1352
+ );
1353
+
1354
+ nextState = {
1355
+ ...nextState,
1356
+ layerOrder: newLayerOrder
1357
+ };
1358
+
1359
+ return updateAnimationDomain(nextState);
1360
+ };
1361
+
1362
+ /**
1363
+ * Reorder layer
1364
+ * @memberof visStateUpdaters
1365
+ * @public
1366
+ */
1367
+ export const reorderLayerUpdater = (
1368
+ state: VisState,
1369
+ {order}: VisStateActions.ReorderLayerUpdaterAction
1370
+ ): VisState => ({
1371
+ ...state,
1372
+ layerOrder: order
1373
+ });
1374
+
1375
+ /**
1376
+ * Remove a dataset and all layers, filters, tooltip configs that based on it
1377
+ * @memberof visStateUpdaters
1378
+ * @public
1379
+ */
1380
+ export const removeDatasetUpdater = (
1381
+ state: VisState,
1382
+ action: VisStateActions.RemoveDatasetUpdaterAction
1383
+ ): VisState => {
1384
+ // extract dataset key
1385
+ const {dataId: datasetKey} = action;
1386
+ const {datasets} = state;
1387
+
1388
+ // check if dataset is present
1389
+ if (!datasets[datasetKey]) {
1390
+ return state;
1391
+ }
1392
+
1393
+ /* eslint-disable no-unused-vars */
1394
+ const {
1395
+ layers,
1396
+ datasets: {[datasetKey]: dataset, ...newDatasets}
1397
+ } = state;
1398
+ /* eslint-enable no-unused-vars */
1399
+
1400
+ const indexes = layers.reduce((listOfIndexes, layer, index) => {
1401
+ if (layer.config.dataId === datasetKey) {
1402
+ // @ts-ignore
1403
+ listOfIndexes.push(index);
1404
+ }
1405
+ return listOfIndexes;
1406
+ }, []);
1407
+
1408
+ // remove layers and datasets
1409
+ const {newState} = indexes.reduce(
1410
+ ({newState: currentState, indexCounter}, idx) => {
1411
+ const currentIndex = idx - indexCounter;
1412
+ currentState = removeLayerUpdater(currentState, {idx: currentIndex});
1413
+ indexCounter++;
1414
+ return {newState: currentState, indexCounter};
1415
+ },
1416
+ {newState: {...state, datasets: newDatasets}, indexCounter: 0}
1417
+ );
1418
+
1419
+ // remove filters
1420
+ const filters = state.filters.filter(filter => !filter.dataId.includes(datasetKey));
1421
+
1422
+ // update interactionConfig
1423
+ let {interactionConfig} = state;
1424
+ const {tooltip} = interactionConfig;
1425
+ if (tooltip) {
1426
+ const {config} = tooltip;
1427
+ /* eslint-disable no-unused-vars */
1428
+ const {[datasetKey]: fields, ...fieldsToShow} = config.fieldsToShow;
1429
+ /* eslint-enable no-unused-vars */
1430
+ interactionConfig = {
1431
+ ...interactionConfig,
1432
+ tooltip: {...tooltip, config: {...config, fieldsToShow}}
1433
+ };
1434
+ }
1435
+
1436
+ return {...newState, filters, interactionConfig};
1437
+ };
1438
+
1439
+ /**
1440
+ * update layer blending mode
1441
+ * @memberof visStateUpdaters
1442
+ * @public
1443
+ */
1444
+ export const updateLayerBlendingUpdater = (
1445
+ state: VisState,
1446
+ action: VisStateActions.UpdateLayerBlendingUpdaterAction
1447
+ ): VisState => ({
1448
+ ...state,
1449
+ layerBlending: action.mode
1450
+ });
1451
+
1452
+ /**
1453
+ * Display dataset table in a modal
1454
+ * @memberof visStateUpdaters
1455
+ * @public
1456
+ */
1457
+ export const showDatasetTableUpdater = (
1458
+ state: VisState,
1459
+ action: VisStateActions.ShowDatasetTableUpdaterAction
1460
+ ): VisState => {
1461
+ return {
1462
+ ...state,
1463
+ editingDataset: action.dataId
1464
+ };
1465
+ };
1466
+
1467
+ /**
1468
+ * Add custom color for datasets and layers
1469
+ * @memberof visStateUpdaters
1470
+ * @public
1471
+ */
1472
+ export const updateTableColorUpdater = (
1473
+ state: VisState,
1474
+ action: VisStateActions.UpdateDatasetColorUpdater
1475
+ ): VisState => {
1476
+ const {dataId, newColor} = action;
1477
+ const {datasets} = state;
1478
+
1479
+ if (isRgbColor(newColor)) {
1480
+ const existing = datasets[dataId];
1481
+ existing.updateTableColor(newColor);
1482
+
1483
+ return {
1484
+ ...state,
1485
+ datasets: {
1486
+ ...state.datasets,
1487
+ [dataId]: copyTableAndUpdate(existing, {})
1488
+ }
1489
+ };
1490
+ }
1491
+ return state;
1492
+ };
1493
+
1494
+ /**
1495
+ * reset visState to initial State
1496
+ * @memberof visStateUpdaters
1497
+ * @public
1498
+ */
1499
+ export const resetMapConfigUpdater = (state: VisState): VisState => ({
1500
+ ...INITIAL_VIS_STATE,
1501
+ ...state.initialState,
1502
+ initialState: state.initialState
1503
+ });
1504
+
1505
+ /**
1506
+ * Propagate `visState` reducer with a new configuration. Current config will be override.
1507
+ * @memberof visStateUpdaters
1508
+ * @public
1509
+ */
1510
+ export const receiveMapConfigUpdater = (
1511
+ state: VisState,
1512
+ {
1513
+ payload: {config = {version: ''}, options = {}}
1514
+ }: {
1515
+ type?: typeof ActionTypes.RECEIVE_MAP_CONFIG;
1516
+ payload: ReceiveMapConfigPayload;
1517
+ }
1518
+ ): VisState => {
1519
+ if (!config.visState) {
1520
+ return state;
1521
+ }
1522
+
1523
+ const {keepExistingConfig} = options;
1524
+
1525
+ // reset config if keepExistingConfig is falsy
1526
+ let mergedState = !keepExistingConfig ? resetMapConfigUpdater(state) : state;
1527
+ for (const merger of state.mergers) {
1528
+ if (isValidMerger(merger) && config.visState[merger.prop]) {
1529
+ mergedState = merger.merge(mergedState, config.visState[merger.prop], true);
1530
+ }
1531
+ }
1532
+
1533
+ return mergedState;
1534
+ };
1535
+
1536
+ /**
1537
+ * Trigger layer hover event with hovered object
1538
+ * @memberof visStateUpdaters
1539
+ * @public
1540
+ */
1541
+ export const layerHoverUpdater = (
1542
+ state: VisState,
1543
+ action: VisStateActions.OnLayerHoverUpdaterAction
1544
+ ): VisState => ({
1545
+ ...state,
1546
+ hoverInfo: action.info
1547
+ });
1548
+
1549
+ /* eslint-enable max-statements */
1550
+
1551
+ /**
1552
+ * Update `interactionConfig`
1553
+ * @memberof visStateUpdaters
1554
+ * @public
1555
+ */
1556
+ export function interactionConfigChangeUpdater(
1557
+ state: VisState,
1558
+ action: VisStateActions.InteractionConfigChangeUpdaterAction
1559
+ ): VisState {
1560
+ const {config} = action;
1561
+
1562
+ const interactionConfig = {
1563
+ ...state.interactionConfig,
1564
+ ...{[config.id]: config}
1565
+ };
1566
+
1567
+ // Don't enable tooltip and brush at the same time
1568
+ // but coordinates can be shown at all time
1569
+ const contradict = ['brush', 'tooltip'];
1570
+
1571
+ if (
1572
+ contradict.includes(config.id) &&
1573
+ config.enabled &&
1574
+ !state.interactionConfig[config.id].enabled
1575
+ ) {
1576
+ // only enable one interaction at a time
1577
+ contradict.forEach(k => {
1578
+ if (k !== config.id) {
1579
+ interactionConfig[k] = {...interactionConfig[k], enabled: false};
1580
+ }
1581
+ });
1582
+ }
1583
+
1584
+ const newState = {
1585
+ ...state,
1586
+ interactionConfig
1587
+ };
1588
+
1589
+ if (config.id === 'geocoder' && !config.enabled) {
1590
+ return removeDatasetUpdater(newState, {dataId: 'geocoder_dataset'});
1591
+ }
1592
+
1593
+ return newState;
1594
+ }
1595
+
1596
+ /**
1597
+ * Trigger layer click event with clicked object
1598
+ * @memberof visStateUpdaters
1599
+ * @public
1600
+ */
1601
+ export const layerClickUpdater = (
1602
+ state: VisState,
1603
+ action: VisStateActions.OnLayerClickUpdaterAction
1604
+ ): VisState => ({
1605
+ ...state,
1606
+ mousePos: state.interactionConfig.coordinate.enabled
1607
+ ? {
1608
+ ...state.mousePos,
1609
+ pinned: state.mousePos.pinned ? null : cloneDeep(state.mousePos)
1610
+ }
1611
+ : state.mousePos,
1612
+ clicked: action.info && action.info.picked ? action.info : null
1613
+ });
1614
+
1615
+ /**
1616
+ * Trigger map click event, unselect clicked object
1617
+ * @memberof visStateUpdaters
1618
+ * @public
1619
+ */
1620
+ export const mapClickUpdater = (
1621
+ state: VisState,
1622
+ action: VisStateActions.OnMapClickUpdaterAction
1623
+ ): VisState => {
1624
+ return {
1625
+ ...state,
1626
+ clicked: null
1627
+ };
1628
+ };
1629
+
1630
+ /**
1631
+ * Trigger map move event
1632
+ * @memberof visStateUpdaters
1633
+ * @public
1634
+ */
1635
+ export const mouseMoveUpdater = (
1636
+ state: VisState,
1637
+ {evt}: VisStateActions.OnMouseMoveUpdaterAction
1638
+ ): VisState => {
1639
+ if (Object.values(state.interactionConfig).some(config => config.enabled)) {
1640
+ return {
1641
+ ...state,
1642
+ mousePos: {
1643
+ ...state.mousePos,
1644
+ mousePosition: [...evt.point],
1645
+ coordinate: [...evt.lngLat]
1646
+ }
1647
+ };
1648
+ }
1649
+
1650
+ return state;
1651
+ };
1652
+ /**
1653
+ * Toggle visibility of a layer for a split map
1654
+ * @memberof visStateUpdaters
1655
+ * @public
1656
+ */
1657
+ export const toggleSplitMapUpdater = (
1658
+ state: VisState,
1659
+ action: MapStateActions.ToggleSplitMapUpdaterAction
1660
+ ): VisState =>
1661
+ state.splitMaps && state.splitMaps.length === 0
1662
+ ? {
1663
+ ...state,
1664
+ // maybe we should use an array to store state for a single map as well
1665
+ // if current maps length is equal to 0 it means that we are about to split the view
1666
+ splitMaps: computeSplitMapLayers(state.layers)
1667
+ }
1668
+ : closeSpecificMapAtIndex(state, action);
1669
+
1670
+ /**
1671
+ * Toggle visibility of a layer in a split map
1672
+ * @memberof visStateUpdaters
1673
+ * @public
1674
+ */
1675
+ export const toggleLayerForMapUpdater = (
1676
+ state: VisState,
1677
+ {mapIndex, layerId}: VisStateActions.ToggleLayerForMapUpdaterAction
1678
+ ): VisState => {
1679
+ const {splitMaps} = state;
1680
+
1681
+ return {
1682
+ ...state,
1683
+ splitMaps: splitMaps.map((sm, i) =>
1684
+ i === mapIndex
1685
+ ? {
1686
+ ...splitMaps[i],
1687
+ layers: {
1688
+ ...splitMaps[i].layers,
1689
+ // if layerId not in layers, set it to visible
1690
+ [layerId]: !splitMaps[i].layers[layerId]
1691
+ }
1692
+ }
1693
+ : sm
1694
+ )
1695
+ };
1696
+ };
1697
+
1698
+ /**
1699
+ * Add new dataset to `visState`, with option to load a map config along with the datasets
1700
+ * @memberof visStateUpdaters
1701
+ * @public
1702
+ */
1703
+ /* eslint-disable max-statements */
1704
+ // eslint-disable-next-line complexity
1705
+ export const updateVisDataUpdater = (
1706
+ state: VisState,
1707
+ action: VisStateActions.UpdateVisDataUpdaterAction
1708
+ ): VisState => {
1709
+ // datasets can be a single data entries or an array of multiple data entries
1710
+ const {config, options} = action;
1711
+ const datasets = toArray(action.datasets);
1712
+
1713
+ const newDataEntries = datasets.reduce(
1714
+ (accu, {info = {}, ...rest} = {}) => ({
1715
+ ...accu,
1716
+ ...(createNewDataEntry({info, ...rest}, state.datasets) || {})
1717
+ }),
1718
+ {}
1719
+ );
1720
+
1721
+ const dataEmpty = Object.keys(newDataEntries).length < 1;
1722
+
1723
+ // apply config if passed from action
1724
+ const previousState = config
1725
+ ? receiveMapConfigUpdater(state, {
1726
+ payload: {config, options}
1727
+ })
1728
+ : state;
1729
+
1730
+ let mergedState = {
1731
+ ...previousState,
1732
+ datasets: {
1733
+ ...previousState.datasets,
1734
+ ...newDataEntries
1735
+ }
1736
+ };
1737
+
1738
+ // merge state with config to be merged
1739
+ for (const merger of mergedState.mergers) {
1740
+ if (isValidMerger(merger) && merger.toMergeProp && mergedState[merger.toMergeProp]) {
1741
+ const toMerge = mergedState[merger.toMergeProp];
1742
+ mergedState[merger.toMergeProp] = INITIAL_VIS_STATE[merger.toMergeProp];
1743
+ mergedState = merger.merge(mergedState, toMerge);
1744
+ }
1745
+ }
1746
+
1747
+ let newLayers = !dataEmpty
1748
+ ? mergedState.layers.filter(l => l.config.dataId && l.config.dataId in newDataEntries)
1749
+ : [];
1750
+
1751
+ if (!newLayers.length && (options || {}).autoCreateLayers !== false) {
1752
+ // no layer merged, find defaults
1753
+ const result = addDefaultLayers(mergedState, newDataEntries);
1754
+ mergedState = result.state;
1755
+ newLayers = result.newLayers;
1756
+ }
1757
+
1758
+ if (mergedState.splitMaps.length) {
1759
+ // if map is split, add new layers to splitMaps
1760
+ newLayers = mergedState.layers.filter(
1761
+ l => l.config.dataId && l.config.dataId in newDataEntries
1762
+ );
1763
+ mergedState = {
1764
+ ...mergedState,
1765
+ splitMaps: addNewLayersToSplitMap(mergedState.splitMaps, newLayers)
1766
+ };
1767
+ }
1768
+
1769
+ // if no tooltips merged add default tooltips
1770
+ Object.keys(newDataEntries).forEach(dataId => {
1771
+ const tooltipFields = mergedState.interactionConfig.tooltip.config.fieldsToShow[dataId];
1772
+ if (!Array.isArray(tooltipFields) || !tooltipFields.length) {
1773
+ mergedState = addDefaultTooltips(mergedState, newDataEntries[dataId]);
1774
+ }
1775
+ });
1776
+
1777
+ let updatedState = updateAllLayerDomainData(
1778
+ mergedState,
1779
+ dataEmpty ? Object.keys(mergedState.datasets) : Object.keys(newDataEntries),
1780
+ undefined
1781
+ );
1782
+
1783
+ // register layer animation domain,
1784
+ // need to be called after layer data is calculated
1785
+ updatedState = updateAnimationDomain(updatedState);
1786
+
1787
+ return updatedState;
1788
+ };
1789
+ /* eslint-enable max-statements */
1790
+
1791
+ /**
1792
+ * Rename an existing dataset in `visState`
1793
+ * @memberof visStateUpdaters
1794
+ * @public
1795
+ */
1796
+ export function renameDatasetUpdater(
1797
+ state: VisState,
1798
+ action: VisStateActions.RenameDatasetUpdaterAction
1799
+ ): VisState {
1800
+ const {dataId, label} = action;
1801
+ const {datasets} = state;
1802
+ const existing = datasets[dataId];
1803
+ // @ts-ignore
1804
+ return existing
1805
+ ? {
1806
+ ...state,
1807
+ datasets: {
1808
+ ...datasets,
1809
+ [dataId]: {
1810
+ ...existing,
1811
+ label
1812
+ }
1813
+ }
1814
+ }
1815
+ : // No-op if the dataset doesn't exist
1816
+ state;
1817
+ }
1818
+
1819
+ /**
1820
+ * When a user clicks on the specific map closing icon
1821
+ * the application will close the selected map
1822
+ * and will merge the remaining one with the global state
1823
+ * TODO: i think in the future this action should be called merge map layers with global settings
1824
+ * @param {Object} state `visState`
1825
+ * @param {Object} action action
1826
+ * @returns {Object} nextState
1827
+ */
1828
+ export function closeSpecificMapAtIndex(
1829
+ state: VisState,
1830
+ action: MapStateActions.ToggleSplitMapUpdaterAction
1831
+ ): VisState {
1832
+ // retrieve layers meta data from the remaining map that we need to keep
1833
+ const indexToRetrieve = 1 - action.payload;
1834
+ const mapLayers = state.splitMaps[indexToRetrieve].layers;
1835
+ const {layers} = state;
1836
+
1837
+ // update layer visibility
1838
+ const newLayers = layers.map(layer =>
1839
+ !mapLayers[layer.id] && layer.config.isVisible
1840
+ ? layer.updateLayerConfig({
1841
+ // if layer.id is not in mapLayers, it should be inVisible
1842
+ isVisible: false
1843
+ })
1844
+ : layer
1845
+ );
1846
+
1847
+ // delete map
1848
+ return {
1849
+ ...state,
1850
+ layers: newLayers,
1851
+ splitMaps: []
1852
+ };
1853
+ }
1854
+
1855
+ /**
1856
+ * Trigger file loading dispatch `addDataToMap` if succeed, or `loadFilesErr` if failed
1857
+ * @memberof visStateUpdaters
1858
+ * @public
1859
+ */
1860
+ export const loadFilesUpdater = (
1861
+ state: VisState,
1862
+ action: VisStateActions.LoadFilesUpdaterAction
1863
+ ): VisState => {
1864
+ const {files, onFinish = loadFilesSuccess} = action;
1865
+ if (!files.length) {
1866
+ return state;
1867
+ }
1868
+
1869
+ const fileLoadingProgress = Array.from(files).reduce(
1870
+ (accu, f, i) => merge_(initialFileLoadingProgress(f, i))(accu),
1871
+ {}
1872
+ );
1873
+
1874
+ const fileLoading = {
1875
+ fileCache: [],
1876
+ filesToLoad: files,
1877
+ onFinish
1878
+ };
1879
+
1880
+ const nextState = merge_({fileLoadingProgress, fileLoading})(state);
1881
+
1882
+ return loadNextFileUpdater(nextState);
1883
+ };
1884
+
1885
+ /**
1886
+ * Sucessfully loaded one file, move on to the next one
1887
+ * @memberof visStateUpdaters
1888
+ * @public
1889
+ */
1890
+ export function loadFileStepSuccessUpdater(
1891
+ state: VisState,
1892
+ action: VisStateActions.LoadFileStepSuccessAction
1893
+ ): VisState {
1894
+ if (!state.fileLoading) {
1895
+ return state;
1896
+ }
1897
+ const {fileName, fileCache} = action;
1898
+ const {filesToLoad, onFinish} = state.fileLoading;
1899
+ const stateWithProgress = updateFileLoadingProgressUpdater(state, {
1900
+ fileName,
1901
+ progress: {percent: 1, message: 'Done'}
1902
+ });
1903
+
1904
+ // save processed file to fileCache
1905
+ const stateWithCache = pick_('fileLoading')(merge_({fileCache}))(stateWithProgress);
1906
+
1907
+ return withTask(
1908
+ stateWithCache,
1909
+ DELAY_TASK(200).map(filesToLoad.length ? loadNextFile : () => onFinish(fileCache))
1910
+ );
1911
+ }
1912
+
1913
+ // withTask<T>(state: T, task: any): T
1914
+
1915
+ /**
1916
+ *
1917
+ * @memberof visStateUpdaters
1918
+ * @public
1919
+ */
1920
+ export function loadNextFileUpdater(state: VisState): VisState {
1921
+ if (!state.fileLoading) {
1922
+ return state;
1923
+ }
1924
+ const {filesToLoad} = state.fileLoading;
1925
+ const [file, ...remainingFilesToLoad] = filesToLoad;
1926
+
1927
+ // save filesToLoad to state
1928
+ const nextState = pick_('fileLoading')(merge_({filesToLoad: remainingFilesToLoad}))(state);
1929
+
1930
+ const stateWithProgress = updateFileLoadingProgressUpdater(nextState, {
1931
+ fileName: file.name,
1932
+ progress: {percent: 0, message: 'loading...'}
1933
+ });
1934
+
1935
+ const {loaders, loadOptions} = state;
1936
+ return withTask(
1937
+ stateWithProgress,
1938
+ makeLoadFileTask(
1939
+ file,
1940
+ nextState.fileLoading && nextState.fileLoading.fileCache,
1941
+ loaders,
1942
+ loadOptions
1943
+ )
1944
+ );
1945
+ }
1946
+
1947
+ export function makeLoadFileTask(file, fileCache, loaders: LoaderObject[] = [], loadOptions = {}) {
1948
+ return LOAD_FILE_TASK({file, fileCache, loaders, loadOptions}).bimap(
1949
+ // prettier ignore
1950
+ // success
1951
+ gen =>
1952
+ nextFileBatch({
1953
+ gen,
1954
+ fileName: file.name,
1955
+ onFinish: result =>
1956
+ processFileContent({
1957
+ content: result,
1958
+ fileCache
1959
+ })
1960
+ }),
1961
+
1962
+ // error
1963
+ err => loadFilesErr(file.name, err)
1964
+ );
1965
+ }
1966
+
1967
+ /**
1968
+ *
1969
+ * @memberof visStateUpdaters
1970
+ * @public
1971
+ */
1972
+ export function processFileContentUpdater(
1973
+ state: VisState,
1974
+ action: VisStateActions.ProcessFileContentUpdaterAction
1975
+ ): VisState {
1976
+ const {content, fileCache} = action.payload;
1977
+
1978
+ const stateWithProgress = updateFileLoadingProgressUpdater(state, {
1979
+ fileName: content.fileName,
1980
+ progress: {percent: 1, message: 'processing...'}
1981
+ });
1982
+
1983
+ return withTask(
1984
+ stateWithProgress,
1985
+ PROCESS_FILE_DATA({content, fileCache}).bimap(
1986
+ result => loadFileStepSuccess({fileName: content.fileName, fileCache: result}),
1987
+ err => loadFilesErr(content.fileName, err)
1988
+ )
1989
+ );
1990
+ }
1991
+
1992
+ export function parseProgress(prevProgress = {}, progress) {
1993
+ // This happens when receiving query metadata or other cases we don't
1994
+ // have an update for the user.
1995
+ if (!progress || !progress.percent) {
1996
+ return {};
1997
+ }
1998
+
1999
+ return {
2000
+ percent: progress.percent
2001
+ };
2002
+ }
2003
+
2004
+ /**
2005
+ * gets called with payload = AsyncGenerator<???>
2006
+ * @memberof visStateUpdaters
2007
+ * @public
2008
+ */
2009
+ export const nextFileBatchUpdater = (
2010
+ state: VisState,
2011
+ {
2012
+ payload: {gen, fileName, progress, accumulated, onFinish}
2013
+ }: VisStateActions.NextFileBatchUpdaterAction
2014
+ ): VisState => {
2015
+ const stateWithProgress = updateFileLoadingProgressUpdater(state, {
2016
+ fileName,
2017
+ progress: parseProgress(state.fileLoadingProgress[fileName], progress)
2018
+ });
2019
+ return withTask(
2020
+ stateWithProgress,
2021
+ UNWRAP_TASK(gen.next()).bimap(
2022
+ ({value, done}) => {
2023
+ return done
2024
+ ? onFinish(accumulated)
2025
+ : nextFileBatch({
2026
+ gen,
2027
+ fileName,
2028
+ progress: value.progress,
2029
+ accumulated: value,
2030
+ onFinish
2031
+ });
2032
+ },
2033
+ err => loadFilesErr(fileName, err)
2034
+ )
2035
+ );
2036
+ };
2037
+
2038
+ /**
2039
+ * Trigger loading file error
2040
+ * @memberof visStateUpdaters
2041
+ * @public
2042
+ */
2043
+ export const loadFilesErrUpdater = (
2044
+ state: VisState,
2045
+ {error, fileName}: VisStateActions.LoadFilesErrUpdaterAction
2046
+ ): VisState => {
2047
+ // update ui with error message
2048
+ Console.warn(error);
2049
+ if (!state.fileLoading) {
2050
+ return state;
2051
+ }
2052
+ const {filesToLoad, onFinish, fileCache} = state.fileLoading;
2053
+
2054
+ const nextState = updateFileLoadingProgressUpdater(state, {
2055
+ fileName,
2056
+ progress: {error}
2057
+ });
2058
+
2059
+ // kick off next file or finish
2060
+ return withTask(
2061
+ nextState,
2062
+ DELAY_TASK(200).map(filesToLoad.length ? loadNextFile : () => onFinish(fileCache))
2063
+ );
2064
+ };
2065
+
2066
+ /**
2067
+ * When select dataset for export, apply cpu filter to selected dataset
2068
+ * @memberof visStateUpdaters
2069
+ * @public
2070
+ */
2071
+ export const applyCPUFilterUpdater = (
2072
+ state: VisState,
2073
+ {dataId}: VisStateActions.ApplyCPUFilterUpdaterAction
2074
+ ): VisState => {
2075
+ // apply cpuFilter
2076
+ const dataIds = toArray(dataId);
2077
+
2078
+ return dataIds.reduce((accu, id) => filterDatasetCPU(accu, id), state);
2079
+ };
2080
+
2081
+ /**
2082
+ * User input to update the info of the map
2083
+ * @memberof visStateUpdaters
2084
+ * @public
2085
+ */
2086
+ export const setMapInfoUpdater = (
2087
+ state: VisState,
2088
+ action: VisStateActions.SetMapInfoUpdaterAction
2089
+ ): VisState => ({
2090
+ ...state,
2091
+ mapInfo: {
2092
+ ...state.mapInfo,
2093
+ ...action.info
2094
+ }
2095
+ });
2096
+ /**
2097
+ * Helper function to update All layer domain and layer data of state
2098
+ */
2099
+ export function addDefaultLayers(
2100
+ state: VisState,
2101
+ datasets: Datasets
2102
+ ): {state: VisState; newLayers: Layer[]} {
2103
+ const empty: Layer[] = [];
2104
+ const defaultLayers = Object.values(datasets).reduce((accu, dataset) => {
2105
+ const foundLayers = findDefaultLayer(dataset, state.layerClasses);
2106
+ return foundLayers && foundLayers.length ? accu.concat(foundLayers) : accu;
2107
+ }, empty);
2108
+
2109
+ return {
2110
+ state: {
2111
+ ...state,
2112
+ layers: [...state.layers, ...defaultLayers],
2113
+ layerOrder: [
2114
+ // put new layers on top of old ones
2115
+ ...defaultLayers.map((_, i) => state.layers.length + i),
2116
+ ...state.layerOrder
2117
+ ]
2118
+ },
2119
+ newLayers: defaultLayers
2120
+ };
2121
+ }
2122
+
2123
+ /**
2124
+ * helper function to find default tooltips
2125
+ * @param {Object} state
2126
+ * @param {Object} dataset
2127
+ * @returns {Object} nextState
2128
+ */
2129
+ export function addDefaultTooltips(state, dataset) {
2130
+ const tooltipFields = dataset.metadata.isDynamicSpatialIndex
2131
+ ? {[dataset.id]: []}
2132
+ : findFieldsToShow({
2133
+ ...dataset,
2134
+ maxDefaultTooltips: state.maxDefaultTooltips
2135
+ });
2136
+ const merged = {
2137
+ ...state.interactionConfig.tooltip.config.fieldsToShow,
2138
+ ...tooltipFields
2139
+ };
2140
+
2141
+ return set(['interactionConfig', 'tooltip', 'config', 'fieldsToShow'], merged, state);
2142
+ }
2143
+
2144
+ export function initialFileLoadingProgress(file, index) {
2145
+ const fileName = file.name || `Untitled File ${index}`;
2146
+ return {
2147
+ [fileName]: {
2148
+ // percent of current file
2149
+ percent: 0,
2150
+ message: '',
2151
+ fileName,
2152
+ error: null
2153
+ }
2154
+ };
2155
+ }
2156
+
2157
+ export function updateFileLoadingProgressUpdater(state, {fileName, progress}) {
2158
+ return pick_('fileLoadingProgress')(pick_(fileName)(merge_(progress)))(state);
2159
+ }
2160
+ /**
2161
+ * Helper function to update layer domains for an array of datasets
2162
+ */
2163
+ export function updateAllLayerDomainData(
2164
+ state: VisState,
2165
+ dataId: string | string[],
2166
+ updatedFilter?: Filter
2167
+ ): VisState {
2168
+ const dataIds = typeof dataId === 'string' ? [dataId] : dataId;
2169
+ const newLayers: Layer[] = [];
2170
+ const newLayerData: any[] = [];
2171
+
2172
+ state.layers.forEach((oldLayer, i) => {
2173
+ if (oldLayer.config.dataId && dataIds.includes(oldLayer.config.dataId)) {
2174
+ // No need to recalculate layer domain if filter has fixed domain
2175
+ const newLayer =
2176
+ updatedFilter && updatedFilter.fixedDomain
2177
+ ? oldLayer
2178
+ : oldLayer.updateLayerDomain(state.datasets, updatedFilter);
2179
+
2180
+ const {layerData, layer} = calculateLayerData(newLayer, state, state.layerData[i]);
2181
+
2182
+ newLayers.push(layer);
2183
+ newLayerData.push(layerData);
2184
+ } else {
2185
+ newLayers.push(oldLayer);
2186
+ newLayerData.push(state.layerData[i]);
2187
+ }
2188
+ });
2189
+
2190
+ const newState = {
2191
+ ...state,
2192
+ layers: newLayers,
2193
+ layerData: newLayerData
2194
+ };
2195
+
2196
+ return newState;
2197
+ }
2198
+
2199
+ export function updateAnimationDomain(state: VisState): VisState {
2200
+ // merge all animatable layer domain and update global config
2201
+ const animatableLayers = state.layers.filter(
2202
+ l =>
2203
+ l.config.isVisible &&
2204
+ l.config.animation &&
2205
+ l.config.animation.enabled &&
2206
+ // @ts-expect-error
2207
+ Array.isArray(l.animationDomain)
2208
+ );
2209
+
2210
+ if (!animatableLayers.length) {
2211
+ return {
2212
+ ...state,
2213
+ animationConfig: {
2214
+ ...state.animationConfig,
2215
+ domain: null,
2216
+ defaultTimeFormat: null
2217
+ }
2218
+ };
2219
+ }
2220
+
2221
+ const mergedDomain: [number, number] = animatableLayers.reduce(
2222
+ (accu, layer) => [
2223
+ // @ts-expect-error
2224
+ Math.min(accu[0], layer.animationDomain[0]),
2225
+ // @ts-expect-error
2226
+ Math.max(accu[1], layer.animationDomain[1])
2227
+ ],
2228
+ [Number(Infinity), -Infinity]
2229
+ );
2230
+ const defaultTimeFormat = getTimeWidgetTitleFormatter(mergedDomain);
2231
+
2232
+ return {
2233
+ ...state,
2234
+ animationConfig: {
2235
+ ...state.animationConfig,
2236
+ currentTime: isInRange(state.animationConfig.currentTime, mergedDomain)
2237
+ ? state.animationConfig.currentTime
2238
+ : mergedDomain[0],
2239
+ domain: mergedDomain,
2240
+ defaultTimeFormat
2241
+ }
2242
+ };
2243
+ }
2244
+
2245
+ /**
2246
+ * Update the status of the editor
2247
+ * @memberof visStateUpdaters
2248
+ */
2249
+ export const setEditorModeUpdater = (
2250
+ state: VisState,
2251
+ {mode}: VisStateActions.SetEditorModeUpdaterAction
2252
+ ): VisState => ({
2253
+ ...state,
2254
+ editor: {
2255
+ ...state.editor,
2256
+ mode,
2257
+ selectedFeature: null
2258
+ }
2259
+ });
2260
+
2261
+ // const featureToFilterValue = (feature) => ({...feature, id: feature.id});
2262
+ /**
2263
+ * Update editor features
2264
+ * @memberof visStateUpdaters
2265
+ */
2266
+ export function setFeaturesUpdater(
2267
+ state: VisState,
2268
+ {features = []}: VisStateActions.SetFeaturesUpdaterAction
2269
+ ): VisState {
2270
+ const lastFeature = features.length && features[features.length - 1];
2271
+
2272
+ const newState = {
2273
+ ...state,
2274
+ editor: {
2275
+ ...state.editor,
2276
+ // only save none filter features to editor
2277
+ features: features.filter(f => !getFilterIdInFeature(f)),
2278
+ mode: lastFeature && lastFeature.properties.isClosed ? EDITOR_MODES.EDIT : state.editor.mode
2279
+ }
2280
+ };
2281
+
2282
+ // Retrieve existing feature
2283
+ const {selectedFeature} = state.editor;
2284
+
2285
+ // If no feature is selected we can simply return since no operations
2286
+ if (!selectedFeature) {
2287
+ return newState;
2288
+ }
2289
+
2290
+ // TODO: check if the feature has changed
2291
+ const feature = features.find(f => f.id === selectedFeature.id);
2292
+
2293
+ // if feature is part of a filter
2294
+ const filterId = feature && getFilterIdInFeature(feature);
2295
+ if (filterId && feature) {
2296
+ const featureValue = featureToFilterValue(feature, filterId);
2297
+ const filterIdx = state.filters.findIndex(fil => fil.id === filterId);
2298
+ return setFilterUpdater(newState, {
2299
+ idx: filterIdx,
2300
+ prop: 'value',
2301
+ value: featureValue
2302
+ });
2303
+ }
2304
+
2305
+ return newState;
2306
+ }
2307
+
2308
+ /**
2309
+ * Set the current selected feature
2310
+ * @memberof uiStateUpdaters
2311
+ */
2312
+ export const setSelectedFeatureUpdater = (
2313
+ state: VisState,
2314
+ {feature}: VisStateActions.SetSelectedFeatureUpdaterAction
2315
+ ): VisState => ({
2316
+ ...state,
2317
+ editor: {
2318
+ ...state.editor,
2319
+ selectedFeature: feature
2320
+ }
2321
+ });
2322
+
2323
+ /**
2324
+ * Delete existing feature from filters
2325
+ * @memberof visStateUpdaters
2326
+ */
2327
+ export function deleteFeatureUpdater(
2328
+ state: VisState,
2329
+ {feature}: VisStateActions.DeleteFeatureUpdaterAction
2330
+ ): VisState {
2331
+ if (!feature) {
2332
+ return state;
2333
+ }
2334
+
2335
+ const newState = {
2336
+ ...state,
2337
+ editor: {
2338
+ ...state.editor,
2339
+ selectedFeature: null
2340
+ }
2341
+ };
2342
+
2343
+ if (getFilterIdInFeature(feature)) {
2344
+ const filterIdx = newState.filters.findIndex(f => f.id === getFilterIdInFeature(feature));
2345
+
2346
+ return filterIdx > -1 ? removeFilterUpdater(newState, {idx: filterIdx}) : newState;
2347
+ }
2348
+
2349
+ // modify editor object
2350
+ const newEditor = {
2351
+ ...state.editor,
2352
+ features: state.editor.features.filter(f => f.id !== feature.id),
2353
+ selectedFeature: null
2354
+ };
2355
+
2356
+ return {
2357
+ ...state,
2358
+ editor: newEditor
2359
+ };
2360
+ }
2361
+
2362
+ /**
2363
+ * Toggle feature as layer filter
2364
+ * @memberof visStateUpdaters
2365
+ */
2366
+ export function setPolygonFilterLayerUpdater(
2367
+ state: VisState,
2368
+ payload: VisStateActions.SetPolygonFilterLayerUpdaterAction
2369
+ ): VisState {
2370
+ const {layer, feature} = payload;
2371
+ const filterId = getFilterIdInFeature(feature);
2372
+
2373
+ // let newFilter = null;
2374
+ let filterIdx;
2375
+ let newLayerId = [layer.id];
2376
+ let newState = state;
2377
+ // If polygon filter already exists, we need to find out if the current layer is already included
2378
+ if (filterId) {
2379
+ filterIdx = state.filters.findIndex(f => f.id === filterId);
2380
+
2381
+ if (!state.filters[filterIdx]) {
2382
+ // what if filter doesn't exist?... not possible.
2383
+ // because features in the editor is passed in from filters and editors.
2384
+ // but we will move this feature back to editor just in case
2385
+ const noneFilterFeature = {
2386
+ ...feature,
2387
+ properties: {
2388
+ ...feature.properties,
2389
+ filterId: null
2390
+ }
2391
+ };
2392
+
2393
+ return {
2394
+ ...state,
2395
+ editor: {
2396
+ ...state.editor,
2397
+ features: [...state.editor.features, noneFilterFeature],
2398
+ selectedFeature: noneFilterFeature
2399
+ }
2400
+ };
2401
+ }
2402
+ const filter = state.filters[filterIdx];
2403
+ const {layerId = []} = filter;
2404
+ const isLayerIncluded = layerId.includes(layer.id);
2405
+
2406
+ newLayerId = isLayerIncluded
2407
+ ? // if layer is included, remove it
2408
+ layerId.filter(l => l !== layer.id)
2409
+ : [...layerId, layer.id];
2410
+ } else {
2411
+ // if we haven't create the polygon filter, create it
2412
+ const newFilter = generatePolygonFilter([], feature);
2413
+ filterIdx = state.filters.length;
2414
+
2415
+ // add feature, remove feature from eidtor
2416
+ newState = {
2417
+ ...state,
2418
+ filters: [...state.filters, newFilter],
2419
+ editor: {
2420
+ ...state.editor,
2421
+ features: state.editor.features.filter(f => f.id !== feature.id),
2422
+ selectedFeature: newFilter.value
2423
+ }
2424
+ };
2425
+ }
2426
+
2427
+ return setFilterUpdater(newState, {
2428
+ idx: filterIdx,
2429
+ prop: 'layerId',
2430
+ value: newLayerId
2431
+ });
2432
+ }
2433
+
2434
+ /**
2435
+ * @memberof visStateUpdaters
2436
+ * @public
2437
+ */
2438
+ export function sortTableColumnUpdater(
2439
+ state: VisState,
2440
+ {dataId, column, mode}: VisStateActions.SortTableColumnUpdaterAction
2441
+ ): VisState {
2442
+ const dataset = state.datasets[dataId];
2443
+ if (!dataset) {
2444
+ return state;
2445
+ }
2446
+ let sortMode = mode;
2447
+ if (!sortMode) {
2448
+ const currentMode = get(dataset, ['sortColumn', column]);
2449
+ // @ts-ignore - should be fixable in a TS file
2450
+ sortMode = currentMode
2451
+ ? Object.keys(SORT_ORDER).find(m => m !== currentMode)
2452
+ : SORT_ORDER.ASCENDING;
2453
+ }
2454
+
2455
+ const sorted = sortDatasetByColumn(dataset, column, sortMode);
2456
+ return set(['datasets', dataId], sorted, state);
2457
+ }
2458
+
2459
+ /**
2460
+ * @memberof visStateUpdaters
2461
+ * @public
2462
+ */
2463
+ export function pinTableColumnUpdater(
2464
+ state: VisState,
2465
+ {dataId, column}: VisStateActions.PinTableColumnUpdaterAction
2466
+ ): VisState {
2467
+ const dataset = state.datasets[dataId];
2468
+ if (!dataset) {
2469
+ return state;
2470
+ }
2471
+ const newDataset = pinTableColumns(dataset, column);
2472
+
2473
+ return set(['datasets', dataId], newDataset, state);
2474
+ }
2475
+
2476
+ /**
2477
+ * Copy column content as strings
2478
+ * @memberof visStateUpdaters
2479
+ * @public
2480
+ */
2481
+ export function copyTableColumnUpdater(
2482
+ state: VisState,
2483
+ {dataId, column}: VisStateActions.CopyTableColumnUpdaterAction
2484
+ ): VisState {
2485
+ const dataset = state.datasets[dataId];
2486
+ if (!dataset) {
2487
+ return state;
2488
+ }
2489
+ const fieldIdx = dataset.fields.findIndex(f => f.name === column);
2490
+ if (fieldIdx < 0) {
2491
+ return state;
2492
+ }
2493
+ const {type} = dataset.fields[fieldIdx];
2494
+ const text = dataset.dataContainer
2495
+ .map(row => parseFieldValue(row.valueAt(fieldIdx), type), true)
2496
+ .join('\n');
2497
+
2498
+ copy(text);
2499
+
2500
+ return state;
2501
+ }
2502
+
2503
+ /**
2504
+ * Update editor
2505
+ */
2506
+ export function toggleEditorVisibilityUpdater(
2507
+ state: VisState,
2508
+ action: VisStateActions.ToggleEditorVisibilityUpdaterAction
2509
+ ): VisState {
2510
+ return {
2511
+ ...state,
2512
+ editor: {
2513
+ ...state.editor,
2514
+ visible: !state.editor.visible
2515
+ }
2516
+ };
2517
+ }
2518
+
2519
+ export function setFilterAnimationTimeConfigUpdater(
2520
+ state: VisState,
2521
+ {idx, config}: VisStateActions.SetFilterAnimationTimeConfigAction
2522
+ ): VisState {
2523
+ const oldFilter = state.filters[idx];
2524
+ if (!oldFilter) {
2525
+ Console.error(`filters.${idx} is undefined`);
2526
+ return state;
2527
+ }
2528
+ if (oldFilter.type !== FILTER_TYPES.timeRange) {
2529
+ Console.error(
2530
+ `setFilterAnimationTimeConfig can only be called to update a time filter. check filter.type === 'timeRange'`
2531
+ );
2532
+ return state;
2533
+ }
2534
+
2535
+ const updates = checkTimeConfigArgs(config);
2536
+
2537
+ return pick_('filters')(swap_(merge_(updates)(oldFilter)))(state);
2538
+ }
2539
+
2540
+ function checkTimeConfigArgs(config) {
2541
+ const allowed = ['timeFormat', 'timezone'];
2542
+ return Object.keys(config).reduce((accu, prop) => {
2543
+ if (!allowed.includes(prop)) {
2544
+ Console.error(
2545
+ `setLayerAnimationTimeConfig takes timeFormat and/or timezone as options, found ${prop}`
2546
+ );
2547
+ return accu;
2548
+ }
2549
+
2550
+ // here we are NOT checking if timezone or timeFormat input is valid
2551
+ accu[prop] = config[prop];
2552
+ return accu;
2553
+ }, {});
2554
+ }
2555
+ /**
2556
+ * Update editor
2557
+ */
2558
+ export function setLayerAnimationTimeConfigUpdater(
2559
+ state: VisState,
2560
+ {config}: VisStateActions.SetLayerAnimationTimeConfigAction
2561
+ ): VisState {
2562
+ if (!config) {
2563
+ return state;
2564
+ }
2565
+ const updates = checkTimeConfigArgs(config);
2566
+ return pick_('animationConfig')(merge_(updates))(state);
2567
+ }