@carto/kepler.gl 0.0.80 → 0.1.0-alpha.0

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 (1724) hide show
  1. package/README.md +652 -42
  2. package/dist/actions/action-wrapper.d.ts +115 -0
  3. package/dist/actions/actions.d.ts +195 -0
  4. package/dist/actions/identity-actions.d.ts +61 -0
  5. package/dist/actions/index.d.ts +9 -0
  6. package/dist/actions/map-state-actions.d.ts +69 -0
  7. package/dist/actions/map-style-actions.d.ts +146 -0
  8. package/dist/actions/provider-actions.d.ts +153 -0
  9. package/dist/actions/ui-state-actions.d.ts +300 -0
  10. package/dist/actions/vis-state-actions.d.ts +821 -0
  11. package/dist/bundle.js +54227 -0
  12. package/dist/bundle.js.map +1 -0
  13. package/dist/cloud-providers/index.d.ts +2 -0
  14. package/dist/cloud-providers/provider.d.ts +176 -0
  15. package/dist/components/bottom-widget.d.ts +47 -0
  16. package/dist/components/common/action-panel.d.ts +27 -0
  17. package/dist/components/common/animation-control/animation-control.d.ts +24 -0
  18. package/dist/components/common/animation-control/animation-controller.d.ts +16 -0
  19. package/dist/components/common/animation-control/animation-speed-slider.d.ts +12 -0
  20. package/dist/components/common/animation-control/floating-time-display.d.ts +9 -0
  21. package/dist/components/common/animation-control/playback-controls.d.ts +72 -0
  22. package/dist/components/common/animation-control/speed-control.d.ts +13 -0
  23. package/dist/components/common/checkbox.d.ts +35 -0
  24. package/dist/components/common/color-legend.d.ts +43 -0
  25. package/dist/components/common/data-table/button.d.ts +8 -0
  26. package/dist/components/common/data-table/canvas.d.ts +2 -0
  27. package/dist/components/common/data-table/cell-size.d.ts +36 -0
  28. package/dist/components/common/data-table/grid.d.ts +7 -0
  29. package/dist/components/common/data-table/index.d.ts +143 -0
  30. package/dist/components/common/data-table/option-dropdown.d.ts +14 -0
  31. package/dist/components/common/dataset-label.d.ts +10 -0
  32. package/dist/components/common/error-boundary.d.ts +16 -0
  33. package/dist/components/common/field-selector.d.ts +47 -0
  34. package/dist/components/common/field-token.d.ts +45 -0
  35. package/dist/components/common/file-uploader/file-drop.d.ts +54 -0
  36. package/dist/components/common/file-uploader/file-upload-progress.d.ts +8 -0
  37. package/dist/components/common/file-uploader/file-upload.d.ts +27 -0
  38. package/dist/components/common/file-uploader/upload-button.d.ts +8 -0
  39. package/dist/components/common/histogram-plot.d.ts +3 -0
  40. package/dist/components/common/icons/add.d.ts +9 -0
  41. package/dist/components/common/icons/anchor_window.d.ts +11 -0
  42. package/dist/components/common/icons/arrow-down-alt.d.ts +9 -0
  43. package/dist/components/common/icons/arrow-down-solid.d.ts +9 -0
  44. package/dist/components/common/icons/arrow-down.d.ts +9 -0
  45. package/dist/components/common/icons/arrow-left.d.ts +9 -0
  46. package/dist/components/common/icons/arrow-right.d.ts +9 -0
  47. package/dist/components/common/icons/arrow-up-alt.d.ts +9 -0
  48. package/dist/components/common/icons/arrow-up-solid.d.ts +9 -0
  49. package/dist/components/common/icons/arrow-up.d.ts +9 -0
  50. package/dist/components/common/icons/base.d.ts +29 -0
  51. package/dist/components/common/icons/bug.d.ts +9 -0
  52. package/dist/components/common/icons/cancel.d.ts +9 -0
  53. package/dist/components/common/icons/checkmark.d.ts +10 -0
  54. package/dist/components/common/icons/clipboard.d.ts +9 -0
  55. package/dist/components/common/icons/clock.d.ts +9 -0
  56. package/dist/components/common/icons/close.d.ts +9 -0
  57. package/dist/components/common/icons/code-alt.d.ts +9 -0
  58. package/dist/components/common/icons/copy.d.ts +9 -0
  59. package/dist/components/common/icons/crosshairs.d.ts +9 -0
  60. package/dist/components/common/icons/cube-3d.d.ts +9 -0
  61. package/dist/components/common/icons/cursor-click.d.ts +9 -0
  62. package/dist/components/common/icons/data-table.d.ts +10 -0
  63. package/dist/components/common/icons/db.d.ts +10 -0
  64. package/dist/components/common/icons/delete.d.ts +9 -0
  65. package/dist/components/common/icons/docs.d.ts +9 -0
  66. package/dist/components/common/icons/drag-n-drop.d.ts +9 -0
  67. package/dist/components/common/icons/draw-polygon.d.ts +10 -0
  68. package/dist/components/common/icons/email.d.ts +9 -0
  69. package/dist/components/common/icons/expand.d.ts +9 -0
  70. package/dist/components/common/icons/eye-seen.d.ts +9 -0
  71. package/dist/components/common/icons/eye-unseen.d.ts +9 -0
  72. package/dist/components/common/icons/file-type.d.ts +8 -0
  73. package/dist/components/common/icons/file.d.ts +9 -0
  74. package/dist/components/common/icons/files.d.ts +9 -0
  75. package/dist/components/common/icons/filter-funnel.d.ts +9 -0
  76. package/dist/components/common/icons/free-window.d.ts +11 -0
  77. package/dist/components/common/icons/gear.d.ts +9 -0
  78. package/dist/components/common/icons/hash.d.ts +9 -0
  79. package/dist/components/common/icons/histogram.d.ts +9 -0
  80. package/dist/components/common/icons/index.d.ts +78 -0
  81. package/dist/components/common/icons/info.d.ts +12 -0
  82. package/dist/components/common/icons/layers.d.ts +9 -0
  83. package/dist/components/common/icons/left-arrow.d.ts +9 -0
  84. package/dist/components/common/icons/legend.d.ts +9 -0
  85. package/dist/components/common/icons/line-chart.d.ts +9 -0
  86. package/dist/components/common/icons/login.d.ts +9 -0
  87. package/dist/components/common/icons/logout.d.ts +9 -0
  88. package/dist/components/common/icons/map-icon.d.ts +11 -0
  89. package/dist/components/common/icons/map.d.ts +11 -0
  90. package/dist/components/common/icons/messages.d.ts +9 -0
  91. package/dist/components/common/icons/minus.d.ts +9 -0
  92. package/dist/components/common/icons/order-by-dataset.d.ts +12 -0
  93. package/dist/components/common/icons/order-by-list.d.ts +12 -0
  94. package/dist/components/common/icons/pause.d.ts +9 -0
  95. package/dist/components/common/icons/picture.d.ts +9 -0
  96. package/dist/components/common/icons/pin.d.ts +9 -0
  97. package/dist/components/common/icons/play.d.ts +9 -0
  98. package/dist/components/common/icons/polygon.d.ts +10 -0
  99. package/dist/components/common/icons/rectangle.d.ts +10 -0
  100. package/dist/components/common/icons/reduce.d.ts +9 -0
  101. package/dist/components/common/icons/reset.d.ts +9 -0
  102. package/dist/components/common/icons/rocket.d.ts +9 -0
  103. package/dist/components/common/icons/save.d.ts +9 -0
  104. package/dist/components/common/icons/save2.d.ts +9 -0
  105. package/dist/components/common/icons/search.d.ts +9 -0
  106. package/dist/components/common/icons/settings.d.ts +9 -0
  107. package/dist/components/common/icons/share.d.ts +9 -0
  108. package/dist/components/common/icons/split.d.ts +9 -0
  109. package/dist/components/common/icons/square-select.d.ts +9 -0
  110. package/dist/components/common/icons/table.d.ts +9 -0
  111. package/dist/components/common/icons/trash.d.ts +9 -0
  112. package/dist/components/common/icons/upload.d.ts +9 -0
  113. package/dist/components/common/icons/vert-dots.d.ts +9 -0
  114. package/dist/components/common/icons/vert-three-dots.d.ts +9 -0
  115. package/dist/components/common/icons/warning.d.ts +10 -0
  116. package/dist/components/common/image-preview.d.ts +15 -0
  117. package/dist/components/common/info-helper.d.ts +11 -0
  118. package/dist/components/common/item-selector/accessor.d.ts +7 -0
  119. package/dist/components/common/item-selector/chickleted-input.d.ts +21 -0
  120. package/dist/components/common/item-selector/dropdown-list.d.ts +68 -0
  121. package/dist/components/common/item-selector/item-selector.d.ts +91 -0
  122. package/dist/components/common/item-selector/typeahead.d.ts +115 -0
  123. package/dist/components/common/line-chart.d.ts +34 -0
  124. package/dist/components/common/loading-spinner.d.ts +9 -0
  125. package/dist/components/common/logo.d.ts +8 -0
  126. package/dist/components/common/map-layer-selector.d.ts +13 -0
  127. package/dist/components/common/modal.d.ts +49 -0
  128. package/dist/components/common/portaled.d.ts +527 -0
  129. package/dist/components/common/progress-bar.d.ts +12 -0
  130. package/dist/components/common/range-brush.d.ts +19 -0
  131. package/dist/components/common/range-plot.d.ts +35 -0
  132. package/dist/components/common/range-slider.d.ts +32 -0
  133. package/dist/components/common/slider/mouse-event.d.ts +27 -0
  134. package/dist/components/common/slider/slider-bar-handle.d.ts +29 -0
  135. package/dist/components/common/slider/slider-handle.d.ts +33 -0
  136. package/dist/components/common/slider/slider.d.ts +70 -0
  137. package/dist/components/common/styled-components.d.ts +119 -0
  138. package/dist/components/common/switch.d.ts +16 -0
  139. package/dist/components/common/time-range-slider-time-title.d.ts +9 -0
  140. package/dist/components/common/time-range-slider.d.ts +32 -0
  141. package/dist/components/common/time-slider-marker.d.ts +21 -0
  142. package/dist/components/common/tippy-tooltip.d.ts +4 -0
  143. package/dist/components/common/toolbar-item.d.ts +14 -0
  144. package/dist/components/common/toolbar.d.ts +5 -0
  145. package/dist/components/common/vertical-toolbar.d.ts +3 -0
  146. package/dist/components/container.d.ts +39 -0
  147. package/dist/components/context.d.ts +7 -0
  148. package/dist/components/editor/constants.d.ts +17 -0
  149. package/dist/components/editor/editor.d.ts +29 -0
  150. package/dist/components/editor/feature-action-panel.d.ts +27 -0
  151. package/dist/components/editor/feature-styles.d.ts +24 -0
  152. package/dist/components/editor/handle-style.d.ts +38 -0
  153. package/dist/components/filters/components.d.ts +3 -0
  154. package/dist/components/filters/filter-panels/filter-panel-with-field-select.d.ts +10 -0
  155. package/dist/components/filters/filter-panels/multi-select-filter-panel.d.ts +9 -0
  156. package/dist/components/filters/filter-panels/new-filter-panel.d.ts +12 -0
  157. package/dist/components/filters/filter-panels/polygon-filter-panel.d.ts +9 -0
  158. package/dist/components/filters/filter-panels/range-filter-panel.d.ts +9 -0
  159. package/dist/components/filters/filter-panels/single-select-filter-panel.d.ts +9 -0
  160. package/dist/components/filters/filter-panels/time-range-filter-panel.d.ts +8 -0
  161. package/dist/components/filters/filter-panels/types.d.ts +36 -0
  162. package/dist/components/filters/index.d.ts +5 -0
  163. package/dist/components/filters/multi-select-filter.d.ts +3 -0
  164. package/dist/components/filters/polygon-filter.d.ts +4 -0
  165. package/dist/components/filters/range-filter.d.ts +8 -0
  166. package/dist/components/filters/single-select-filter.d.ts +3 -0
  167. package/dist/components/filters/time-range-filter.d.ts +28 -0
  168. package/dist/components/filters/time-widget.d.ts +14 -0
  169. package/dist/components/filters/types.d.ts +53 -0
  170. package/dist/components/geocoder/geocoder.d.ts +33 -0
  171. package/dist/components/geocoder-panel.d.ts +28 -0
  172. package/dist/components/index.d.ts +165 -0
  173. package/dist/components/injector.d.ts +25 -0
  174. package/dist/components/kepler-gl.d.ts +302 -0
  175. package/dist/components/map/coordinate-info.d.ts +7 -0
  176. package/dist/components/map/layer-hover-info.d.ts +13 -0
  177. package/dist/components/map/layer-selector-panel.d.ts +22 -0
  178. package/dist/components/map/locale-panel.d.ts +16 -0
  179. package/dist/components/map/map-control-panel.d.ts +14 -0
  180. package/dist/components/map/map-control-toolbar.d.ts +2 -0
  181. package/dist/components/map/map-control-tooltip.d.ts +7 -0
  182. package/dist/components/map/map-control.d.ts +44 -0
  183. package/dist/components/map/map-draw-panel.d.ts +21 -0
  184. package/dist/components/map/map-legend-panel.d.ts +23 -0
  185. package/dist/components/map/map-legend.d.ts +55 -0
  186. package/dist/components/map/map-popover.d.ts +37 -0
  187. package/dist/components/map/split-map-button.d.ts +19 -0
  188. package/dist/components/map/toggle-3d-button.d.ts +16 -0
  189. package/dist/components/map-container.d.ts +58 -0
  190. package/dist/components/maps-layout.d.ts +10 -0
  191. package/dist/components/modal-container.d.ts +65 -0
  192. package/dist/components/modals/add-map-style-modal.d.ts +17 -0
  193. package/dist/components/modals/cloud-tile.d.ts +15 -0
  194. package/dist/components/modals/data-table-modal.d.ts +29 -0
  195. package/dist/components/modals/delete-data-modal.d.ts +10 -0
  196. package/dist/components/modals/error-display.d.ts +6 -0
  197. package/dist/components/modals/export-data-modal.d.ts +25 -0
  198. package/dist/components/modals/export-image-modal.d.ts +18 -0
  199. package/dist/components/modals/export-map-modal/components.d.ts +8 -0
  200. package/dist/components/modals/export-map-modal/export-html-map.d.ts +12 -0
  201. package/dist/components/modals/export-map-modal/export-json-map.d.ts +9 -0
  202. package/dist/components/modals/export-map-modal/export-map-modal.d.ts +27 -0
  203. package/dist/components/modals/image-modal-container.d.ts +18 -0
  204. package/dist/components/modals/load-data-modal.d.ts +33 -0
  205. package/dist/components/modals/load-storage-map.d.ts +26 -0
  206. package/dist/components/modals/loading-dialog.d.ts +7 -0
  207. package/dist/components/modals/modal-dialog.d.ts +2 -0
  208. package/dist/components/modals/modal-tabs.d.ts +27 -0
  209. package/dist/components/modals/overwrite-map-modal.d.ts +16 -0
  210. package/dist/components/modals/provider-modal-container.d.ts +23 -0
  211. package/dist/components/modals/save-map-modal.d.ts +29 -0
  212. package/dist/components/modals/share-map-modal.d.ts +30 -0
  213. package/dist/components/modals/status-panel.d.ts +13 -0
  214. package/dist/components/modals/storage-map-viewer.d.ts +21 -0
  215. package/dist/components/notification-panel/notification-item.d.ts +66 -0
  216. package/dist/components/notification-panel.d.ts +61 -0
  217. package/dist/components/performance.d.ts +4 -0
  218. package/dist/components/plot-container.d.ts +24 -0
  219. package/dist/components/side-panel/cloud-storage-dropdown.d.ts +6 -0
  220. package/dist/components/side-panel/common/dataset-info.d.ts +3 -0
  221. package/dist/components/side-panel/common/dataset-tag.d.ts +3 -0
  222. package/dist/components/side-panel/common/dataset-title.d.ts +8 -0
  223. package/dist/components/side-panel/common/source-data-catalog.d.ts +9 -0
  224. package/dist/components/side-panel/common/source-data-selector.d.ts +8 -0
  225. package/dist/components/side-panel/common/types.d.ts +58 -0
  226. package/dist/components/side-panel/custom-panel.d.ts +9 -0
  227. package/dist/components/side-panel/filter-manager.d.ts +20 -0
  228. package/dist/components/side-panel/filter-panel/filter-panel-header.d.ts +21 -0
  229. package/dist/components/side-panel/filter-panel/filter-panel.d.ts +23 -0
  230. package/dist/components/side-panel/interaction-manager.d.ts +14 -0
  231. package/dist/components/side-panel/interaction-panel/brush-config.d.ts +15 -0
  232. package/dist/components/side-panel/interaction-panel/interaction-panel.d.ts +19 -0
  233. package/dist/components/side-panel/interaction-panel/tooltip-config/tooltip-chicklet.d.ts +28 -0
  234. package/dist/components/side-panel/interaction-panel/tooltip-config.d.ts +38 -0
  235. package/dist/components/side-panel/layer-manager.d.ts +46 -0
  236. package/dist/components/side-panel/layer-panel/add-layer-button.d.ts +10 -0
  237. package/dist/components/side-panel/layer-panel/color-dimension-scale-selector.d.ts +8 -0
  238. package/dist/components/side-panel/layer-panel/color-palette.d.ts +13 -0
  239. package/dist/components/side-panel/layer-panel/color-range-selector.d.ts +129 -0
  240. package/dist/components/side-panel/layer-panel/color-selector.d.ts +101 -0
  241. package/dist/components/side-panel/layer-panel/column-selector.d.ts +22 -0
  242. package/dist/components/side-panel/layer-panel/custom-markers-config-group.d.ts +6 -0
  243. package/dist/components/side-panel/layer-panel/custom-palette.d.ts +38 -0
  244. package/dist/components/side-panel/layer-panel/custom-picker.d.ts +67 -0
  245. package/dist/components/side-panel/layer-panel/dataset-layer-group.d.ts +24 -0
  246. package/dist/components/side-panel/layer-panel/dataset-layer-section.d.ts +25 -0
  247. package/dist/components/side-panel/layer-panel/dataset-section.d.ts +26 -0
  248. package/dist/components/side-panel/layer-panel/dimension-scale-selector.d.ts +10 -0
  249. package/dist/components/side-panel/layer-panel/hex-column-config.d.ts +62 -0
  250. package/dist/components/side-panel/layer-panel/layer-aggregation-resolution.d.ts +8 -0
  251. package/dist/components/side-panel/layer-panel/layer-column-config.d.ts +20 -0
  252. package/dist/components/side-panel/layer-panel/layer-config-group.d.ts +37 -0
  253. package/dist/components/side-panel/layer-panel/layer-configurator.d.ts +415 -0
  254. package/dist/components/side-panel/layer-panel/layer-list.d.ts +20 -0
  255. package/dist/components/side-panel/layer-panel/layer-panel-header.d.ts +43 -0
  256. package/dist/components/side-panel/layer-panel/layer-panel.d.ts +40 -0
  257. package/dist/components/side-panel/layer-panel/layer-type-dropdown-list.d.ts +17 -0
  258. package/dist/components/side-panel/layer-panel/layer-type-list-item.d.ts +11 -0
  259. package/dist/components/side-panel/layer-panel/layer-type-selector.d.ts +23 -0
  260. package/dist/components/side-panel/layer-panel/layer-visibility-by-zoom.d.ts +23 -0
  261. package/dist/components/side-panel/layer-panel/panel-view-list-toggle.d.ts +36 -0
  262. package/dist/components/side-panel/layer-panel/single-color-palette.d.ts +12 -0
  263. package/dist/components/side-panel/layer-panel/text-label-panel.d.ts +18 -0
  264. package/dist/components/side-panel/layer-panel/vis-config-by-field-selector.d.ts +35 -0
  265. package/dist/components/side-panel/layer-panel/vis-config-slider.d.ts +20 -0
  266. package/dist/components/side-panel/layer-panel/vis-config-switch.d.ts +16 -0
  267. package/dist/components/side-panel/map-manager.d.ts +21 -0
  268. package/dist/components/side-panel/map-style-panel/map-layer-selector.d.ts +19 -0
  269. package/dist/components/side-panel/map-style-panel/map-style-selector.d.ts +16 -0
  270. package/dist/components/side-panel/panel-dropdown.d.ts +18 -0
  271. package/dist/components/side-panel/panel-header-action.d.ts +20 -0
  272. package/dist/components/side-panel/panel-header.d.ts +78 -0
  273. package/dist/components/side-panel/panel-tab.d.ts +20 -0
  274. package/dist/components/side-panel/panel-title.d.ts +4 -0
  275. package/dist/components/side-panel/panel-toggle.d.ts +14 -0
  276. package/dist/components/side-panel/side-bar.d.ts +76 -0
  277. package/dist/components/side-panel.d.ts +134 -0
  278. package/dist/components/types.d.ts +44 -0
  279. package/dist/connect/keplergl-connect.d.ts +5 -0
  280. package/dist/connect/with-local-selector.d.ts +6 -0
  281. package/dist/constants/action-types.d.ts +111 -0
  282. package/dist/constants/color-palette.d.ts +491 -0
  283. package/dist/constants/color-ranges.d.ts +24 -0
  284. package/dist/constants/custom-color-ranges.d.ts +37 -0
  285. package/dist/constants/default-settings.d.ts +773 -0
  286. package/dist/constants/index.d.ts +9 -0
  287. package/dist/constants/keyevent.d.ts +2 -0
  288. package/dist/constants/tooltip.d.ts +165 -0
  289. package/dist/constants/user-feedbacks.d.ts +5 -0
  290. package/dist/constants/user-guides.d.ts +9 -0
  291. package/dist/deckgl-layers/3d-building-layer/3d-building-layer.d.ts +13 -0
  292. package/dist/deckgl-layers/3d-building-layer/3d-building-utils.d.ts +7 -0
  293. package/dist/deckgl-layers/column-layer/enhanced-column-layer.d.ts +6 -0
  294. package/dist/deckgl-layers/grid-layer/enhanced-cpu-grid-layer.d.ts +13 -0
  295. package/dist/deckgl-layers/hexagon-layer/enhanced-hexagon-layer.d.ts +13 -0
  296. package/dist/deckgl-layers/layer-utils/cluster-utils.d.ts +12 -0
  297. package/dist/deckgl-layers/layer-utils/cpu-aggregator.d.ts +91 -0
  298. package/dist/deckgl-layers/layer-utils/shader-utils.d.ts +1 -0
  299. package/dist/deckgl-layers/line-layer/line-layer.d.ts +12 -0
  300. package/dist/deckgl-layers/svg-icon-layer/scatterplot-icon-layer.d.ts +8 -0
  301. package/dist/deckgl-layers/svg-icon-layer/svg-icon-layer.d.ts +18 -0
  302. package/dist/index.d.ts +11 -0
  303. package/dist/layers/aggregation-layer.d.ts +70 -0
  304. package/dist/layers/arc-layer/arc-layer-icon.d.ts +16 -0
  305. package/dist/layers/arc-layer/arc-layer.d.ts +143 -0
  306. package/dist/layers/base-layer.d.ts +436 -0
  307. package/dist/layers/cluster-layer/cluster-layer-icon.d.ts +16 -0
  308. package/dist/layers/cluster-layer/cluster-layer.d.ts +39 -0
  309. package/dist/layers/default-layer-icon.d.ts +14 -0
  310. package/dist/layers/geojson-layer/geojson-layer-icon.d.ts +15 -0
  311. package/dist/layers/geojson-layer/geojson-layer.d.ts +230 -0
  312. package/dist/layers/geojson-layer/geojson-utils.d.ts +44 -0
  313. package/dist/layers/grid-layer/grid-layer-icon.d.ts +15 -0
  314. package/dist/layers/grid-layer/grid-layer.d.ts +74 -0
  315. package/dist/layers/grid-layer/grid-utils.d.ts +24 -0
  316. package/dist/layers/h3-hexagon-layer/h3-hexagon-layer-icon.d.ts +16 -0
  317. package/dist/layers/h3-hexagon-layer/h3-hexagon-layer.d.ts +170 -0
  318. package/dist/layers/h3-hexagon-layer/h3-utils.d.ts +20 -0
  319. package/dist/layers/heatmap-layer/heatmap-layer-icon.d.ts +15 -0
  320. package/dist/layers/heatmap-layer/heatmap-layer.d.ts +144 -0
  321. package/dist/layers/hexagon-layer/hexagon-layer-icon.d.ts +15 -0
  322. package/dist/layers/hexagon-layer/hexagon-layer.d.ts +78 -0
  323. package/dist/layers/hexagon-layer/hexagon-utils.d.ts +7 -0
  324. package/dist/layers/icon-layer/icon-info-modal.d.ts +3 -0
  325. package/dist/layers/icon-layer/icon-layer-icon.d.ts +15 -0
  326. package/dist/layers/icon-layer/icon-layer.d.ts +119 -0
  327. package/dist/layers/index.d.ts +53 -0
  328. package/dist/layers/layer-factory.d.ts +150 -0
  329. package/dist/layers/layer-text-label.d.ts +7 -0
  330. package/dist/layers/layer-update.d.ts +9 -0
  331. package/dist/layers/line-layer/line-layer-icon.d.ts +15 -0
  332. package/dist/layers/line-layer/line-layer.d.ts +136 -0
  333. package/dist/layers/mapbox-utils.d.ts +57 -0
  334. package/dist/layers/mapboxgl-layer.d.ts +87 -0
  335. package/dist/layers/point-layer/point-layer-icon.d.ts +15 -0
  336. package/dist/layers/point-layer/point-layer.d.ts +272 -0
  337. package/dist/layers/s2-geometry-layer/s2-geometry-layer.d.ts +189 -0
  338. package/dist/layers/s2-geometry-layer/s2-layer-icon.d.ts +15 -0
  339. package/dist/layers/s2-geometry-layer/s2-utils.d.ts +7 -0
  340. package/dist/layers/scenegraph-layer/scenegraph-info-modal.d.ts +3 -0
  341. package/dist/layers/scenegraph-layer/scenegraph-layer-icon.d.ts +15 -0
  342. package/dist/layers/scenegraph-layer/scenegraph-layer.d.ts +80 -0
  343. package/dist/layers/trip-layer/trip-info-modal.d.ts +3 -0
  344. package/dist/layers/trip-layer/trip-layer-icon.d.ts +15 -0
  345. package/dist/layers/trip-layer/trip-layer.d.ts +157 -0
  346. package/dist/layers/trip-layer/trip-utils.d.ts +31 -0
  347. package/dist/layers/types.d.ts +15 -0
  348. package/dist/localization/formatted-message.d.ts +12 -0
  349. package/dist/localization/index.d.ts +5 -0
  350. package/dist/localization/locales.d.ts +27 -0
  351. package/dist/localization/messages.d.ts +4 -0
  352. package/dist/localization/translations/ca.d.ts +438 -0
  353. package/dist/localization/translations/cn.d.ts +441 -0
  354. package/dist/localization/translations/en.d.ts +466 -0
  355. package/dist/localization/translations/es.d.ts +438 -0
  356. package/dist/localization/translations/fi.d.ts +410 -0
  357. package/dist/localization/translations/ja.d.ts +439 -0
  358. package/dist/localization/translations/pt.d.ts +410 -0
  359. package/dist/localization/translations/ru.d.ts +447 -0
  360. package/dist/middleware/index.d.ts +8 -0
  361. package/dist/processors/data-processor.d.ts +242 -0
  362. package/dist/processors/file-handler.d.ts +28 -0
  363. package/dist/processors/index.d.ts +3 -0
  364. package/dist/processors/types.d.ts +21 -0
  365. package/dist/reducers/combined-updaters.d.ts +52 -0
  366. package/dist/reducers/composer-helpers.d.ts +21 -0
  367. package/dist/reducers/composers.d.ts +12 -0
  368. package/dist/reducers/core.d.ts +65 -0
  369. package/dist/reducers/index.d.ts +19 -0
  370. package/dist/reducers/map-state-updaters.d.ts +96 -0
  371. package/dist/reducers/map-state.d.ts +4 -0
  372. package/dist/reducers/map-style-updaters.d.ts +204 -0
  373. package/dist/reducers/map-style.d.ts +16 -0
  374. package/dist/reducers/provider-state-updaters.d.ts +41 -0
  375. package/dist/reducers/provider-state.d.ts +4 -0
  376. package/dist/reducers/root.d.ts +24 -0
  377. package/dist/reducers/types.d.ts +16 -0
  378. package/dist/reducers/ui-state-updaters.d.ts +434 -0
  379. package/dist/reducers/ui-state.d.ts +3 -0
  380. package/dist/reducers/vis-state-merger.d.ts +110 -0
  381. package/dist/reducers/vis-state-selectors.d.ts +10 -0
  382. package/dist/reducers/vis-state-updaters.d.ts +645 -0
  383. package/dist/reducers/vis-state.d.ts +4 -0
  384. package/dist/schemas/dataset-schema.d.ts +17 -0
  385. package/dist/schemas/index.d.ts +8 -0
  386. package/dist/schemas/map-state-schema.d.ts +23 -0
  387. package/dist/schemas/map-style-schema.d.ts +38 -0
  388. package/dist/schemas/schema-manager.d.ts +271 -0
  389. package/dist/schemas/schema-utils.d.ts +11 -0
  390. package/dist/schemas/schema.d.ts +37 -0
  391. package/dist/schemas/versions.d.ts +5 -0
  392. package/dist/schemas/vis-state-schema.d.ts +214 -0
  393. package/dist/styles/base.d.ts +1530 -0
  394. package/dist/styles/index.d.ts +2 -0
  395. package/dist/styles/media-breakpoints.d.ts +13 -0
  396. package/dist/tasks/tasks.d.ts +15 -0
  397. package/dist/templates/export-map-html.d.ts +9 -0
  398. package/dist/utils/aggregate-utils.d.ts +3 -0
  399. package/dist/utils/color-utils.d.ts +44 -0
  400. package/dist/utils/data-scale-utils.d.ts +23 -0
  401. package/dist/utils/data-utils.d.ts +115 -0
  402. package/dist/utils/dataset-utils.d.ts +38 -0
  403. package/dist/utils/dom-to-image.d.ts +73 -0
  404. package/dist/utils/dom-utils.d.ts +20 -0
  405. package/dist/utils/export-utils.d.ts +56 -0
  406. package/dist/utils/filter-utils.d.ts +267 -0
  407. package/dist/utils/gl-utils.d.ts +1 -0
  408. package/dist/utils/gpu-filter-utils.d.ts +28 -0
  409. package/dist/utils/index.d.ts +22 -0
  410. package/dist/utils/interaction-utils.d.ts +36 -0
  411. package/dist/utils/layer-utils.d.ts +54 -0
  412. package/dist/utils/locale-utils.d.ts +2 -0
  413. package/dist/utils/map-info-utils.d.ts +1 -0
  414. package/dist/utils/map-style-utils/mapbox-gl-style-editor.d.ts +64 -0
  415. package/dist/utils/map-style-utils/mapbox-utils.d.ts +3 -0
  416. package/dist/utils/mapbox-utils.d.ts +7 -0
  417. package/dist/utils/notifications-utils.d.ts +54 -0
  418. package/dist/utils/observe-dimensions.d.ts +15 -0
  419. package/dist/utils/projection-utils.d.ts +12 -0
  420. package/dist/utils/searcher-utils.d.ts +1 -0
  421. package/dist/utils/split-map-utils.d.ts +29 -0
  422. package/dist/utils/table-utils/data-container-interface.d.ts +115 -0
  423. package/dist/utils/table-utils/data-container-utils.d.ts +29 -0
  424. package/dist/utils/table-utils/data-row.d.ts +59 -0
  425. package/dist/utils/table-utils/index.d.ts +1 -0
  426. package/dist/utils/table-utils/indexed-data-container.d.ts +34 -0
  427. package/dist/utils/table-utils/kepler-table.d.ts +168 -0
  428. package/dist/utils/table-utils/row-data-container.d.ts +31 -0
  429. package/dist/utils/utils.d.ts +98 -0
  430. package/package.json +163 -72
  431. package/src/actions/action-wrapper.ts +183 -0
  432. package/src/actions/actions.ts +259 -0
  433. package/src/actions/identity-actions.ts +116 -0
  434. package/src/actions/map-state-actions.ts +116 -0
  435. package/src/actions/map-style-actions.ts +243 -0
  436. package/src/actions/provider-actions.ts +218 -0
  437. package/src/actions/ui-state-actions.ts +490 -0
  438. package/src/actions/vis-state-actions.ts +1279 -0
  439. package/src/cloud-providers/index.ts +22 -0
  440. package/src/cloud-providers/provider.ts +276 -0
  441. package/src/components/bottom-widget.tsx +277 -0
  442. package/src/components/common/action-panel.tsx +207 -0
  443. package/src/components/common/animation-control/animation-control.tsx +157 -0
  444. package/src/components/common/animation-control/animation-controller.ts +250 -0
  445. package/src/components/common/animation-control/animation-speed-slider.tsx +86 -0
  446. package/src/components/common/animation-control/floating-time-display.tsx +209 -0
  447. package/src/components/common/animation-control/playback-controls.tsx +316 -0
  448. package/src/components/common/animation-control/speed-control.tsx +71 -0
  449. package/src/components/common/checkbox.tsx +137 -0
  450. package/src/components/common/color-legend.tsx +203 -0
  451. package/src/components/common/data-table/button.tsx +54 -0
  452. package/src/components/common/data-table/cell-size.ts +185 -0
  453. package/src/components/common/data-table/grid.tsx +57 -0
  454. package/src/components/common/data-table/index.tsx +693 -0
  455. package/src/components/common/data-table/option-dropdown.tsx +122 -0
  456. package/src/components/common/dataset-label.tsx +48 -0
  457. package/src/components/common/error-boundary.tsx +47 -0
  458. package/src/components/common/field-selector.tsx +242 -0
  459. package/src/components/common/field-token.tsx +60 -0
  460. package/src/components/common/file-uploader/file-drop.tsx +209 -0
  461. package/src/components/common/file-uploader/file-upload-progress.tsx +123 -0
  462. package/src/components/common/file-uploader/file-upload.tsx +319 -0
  463. package/src/components/common/file-uploader/upload-button.tsx +89 -0
  464. package/src/components/common/histogram-plot.tsx +125 -0
  465. package/src/components/common/icons/add.tsx +37 -0
  466. package/src/components/common/icons/anchor_window.tsx +49 -0
  467. package/src/components/common/icons/arrow-down-alt.tsx +37 -0
  468. package/src/components/common/icons/arrow-down-solid.tsx +37 -0
  469. package/src/components/common/icons/arrow-down.tsx +40 -0
  470. package/src/components/common/icons/arrow-left.tsx +42 -0
  471. package/src/components/common/icons/arrow-right.tsx +40 -0
  472. package/src/components/common/icons/arrow-up-alt.tsx +40 -0
  473. package/src/components/common/icons/arrow-up-solid.tsx +37 -0
  474. package/src/components/common/icons/arrow-up.tsx +40 -0
  475. package/src/components/common/icons/base.tsx +95 -0
  476. package/src/components/common/icons/bug.tsx +40 -0
  477. package/src/components/common/icons/cancel.tsx +37 -0
  478. package/src/components/common/icons/checkmark.tsx +39 -0
  479. package/src/components/common/icons/chevron-right.js +1 -1
  480. package/src/components/common/icons/clipboard.tsx +40 -0
  481. package/src/components/common/icons/clock.tsx +38 -0
  482. package/src/components/common/icons/close.tsx +43 -0
  483. package/src/components/common/icons/code-alt.tsx +37 -0
  484. package/src/components/common/icons/copy.tsx +38 -0
  485. package/src/components/common/icons/crosshairs.tsx +37 -0
  486. package/src/components/common/icons/cube-3d.tsx +39 -0
  487. package/src/components/common/icons/cursor-click.tsx +43 -0
  488. package/src/components/common/icons/data-table.tsx +40 -0
  489. package/src/components/common/icons/db.tsx +40 -0
  490. package/src/components/common/icons/delete.tsx +39 -0
  491. package/src/components/common/icons/docs.tsx +40 -0
  492. package/src/components/common/icons/drag-n-drop.tsx +38 -0
  493. package/src/components/common/icons/draw-polygon.tsx +51 -0
  494. package/src/components/common/icons/email.tsx +39 -0
  495. package/src/components/common/icons/expand.tsx +39 -0
  496. package/src/components/common/icons/eye-seen.tsx +38 -0
  497. package/src/components/common/icons/eye-unseen.tsx +38 -0
  498. package/src/components/common/icons/file-type.tsx +71 -0
  499. package/src/components/common/icons/file.tsx +37 -0
  500. package/src/components/common/icons/files.tsx +37 -0
  501. package/src/components/common/icons/filter-funnel.tsx +37 -0
  502. package/src/components/common/icons/free-window.tsx +48 -0
  503. package/src/components/common/icons/gear.tsx +40 -0
  504. package/src/components/common/icons/hash.tsx +37 -0
  505. package/src/components/common/icons/histogram.tsx +42 -0
  506. package/src/components/common/icons/index.tsx +98 -0
  507. package/src/components/common/icons/info.tsx +48 -0
  508. package/src/components/common/icons/layers.tsx +37 -0
  509. package/src/components/common/icons/left-arrow.tsx +37 -0
  510. package/src/components/common/icons/legend.tsx +37 -0
  511. package/src/components/common/icons/line-chart.tsx +40 -0
  512. package/src/components/common/icons/login.tsx +41 -0
  513. package/src/components/common/icons/logout.tsx +38 -0
  514. package/src/components/common/icons/map-icon.tsx +62 -0
  515. package/src/components/common/icons/map.tsx +62 -0
  516. package/src/components/common/icons/messages.tsx +37 -0
  517. package/src/components/common/icons/minus.tsx +39 -0
  518. package/src/components/common/icons/order-by-dataset.tsx +49 -0
  519. package/src/components/common/icons/order-by-list.tsx +39 -0
  520. package/src/components/common/icons/pause.tsx +37 -0
  521. package/src/components/common/icons/picture.tsx +37 -0
  522. package/src/components/common/icons/pin.tsx +42 -0
  523. package/src/components/common/icons/play.tsx +37 -0
  524. package/src/components/common/icons/polygon.tsx +65 -0
  525. package/src/components/common/icons/rectangle.tsx +66 -0
  526. package/src/components/common/icons/reduce.tsx +42 -0
  527. package/src/components/common/icons/reset.tsx +37 -0
  528. package/src/components/common/icons/rocket.tsx +37 -0
  529. package/src/components/common/icons/save.tsx +38 -0
  530. package/src/components/common/icons/save2.tsx +42 -0
  531. package/src/components/common/icons/search.tsx +38 -0
  532. package/src/components/common/icons/settings.tsx +39 -0
  533. package/src/components/common/icons/share.tsx +37 -0
  534. package/src/components/common/icons/split.tsx +57 -0
  535. package/src/components/common/icons/square-select.tsx +38 -0
  536. package/src/components/common/icons/swap-horizontal.js +1 -1
  537. package/src/components/common/icons/table.tsx +41 -0
  538. package/src/components/common/icons/trash.tsx +45 -0
  539. package/src/components/common/icons/upload.tsx +37 -0
  540. package/src/components/common/icons/vert-dots.tsx +44 -0
  541. package/src/components/common/icons/vert-three-dots.tsx +39 -0
  542. package/src/components/common/icons/warning.tsx +40 -0
  543. package/src/components/common/image-preview.tsx +118 -0
  544. package/src/components/common/info-helper.tsx +91 -0
  545. package/src/components/common/item-selector/accessor.ts +45 -0
  546. package/src/components/common/item-selector/chickleted-input.tsx +153 -0
  547. package/src/components/common/item-selector/dropdown-list.tsx +269 -0
  548. package/src/components/common/item-selector/item-selector-submenu.js +1 -1
  549. package/src/components/common/item-selector/item-selector.d.ts +24 -27
  550. package/src/components/common/item-selector/item-selector.tsx +373 -0
  551. package/src/components/common/item-selector/typeahead.tsx +533 -0
  552. package/src/components/common/line-chart.tsx +170 -0
  553. package/src/components/common/loading-spinner.tsx +75 -0
  554. package/src/components/common/logo.tsx +88 -0
  555. package/src/components/common/map-layer-selector.tsx +64 -0
  556. package/src/components/common/modal.tsx +238 -0
  557. package/src/components/common/portaled.tsx +315 -0
  558. package/src/components/common/progress-bar.tsx +74 -0
  559. package/src/components/common/range-brush.tsx +276 -0
  560. package/src/components/common/range-plot.tsx +145 -0
  561. package/src/components/common/range-slider.tsx +320 -0
  562. package/src/components/common/slider/mouse-event.ts +122 -0
  563. package/src/components/common/slider/slider-bar-handle.tsx +106 -0
  564. package/src/components/common/slider/slider-handle.tsx +210 -0
  565. package/src/components/common/slider/slider.tsx +234 -0
  566. package/src/components/common/styled-components.tsx +714 -0
  567. package/src/components/common/switch.tsx +47 -0
  568. package/src/components/common/time-range-slider-time-title.tsx +87 -0
  569. package/src/components/common/time-range-slider.tsx +171 -0
  570. package/src/components/common/time-slider-marker.tsx +187 -0
  571. package/src/components/common/tippy-tooltip.tsx +130 -0
  572. package/src/components/common/toolbar-item.tsx +99 -0
  573. package/src/components/common/toolbar.tsx +49 -0
  574. package/src/components/common/vertical-toolbar.tsx +35 -0
  575. package/src/components/container.d.ts +8 -0
  576. package/src/components/container.tsx +189 -0
  577. package/src/components/context.ts +32 -0
  578. package/src/components/editor/editor.tsx +234 -0
  579. package/src/components/editor/feature-action-panel.tsx +155 -0
  580. package/src/components/editor/feature-styles.ts +76 -0
  581. package/src/components/editor/handle-style.ts +89 -0
  582. package/src/components/filters/filter-panels/filter-panel-with-field-select.tsx +118 -0
  583. package/src/components/filters/filter-panels/multi-select-filter-panel.tsx +63 -0
  584. package/src/components/filters/filter-panels/new-filter-panel.tsx +100 -0
  585. package/src/components/filters/filter-panels/polygon-filter-panel.tsx +84 -0
  586. package/src/components/filters/filter-panels/range-filter-panel.tsx +63 -0
  587. package/src/components/filters/filter-panels/single-select-filter-panel.tsx +63 -0
  588. package/src/components/filters/filter-panels/time-range-filter-panel.tsx +92 -0
  589. package/src/components/filters/filter-panels/types.ts +40 -0
  590. package/src/components/filters/multi-select-filter.tsx +37 -0
  591. package/src/components/filters/polygon-filter.tsx +74 -0
  592. package/src/components/filters/range-filter.tsx +44 -0
  593. package/src/components/filters/single-select-filter.tsx +50 -0
  594. package/src/components/filters/time-range-filter.tsx +76 -0
  595. package/src/components/filters/time-widget.tsx +240 -0
  596. package/src/components/filters/types.ts +78 -0
  597. package/src/components/geocoder/geocoder.tsx +307 -0
  598. package/src/components/geocoder-panel.tsx +199 -0
  599. package/src/components/index.ts +269 -0
  600. package/src/components/injector.d.ts +33 -0
  601. package/src/components/injector.tsx +171 -0
  602. package/src/components/kepler-gl.d.ts +1 -2
  603. package/src/components/kepler-gl.tsx +585 -0
  604. package/src/components/map/coordinate-info.tsx +58 -0
  605. package/src/components/map/layer-hover-info.tsx +192 -0
  606. package/src/components/map/layer-selector-panel.tsx +122 -0
  607. package/src/components/map/locale-panel.tsx +110 -0
  608. package/src/components/map/map-control-panel.tsx +142 -0
  609. package/src/components/map/map-control-tooltip.tsx +45 -0
  610. package/src/components/map/map-control.tsx +138 -0
  611. package/src/components/map/map-draw-panel.tsx +145 -0
  612. package/src/components/map/map-legend-panel.tsx +167 -0
  613. package/src/components/map/map-legend.tsx +284 -0
  614. package/src/components/map/map-popover.tsx +268 -0
  615. package/src/components/map/split-map-button.tsx +98 -0
  616. package/src/components/map/toggle-3d-button.tsx +90 -0
  617. package/src/components/map-container.tsx +549 -0
  618. package/src/components/maps-layout.tsx +45 -0
  619. package/src/components/modal-container.tsx +555 -0
  620. package/src/components/modals/add-map-style-modal.tsx +304 -0
  621. package/src/components/modals/cloud-tile.tsx +181 -0
  622. package/src/components/modals/data-table-modal.tsx +241 -0
  623. package/src/components/modals/delete-data-modal.tsx +55 -0
  624. package/src/components/modals/error-display.tsx +43 -0
  625. package/src/components/modals/export-data-modal.tsx +201 -0
  626. package/src/components/modals/export-image-modal.tsx +155 -0
  627. package/src/components/modals/export-map-modal/export-html-map.tsx +164 -0
  628. package/src/components/modals/export-map-modal/export-json-map.tsx +112 -0
  629. package/src/components/modals/export-map-modal/export-map-modal.tsx +109 -0
  630. package/src/components/modals/image-modal-container.tsx +86 -0
  631. package/src/components/modals/load-data-modal.tsx +120 -0
  632. package/src/components/modals/load-storage-map.tsx +414 -0
  633. package/src/components/modals/loading-dialog.tsx +77 -0
  634. package/src/components/modals/modal-tabs.tsx +137 -0
  635. package/src/components/modals/overwrite-map-modal.tsx +113 -0
  636. package/src/components/modals/provider-modal-container.tsx +62 -0
  637. package/src/components/modals/save-map-modal.tsx +277 -0
  638. package/src/components/modals/share-map-modal.tsx +217 -0
  639. package/src/components/modals/status-panel.tsx +106 -0
  640. package/src/components/modals/storage-map-viewer.tsx +190 -0
  641. package/src/components/notification-panel/notification-item.tsx +143 -0
  642. package/src/components/notification-panel.tsx +75 -0
  643. package/src/components/performance.tsx +105 -0
  644. package/src/components/plot-container.tsx +243 -0
  645. package/src/components/side-panel/common/dataset-info.tsx +46 -0
  646. package/src/components/side-panel/common/dataset-tag.tsx +86 -0
  647. package/src/components/side-panel/common/dataset-title.tsx +187 -0
  648. package/src/components/side-panel/common/source-data-catalog.tsx +67 -0
  649. package/src/components/side-panel/common/source-data-selector.tsx +90 -0
  650. package/src/components/side-panel/common/types.ts +76 -0
  651. package/src/components/side-panel/filter-manager.tsx +120 -0
  652. package/src/components/side-panel/filter-panel/filter-panel-header.tsx +96 -0
  653. package/src/components/side-panel/filter-panel/filter-panel.tsx +125 -0
  654. package/src/components/side-panel/interaction-manager.tsx +59 -0
  655. package/src/components/side-panel/interaction-panel/brush-config.tsx +58 -0
  656. package/src/components/side-panel/interaction-panel/interaction-panel.tsx +124 -0
  657. package/src/components/side-panel/interaction-panel/tooltip-config/tooltip-chicklet.tsx +243 -0
  658. package/src/components/side-panel/interaction-panel/tooltip-config.tsx +238 -0
  659. package/src/components/side-panel/layer-manager.tsx +242 -0
  660. package/src/components/side-panel/layer-panel/add-layer-button.tsx +208 -0
  661. package/src/components/side-panel/layer-panel/color-dimension-scale-selector.tsx +33 -0
  662. package/src/components/side-panel/layer-panel/color-palette.tsx +98 -0
  663. package/src/components/side-panel/layer-panel/color-range-selector.tsx +388 -0
  664. package/src/components/side-panel/layer-panel/color-selector.tsx +200 -0
  665. package/src/components/side-panel/layer-panel/column-selector.tsx +102 -0
  666. package/src/components/side-panel/layer-panel/custom-markers-config-group.tsx +30 -0
  667. package/src/components/side-panel/layer-panel/custom-palette.tsx +301 -0
  668. package/src/components/side-panel/layer-panel/custom-picker.tsx +99 -0
  669. package/src/components/side-panel/layer-panel/dataset-layer-group.tsx +99 -0
  670. package/src/components/side-panel/layer-panel/dataset-layer-section.tsx +100 -0
  671. package/src/components/side-panel/layer-panel/dataset-section.tsx +125 -0
  672. package/src/components/side-panel/layer-panel/dimension-scale-selector.tsx +64 -0
  673. package/src/components/side-panel/layer-panel/hex-column-config.tsx +53 -0
  674. package/src/components/side-panel/layer-panel/layer-column-config.tsx +115 -0
  675. package/src/components/side-panel/layer-panel/layer-config-group.tsx +259 -0
  676. package/src/components/side-panel/layer-panel/layer-configurator.tsx +1419 -0
  677. package/src/components/side-panel/layer-panel/layer-list.tsx +193 -0
  678. package/src/components/side-panel/layer-panel/layer-panel-header.tsx +273 -0
  679. package/src/components/side-panel/layer-panel/layer-panel.tsx +197 -0
  680. package/src/components/side-panel/layer-panel/layer-type-dropdown-list.tsx +118 -0
  681. package/src/components/side-panel/layer-panel/layer-type-list-item.tsx +92 -0
  682. package/src/components/side-panel/layer-panel/layer-type-selector.tsx +115 -0
  683. package/src/components/side-panel/layer-panel/layer-visibility-by-zoom.tsx +123 -0
  684. package/src/components/side-panel/layer-panel/panel-view-list-toggle.tsx +132 -0
  685. package/src/components/side-panel/layer-panel/single-color-palette.tsx +94 -0
  686. package/src/components/side-panel/layer-panel/text-label-panel.tsx +189 -0
  687. package/src/components/side-panel/layer-panel/vis-config-by-field-selector.tsx +187 -0
  688. package/src/components/side-panel/layer-panel/vis-config-slider.tsx +237 -0
  689. package/src/components/side-panel/layer-panel/vis-config-switch.tsx +86 -0
  690. package/src/components/side-panel/map-manager.tsx +123 -0
  691. package/src/components/side-panel/map-style-panel/map-layer-selector.tsx +145 -0
  692. package/src/components/side-panel/map-style-panel/map-style-selector.tsx +122 -0
  693. package/src/components/side-panel/panel-dropdown.tsx +54 -0
  694. package/src/components/side-panel/panel-header-action.tsx +114 -0
  695. package/src/components/side-panel/panel-header.tsx +386 -0
  696. package/src/components/side-panel/panel-tab.tsx +79 -0
  697. package/src/components/side-panel/panel-title.tsx +35 -0
  698. package/src/components/side-panel/panel-toggle.tsx +72 -0
  699. package/src/components/side-panel/side-bar.tsx +141 -0
  700. package/src/components/side-panel.tsx +261 -0
  701. package/src/components/types.ts +41 -0
  702. package/src/connect/keplergl-connect.ts +48 -0
  703. package/src/connect/with-local-selector.tsx +70 -0
  704. package/src/constants/action-types.ts +188 -0
  705. package/src/constants/color-ranges.ts +87 -0
  706. package/src/constants/default-settings.ts +1051 -0
  707. package/src/constants/index.ts +84 -0
  708. package/src/deckgl-layers/3d-building-layer/3d-building-layer.ts +63 -0
  709. package/src/deckgl-layers/3d-building-layer/3d-building-utils.ts +211 -0
  710. package/src/deckgl-layers/3d-building-layer/types.ts +29 -0
  711. package/src/deckgl-layers/column-layer/enhanced-column-layer.ts +63 -0
  712. package/src/deckgl-layers/grid-layer/enhanced-cpu-grid-layer.ts +70 -0
  713. package/src/deckgl-layers/hexagon-layer/enhanced-hexagon-layer.ts +70 -0
  714. package/src/deckgl-layers/layer-utils/cluster-utils.ts +78 -0
  715. package/src/deckgl-layers/layer-utils/cpu-aggregator.ts +671 -0
  716. package/src/deckgl-layers/layer-utils/shader-utils.ts +41 -0
  717. package/src/deckgl-layers/line-layer/line-layer.ts +126 -0
  718. package/src/deckgl-layers/svg-icon-layer/scatterplot-icon-layer.ts +68 -0
  719. package/src/deckgl-layers/svg-icon-layer/svg-icon-layer.ts +102 -0
  720. package/src/index.ts +54 -0
  721. package/src/layers/aggregation-layer.ts +400 -0
  722. package/src/layers/arc-layer/arc-layer-icon.tsx +67 -0
  723. package/src/layers/arc-layer/arc-layer.ts +294 -0
  724. package/src/layers/base-layer.ts +1744 -0
  725. package/src/layers/cluster-layer/cluster-layer.ts +162 -0
  726. package/src/layers/geojson-layer/geojson-layer-icon.tsx +68 -0
  727. package/src/layers/geojson-layer/geojson-layer.ts +462 -0
  728. package/src/layers/geojson-layer/geojson-utils.ts +200 -0
  729. package/src/layers/grid-layer/grid-layer-icon.tsx +53 -0
  730. package/src/layers/grid-layer/grid-layer.ts +154 -0
  731. package/src/layers/grid-layer/grid-utils.ts +84 -0
  732. package/src/layers/h3-hexagon-layer/h3-hexagon-layer.ts +340 -0
  733. package/src/layers/h3-hexagon-layer/h3-utils.ts +67 -0
  734. package/src/layers/heatmap-layer/heatmap-layer.ts +255 -0
  735. package/src/layers/hexagon-layer/hexagon-layer.ts +157 -0
  736. package/src/layers/hexagon-layer/hexagon-utils.ts +64 -0
  737. package/src/layers/icon-layer/icon-info-modal.tsx +155 -0
  738. package/src/layers/icon-layer/icon-layer.ts +396 -0
  739. package/src/layers/index.ts +81 -0
  740. package/src/layers/layer-factory.ts +707 -0
  741. package/src/layers/layer-text-label.ts +62 -0
  742. package/src/layers/layer-update.ts +70 -0
  743. package/src/layers/line-layer/line-layer.ts +223 -0
  744. package/src/layers/mapbox-utils.ts +204 -0
  745. package/src/layers/mapboxgl-layer.ts +176 -0
  746. package/src/layers/point-layer/point-layer.ts +507 -0
  747. package/src/layers/s2-geometry-layer/s2-geometry-layer.ts +369 -0
  748. package/src/layers/s2-geometry-layer/s2-utils.ts +42 -0
  749. package/src/layers/scenegraph-layer/scenegraph-layer.ts +237 -0
  750. package/src/layers/trip-layer/trip-layer.ts +356 -0
  751. package/src/layers/trip-layer/trip-utils.ts +177 -0
  752. package/src/localization/formatted-message.tsx +42 -0
  753. package/src/localization/index.ts +29 -0
  754. package/src/localization/locales.ts +53 -0
  755. package/src/localization/messages.ts +40 -0
  756. package/src/localization/translations/ca.ts +476 -0
  757. package/src/localization/translations/cn.ts +477 -0
  758. package/src/localization/translations/en.ts +504 -0
  759. package/src/localization/translations/es.ts +477 -0
  760. package/src/localization/translations/fi.ts +448 -0
  761. package/src/localization/translations/ja.ts +477 -0
  762. package/src/localization/translations/pt.ts +449 -0
  763. package/src/localization/translations/ru.ts +488 -0
  764. package/src/middleware/index.ts +35 -0
  765. package/src/processors/data-processor.ts +723 -0
  766. package/src/processors/file-handler.ts +250 -0
  767. package/src/processors/index.ts +23 -0
  768. package/src/processors/types.ts +22 -0
  769. package/src/reducers/combined-updaters.ts +215 -0
  770. package/src/reducers/composer-helpers.ts +75 -0
  771. package/src/reducers/core.ts +111 -0
  772. package/src/reducers/index.ts +116 -0
  773. package/src/reducers/map-state-updaters.ts +271 -0
  774. package/src/reducers/map-state.ts +47 -0
  775. package/src/reducers/map-style-updaters.ts +638 -0
  776. package/src/reducers/map-style.ts +53 -0
  777. package/src/reducers/provider-state-updaters.ts +454 -0
  778. package/src/reducers/provider-state.ts +53 -0
  779. package/src/reducers/root.ts +230 -0
  780. package/src/reducers/types.ts +18 -0
  781. package/src/reducers/ui-state-updaters.ts +925 -0
  782. package/src/reducers/ui-state.ts +75 -0
  783. package/src/reducers/vis-state-merger.ts +625 -0
  784. package/src/reducers/vis-state-selectors.ts +35 -0
  785. package/src/reducers/vis-state-updaters.ts +2567 -0
  786. package/src/reducers/vis-state.ts +157 -0
  787. package/src/schemas/dataset-schema.ts +141 -0
  788. package/src/schemas/index.ts +52 -0
  789. package/src/schemas/schema-manager.ts +445 -0
  790. package/src/schemas/schema.ts +122 -0
  791. package/src/schemas/vis-state-schema.ts +761 -0
  792. package/src/styles/base.ts +1642 -0
  793. package/src/styles/media-breakpoints.ts +56 -0
  794. package/src/typedefs/deckgl.d.ts +25 -0
  795. package/src/utils/aggregate-utils.ts +71 -0
  796. package/src/utils/color-utils.ts +135 -0
  797. package/src/utils/data-scale-utils.ts +73 -0
  798. package/src/utils/data-utils.ts +459 -0
  799. package/src/utils/dataset-utils.ts +261 -0
  800. package/src/utils/dom-to-image.ts +533 -0
  801. package/src/utils/dom-utils.ts +354 -0
  802. package/src/utils/export-utils.ts +265 -0
  803. package/src/utils/filter-utils.ts +1181 -0
  804. package/src/utils/gpu-filter-utils.ts +249 -0
  805. package/src/utils/index.ts +72 -0
  806. package/src/utils/interaction-utils.ts +212 -0
  807. package/src/utils/layer-utils.ts +248 -0
  808. package/src/utils/map-style-utils/mapbox-gl-style-editor.ts +227 -0
  809. package/src/utils/notifications-utils.ts +89 -0
  810. package/src/utils/observe-dimensions.ts +127 -0
  811. package/src/utils/split-map-utils.ts +104 -0
  812. package/src/utils/table-utils/data-container-interface.ts +140 -0
  813. package/src/utils/table-utils/data-container-utils.ts +90 -0
  814. package/src/utils/table-utils/data-row.ts +110 -0
  815. package/src/utils/table-utils/indexed-data-container.ts +184 -0
  816. package/src/utils/table-utils/kepler-table.ts +638 -0
  817. package/src/utils/table-utils/row-data-container.ts +178 -0
  818. package/src/utils/utils.ts +228 -0
  819. package/CHANGELOG.md +0 -979
  820. package/actions.js +0 -21
  821. package/cloud-providers.js +0 -21
  822. package/components.js +0 -21
  823. package/constants.js +0 -21
  824. package/dist/actions/action-wrapper.js +0 -190
  825. package/dist/actions/actions.js +0 -189
  826. package/dist/actions/identity-actions.js +0 -96
  827. package/dist/actions/index.js +0 -144
  828. package/dist/actions/map-state-actions.js +0 -103
  829. package/dist/actions/map-style-actions.js +0 -152
  830. package/dist/actions/provider-actions.js +0 -113
  831. package/dist/actions/ui-state-actions.js +0 -288
  832. package/dist/actions/vis-state-actions.js +0 -985
  833. package/dist/cloud-providers/index.js +0 -22
  834. package/dist/cloud-providers/provider.js +0 -347
  835. package/dist/components/bottom-widget.js +0 -214
  836. package/dist/components/common/action-panel.js +0 -135
  837. package/dist/components/common/animation-control/animation-control.js +0 -128
  838. package/dist/components/common/animation-control/animation-controller.js +0 -250
  839. package/dist/components/common/animation-control/animation-speed-slider.js +0 -91
  840. package/dist/components/common/animation-control/floating-time-display.js +0 -146
  841. package/dist/components/common/animation-control/playback-controls.js +0 -262
  842. package/dist/components/common/animation-control/speed-control.js +0 -70
  843. package/dist/components/common/checkbox.js +0 -134
  844. package/dist/components/common/color-legend.js +0 -217
  845. package/dist/components/common/data-table/button.js +0 -53
  846. package/dist/components/common/data-table/canvas.js +0 -43
  847. package/dist/components/common/data-table/cell-size.js +0 -170
  848. package/dist/components/common/data-table/grid.js +0 -83
  849. package/dist/components/common/data-table/index.js +0 -472
  850. package/dist/components/common/data-table/option-dropdown.js +0 -99
  851. package/dist/components/common/dataset-label.js +0 -44
  852. package/dist/components/common/error-boundary.js +0 -78
  853. package/dist/components/common/field-selector.js +0 -248
  854. package/dist/components/common/field-token.js +0 -47
  855. package/dist/components/common/file-uploader/file-drop.js +0 -212
  856. package/dist/components/common/file-uploader/file-upload-progress.js +0 -104
  857. package/dist/components/common/file-uploader/file-upload.js +0 -265
  858. package/dist/components/common/file-uploader/upload-button.js +0 -100
  859. package/dist/components/common/histogram-plot.js +0 -107
  860. package/dist/components/common/icons/add.js +0 -64
  861. package/dist/components/common/icons/anchor_window.js +0 -56
  862. package/dist/components/common/icons/arrow-down-alt.js +0 -64
  863. package/dist/components/common/icons/arrow-down-solid .js +0 -64
  864. package/dist/components/common/icons/arrow-down.js +0 -64
  865. package/dist/components/common/icons/arrow-left.js +0 -67
  866. package/dist/components/common/icons/arrow-right.js +0 -64
  867. package/dist/components/common/icons/arrow-up-alt.js +0 -65
  868. package/dist/components/common/icons/arrow-up-solid.js +0 -64
  869. package/dist/components/common/icons/arrow-up.js +0 -64
  870. package/dist/components/common/icons/base.js +0 -106
  871. package/dist/components/common/icons/bug.js +0 -66
  872. package/dist/components/common/icons/cancel.js +0 -64
  873. package/dist/components/common/icons/checkmark.js +0 -70
  874. package/dist/components/common/icons/chevron-right.js +0 -69
  875. package/dist/components/common/icons/clipboard.js +0 -65
  876. package/dist/components/common/icons/clock.js +0 -66
  877. package/dist/components/common/icons/close.js +0 -69
  878. package/dist/components/common/icons/code-alt.js +0 -67
  879. package/dist/components/common/icons/copy.js +0 -69
  880. package/dist/components/common/icons/crosshairs.js +0 -67
  881. package/dist/components/common/icons/cube-3d.js +0 -68
  882. package/dist/components/common/icons/cursor-click.js +0 -68
  883. package/dist/components/common/icons/data-table.js +0 -65
  884. package/dist/components/common/icons/db.js +0 -65
  885. package/dist/components/common/icons/delete.js +0 -65
  886. package/dist/components/common/icons/docs.js +0 -80
  887. package/dist/components/common/icons/drag-n-drop.js +0 -66
  888. package/dist/components/common/icons/draw-polygon.js +0 -87
  889. package/dist/components/common/icons/email.js +0 -68
  890. package/dist/components/common/icons/expand.js +0 -66
  891. package/dist/components/common/icons/eye-seen.js +0 -66
  892. package/dist/components/common/icons/eye-unseen.js +0 -66
  893. package/dist/components/common/icons/file-type.js +0 -52
  894. package/dist/components/common/icons/file.js +0 -64
  895. package/dist/components/common/icons/files.js +0 -64
  896. package/dist/components/common/icons/filter-funnel.js +0 -64
  897. package/dist/components/common/icons/free-window.js +0 -56
  898. package/dist/components/common/icons/gear.js +0 -66
  899. package/dist/components/common/icons/hash.js +0 -64
  900. package/dist/components/common/icons/histogram.js +0 -63
  901. package/dist/components/common/icons/index.js +0 -537
  902. package/dist/components/common/icons/info.js +0 -77
  903. package/dist/components/common/icons/layers.js +0 -64
  904. package/dist/components/common/icons/left-arrow.js +0 -67
  905. package/dist/components/common/icons/legend.js +0 -64
  906. package/dist/components/common/icons/line-chart.js +0 -63
  907. package/dist/components/common/icons/login.js +0 -66
  908. package/dist/components/common/icons/logout.js +0 -65
  909. package/dist/components/common/icons/map-icon.js +0 -72
  910. package/dist/components/common/icons/map.js +0 -72
  911. package/dist/components/common/icons/messages.js +0 -64
  912. package/dist/components/common/icons/minus.js +0 -64
  913. package/dist/components/common/icons/pause.js +0 -64
  914. package/dist/components/common/icons/picture.js +0 -64
  915. package/dist/components/common/icons/pin.js +0 -64
  916. package/dist/components/common/icons/play.js +0 -64
  917. package/dist/components/common/icons/polygon.js +0 -89
  918. package/dist/components/common/icons/rectangle.js +0 -90
  919. package/dist/components/common/icons/reduce.js +0 -67
  920. package/dist/components/common/icons/reset.js +0 -64
  921. package/dist/components/common/icons/rocket.js +0 -64
  922. package/dist/components/common/icons/save.js +0 -66
  923. package/dist/components/common/icons/save2.js +0 -70
  924. package/dist/components/common/icons/search.js +0 -66
  925. package/dist/components/common/icons/settings.js +0 -66
  926. package/dist/components/common/icons/share.js +0 -64
  927. package/dist/components/common/icons/split.js +0 -92
  928. package/dist/components/common/icons/square-select.js +0 -66
  929. package/dist/components/common/icons/swap-horizontal.js +0 -67
  930. package/dist/components/common/icons/table.js +0 -63
  931. package/dist/components/common/icons/trash.js +0 -66
  932. package/dist/components/common/icons/upload.js +0 -65
  933. package/dist/components/common/icons/vert-dots.js +0 -102
  934. package/dist/components/common/icons/vert-three-dots.js +0 -77
  935. package/dist/components/common/icons/warning.js +0 -78
  936. package/dist/components/common/image-preview.js +0 -80
  937. package/dist/components/common/info-helper.js +0 -85
  938. package/dist/components/common/item-selector/accessor.js +0 -54
  939. package/dist/components/common/item-selector/chickleted-input.js +0 -116
  940. package/dist/components/common/item-selector/dropdown-list.js +0 -289
  941. package/dist/components/common/item-selector/item-selector-submenu.js +0 -90
  942. package/dist/components/common/item-selector/item-selector.js +0 -315
  943. package/dist/components/common/item-selector/typeahead.js +0 -450
  944. package/dist/components/common/line-chart.js +0 -128
  945. package/dist/components/common/loading-spinner.js +0 -66
  946. package/dist/components/common/logo.js +0 -94
  947. package/dist/components/common/map-layer-selector.js +0 -57
  948. package/dist/components/common/modal.js +0 -179
  949. package/dist/components/common/portaled.js +0 -276
  950. package/dist/components/common/progress-bar.js +0 -65
  951. package/dist/components/common/range-brush.js +0 -278
  952. package/dist/components/common/range-plot.js +0 -143
  953. package/dist/components/common/range-slider.js +0 -320
  954. package/dist/components/common/slider/mouse-event.js +0 -110
  955. package/dist/components/common/slider/slider-bar-handle.js +0 -114
  956. package/dist/components/common/slider/slider-handle.js +0 -158
  957. package/dist/components/common/slider/slider.js +0 -241
  958. package/dist/components/common/styled-components.js +0 -290
  959. package/dist/components/common/switch.js +0 -53
  960. package/dist/components/common/time-range-slider-time-title.js +0 -79
  961. package/dist/components/common/time-range-slider.js +0 -134
  962. package/dist/components/common/time-slider-marker.js +0 -136
  963. package/dist/components/common/toolbar-item.js +0 -73
  964. package/dist/components/common/toolbar.js +0 -44
  965. package/dist/components/common/vertical-toolbar.js +0 -33
  966. package/dist/components/container.js +0 -196
  967. package/dist/components/context.js +0 -38
  968. package/dist/components/editor/constants.js +0 -45
  969. package/dist/components/editor/editor.js +0 -242
  970. package/dist/components/editor/feature-action-panel.js +0 -146
  971. package/dist/components/editor/feature-styles.js +0 -67
  972. package/dist/components/editor/handle-style.js +0 -78
  973. package/dist/components/filters/components.js +0 -31
  974. package/dist/components/filters/filter-panels/filter-panel-with-field-select.js +0 -99
  975. package/dist/components/filters/filter-panels/multi-select-filter-panel.js +0 -73
  976. package/dist/components/filters/filter-panels/new-filter-panel.js +0 -91
  977. package/dist/components/filters/filter-panels/polygon-filter-panel.js +0 -90
  978. package/dist/components/filters/filter-panels/range-filter-panel.js +0 -73
  979. package/dist/components/filters/filter-panels/single-select-filter-panel.js +0 -73
  980. package/dist/components/filters/filter-panels/time-range-filter-panel.js +0 -83
  981. package/dist/components/filters/index.js +0 -42
  982. package/dist/components/filters/multi-select-filter.js +0 -48
  983. package/dist/components/filters/polygon-filter.js +0 -86
  984. package/dist/components/filters/range-filter.js +0 -48
  985. package/dist/components/filters/single-select-filter.js +0 -57
  986. package/dist/components/filters/time-range-filter.js +0 -75
  987. package/dist/components/filters/time-widget.js +0 -163
  988. package/dist/components/geocoder/geocoder.js +0 -282
  989. package/dist/components/geocoder-panel.js +0 -199
  990. package/dist/components/index.js +0 -1343
  991. package/dist/components/injector.js +0 -162
  992. package/dist/components/kepler-gl.js +0 -470
  993. package/dist/components/map/coordinate-info.js +0 -59
  994. package/dist/components/map/layer-hover-info.js +0 -168
  995. package/dist/components/map/layer-selector-panel.js +0 -103
  996. package/dist/components/map/locale-panel.js +0 -99
  997. package/dist/components/map/map-control-panel.js +0 -82
  998. package/dist/components/map/map-control-toolbar.js +0 -35
  999. package/dist/components/map/map-control-tooltip.js +0 -48
  1000. package/dist/components/map/map-control.js +0 -79
  1001. package/dist/components/map/map-draw-panel.js +0 -125
  1002. package/dist/components/map/map-legend-panel.js +0 -107
  1003. package/dist/components/map/map-legend.js +0 -226
  1004. package/dist/components/map/map-popover.js +0 -188
  1005. package/dist/components/map/split-map-button.js +0 -86
  1006. package/dist/components/map/toggle-3d-button.js +0 -75
  1007. package/dist/components/map-container.js +0 -515
  1008. package/dist/components/maps-layout.js +0 -56
  1009. package/dist/components/modal-container.js +0 -484
  1010. package/dist/components/modals/add-map-style-modal.js +0 -258
  1011. package/dist/components/modals/cloud-tile.js +0 -124
  1012. package/dist/components/modals/data-table-modal.js +0 -219
  1013. package/dist/components/modals/delete-data-modal.js +0 -58
  1014. package/dist/components/modals/error-display.js +0 -44
  1015. package/dist/components/modals/export-data-modal.js +0 -210
  1016. package/dist/components/modals/export-image-modal.js +0 -139
  1017. package/dist/components/modals/export-map-modal/components.js +0 -51
  1018. package/dist/components/modals/export-map-modal/export-html-map.js +0 -141
  1019. package/dist/components/modals/export-map-modal/export-json-map.js +0 -87
  1020. package/dist/components/modals/export-map-modal/export-map-modal.js +0 -113
  1021. package/dist/components/modals/image-modal-container.js +0 -83
  1022. package/dist/components/modals/load-data-modal.js +0 -93
  1023. package/dist/components/modals/load-storage-map.js +0 -253
  1024. package/dist/components/modals/loading-dialog.js +0 -54
  1025. package/dist/components/modals/modal-dialog.js +0 -33
  1026. package/dist/components/modals/modal-tabs.js +0 -99
  1027. package/dist/components/modals/overwrite-map-modal.js +0 -81
  1028. package/dist/components/modals/provider-modal-container.js +0 -84
  1029. package/dist/components/modals/save-map-modal.js +0 -202
  1030. package/dist/components/modals/share-map-modal.js +0 -191
  1031. package/dist/components/modals/status-panel.js +0 -82
  1032. package/dist/components/modals/storage-map-viewer.js +0 -122
  1033. package/dist/components/notification-panel/notification-item.js +0 -150
  1034. package/dist/components/notification-panel.js +0 -81
  1035. package/dist/components/performance.js +0 -109
  1036. package/dist/components/plot-container.js +0 -245
  1037. package/dist/components/side-panel/cloud-storage-dropdown.js +0 -57
  1038. package/dist/components/side-panel/common/dataset-info.js +0 -50
  1039. package/dist/components/side-panel/common/dataset-tag.js +0 -51
  1040. package/dist/components/side-panel/common/dataset-title.js +0 -155
  1041. package/dist/components/side-panel/common/source-data-catalog.js +0 -64
  1042. package/dist/components/side-panel/common/source-data-selector.js +0 -114
  1043. package/dist/components/side-panel/custom-panel.js +0 -56
  1044. package/dist/components/side-panel/filter-manager.js +0 -121
  1045. package/dist/components/side-panel/filter-panel/filter-panel-header.js +0 -70
  1046. package/dist/components/side-panel/filter-panel/filter-panel.js +0 -126
  1047. package/dist/components/side-panel/interaction-manager.js +0 -51
  1048. package/dist/components/side-panel/interaction-panel/brush-config.js +0 -58
  1049. package/dist/components/side-panel/interaction-panel/interaction-panel.js +0 -145
  1050. package/dist/components/side-panel/interaction-panel/tooltip-config/tooltip-chicklet.js +0 -210
  1051. package/dist/components/side-panel/interaction-panel/tooltip-config.js +0 -151
  1052. package/dist/components/side-panel/layer-manager.js +0 -290
  1053. package/dist/components/side-panel/layer-panel/color-dimension-scale-selector.js +0 -38
  1054. package/dist/components/side-panel/layer-panel/color-palette.js +0 -87
  1055. package/dist/components/side-panel/layer-panel/color-range-selector.js +0 -366
  1056. package/dist/components/side-panel/layer-panel/color-selector.js +0 -198
  1057. package/dist/components/side-panel/layer-panel/column-selector.js +0 -66
  1058. package/dist/components/side-panel/layer-panel/custom-markers-config-group.js +0 -36
  1059. package/dist/components/side-panel/layer-panel/custom-palette.js +0 -284
  1060. package/dist/components/side-panel/layer-panel/custom-picker.js +0 -115
  1061. package/dist/components/side-panel/layer-panel/dimension-scale-selector.js +0 -53
  1062. package/dist/components/side-panel/layer-panel/hex-column-config.js +0 -75
  1063. package/dist/components/side-panel/layer-panel/layer-aggregation-resolution.js +0 -18
  1064. package/dist/components/side-panel/layer-panel/layer-column-config.js +0 -97
  1065. package/dist/components/side-panel/layer-panel/layer-config-group.js +0 -211
  1066. package/dist/components/side-panel/layer-panel/layer-configurator.js +0 -970
  1067. package/dist/components/side-panel/layer-panel/layer-panel-header.js +0 -208
  1068. package/dist/components/side-panel/layer-panel/layer-panel.js +0 -180
  1069. package/dist/components/side-panel/layer-panel/layer-type-dropdown-list.js +0 -95
  1070. package/dist/components/side-panel/layer-panel/layer-type-list-item.js +0 -75
  1071. package/dist/components/side-panel/layer-panel/layer-type-selector.js +0 -93
  1072. package/dist/components/side-panel/layer-panel/layer-visibility-by-zoom.js +0 -106
  1073. package/dist/components/side-panel/layer-panel/single-color-palette.js +0 -99
  1074. package/dist/components/side-panel/layer-panel/text-label-panel.js +0 -164
  1075. package/dist/components/side-panel/layer-panel/vis-config-by-field-selector.js +0 -161
  1076. package/dist/components/side-panel/layer-panel/vis-config-slider.js +0 -81
  1077. package/dist/components/side-panel/layer-panel/vis-config-switch.js +0 -83
  1078. package/dist/components/side-panel/map-manager.js +0 -141
  1079. package/dist/components/side-panel/map-style-panel/map-layer-selector.js +0 -103
  1080. package/dist/components/side-panel/map-style-panel/map-style-selector.js +0 -80
  1081. package/dist/components/side-panel/panel-dropdown.js +0 -79
  1082. package/dist/components/side-panel/panel-header-action.js +0 -116
  1083. package/dist/components/side-panel/panel-header.js +0 -313
  1084. package/dist/components/side-panel/panel-tab.js +0 -72
  1085. package/dist/components/side-panel/panel-title.js +0 -39
  1086. package/dist/components/side-panel/panel-toggle.js +0 -72
  1087. package/dist/components/side-panel/side-bar.js +0 -148
  1088. package/dist/components/side-panel.js +0 -233
  1089. package/dist/connect/keplergl-connect.js +0 -59
  1090. package/dist/connect/with-local-selector.js +0 -105
  1091. package/dist/constants/action-types.js +0 -179
  1092. package/dist/constants/color-palette.js +0 -536
  1093. package/dist/constants/color-ranges.js +0 -81
  1094. package/dist/constants/custom-color-ranges.js +0 -410
  1095. package/dist/constants/default-settings.js +0 -820
  1096. package/dist/constants/index.js +0 -362
  1097. package/dist/constants/keyevent.js +0 -43
  1098. package/dist/constants/tooltip.js +0 -202
  1099. package/dist/constants/user-feedbacks.js +0 -32
  1100. package/dist/constants/user-guides.js +0 -36
  1101. package/dist/deckgl-layers/3d-building-layer/3d-building-layer.js +0 -85
  1102. package/dist/deckgl-layers/3d-building-layer/3d-building-utils.js +0 -181
  1103. package/dist/deckgl-layers/cluster-layer/cluster-layer.js +0 -313
  1104. package/dist/deckgl-layers/column-layer/enhanced-column-layer.js +0 -75
  1105. package/dist/deckgl-layers/grid-layer/enhanced-cpu-grid-layer.js +0 -95
  1106. package/dist/deckgl-layers/hexagon-layer/enhanced-hexagon-layer.js +0 -95
  1107. package/dist/deckgl-layers/layer-utils/cluster-utils.js +0 -108
  1108. package/dist/deckgl-layers/layer-utils/cpu-aggregator.js +0 -586
  1109. package/dist/deckgl-layers/layer-utils/shader-utils.js +0 -46
  1110. package/dist/deckgl-layers/line-layer/line-layer.js +0 -104
  1111. package/dist/deckgl-layers/svg-icon-layer/scatterplot-icon-layer.js +0 -74
  1112. package/dist/deckgl-layers/svg-icon-layer/svg-icon-layer.js +0 -114
  1113. package/dist/index.js +0 -136
  1114. package/dist/layers/aggregation-layer.js +0 -382
  1115. package/dist/layers/arc-layer/arc-layer-icon.js +0 -77
  1116. package/dist/layers/arc-layer/arc-layer.js +0 -250
  1117. package/dist/layers/base-layer.js +0 -1687
  1118. package/dist/layers/cluster-layer/cluster-layer-icon.js +0 -80
  1119. package/dist/layers/cluster-layer/cluster-layer.js +0 -140
  1120. package/dist/layers/default-layer-icon.js +0 -87
  1121. package/dist/layers/geojson-layer/geojson-layer-icon.js +0 -91
  1122. package/dist/layers/geojson-layer/geojson-layer.js +0 -413
  1123. package/dist/layers/geojson-layer/geojson-utils.js +0 -171
  1124. package/dist/layers/grid-layer/grid-layer-icon.js +0 -136
  1125. package/dist/layers/grid-layer/grid-layer.js +0 -104
  1126. package/dist/layers/grid-layer/grid-utils.js +0 -59
  1127. package/dist/layers/h3-hexagon-layer/h3-hexagon-layer-icon.js +0 -71
  1128. package/dist/layers/h3-hexagon-layer/h3-hexagon-layer.js +0 -314
  1129. package/dist/layers/h3-hexagon-layer/h3-utils.js +0 -86
  1130. package/dist/layers/heatmap-layer/heatmap-layer-icon.js +0 -88
  1131. package/dist/layers/heatmap-layer/heatmap-layer.js +0 -242
  1132. package/dist/layers/hexagon-layer/hexagon-layer-icon.js +0 -100
  1133. package/dist/layers/hexagon-layer/hexagon-layer.js +0 -108
  1134. package/dist/layers/hexagon-layer/hexagon-utils.js +0 -62
  1135. package/dist/layers/icon-layer/icon-info-modal.js +0 -114
  1136. package/dist/layers/icon-layer/icon-layer-icon.js +0 -73
  1137. package/dist/layers/icon-layer/icon-layer.js +0 -354
  1138. package/dist/layers/index.js +0 -96
  1139. package/dist/layers/layer-factory.js +0 -502
  1140. package/dist/layers/layer-text-label.js +0 -62
  1141. package/dist/layers/layer-update.js +0 -74
  1142. package/dist/layers/line-layer/line-layer-icon.js +0 -79
  1143. package/dist/layers/line-layer/line-layer.js +0 -189
  1144. package/dist/layers/mapbox-utils.js +0 -191
  1145. package/dist/layers/mapboxgl-layer.js +0 -195
  1146. package/dist/layers/point-layer/point-layer-icon.js +0 -94
  1147. package/dist/layers/point-layer/point-layer.js +0 -443
  1148. package/dist/layers/s2-geometry-layer/s2-geometry-layer.js +0 -302
  1149. package/dist/layers/s2-geometry-layer/s2-layer-icon.js +0 -70
  1150. package/dist/layers/s2-geometry-layer/s2-utils.js +0 -45
  1151. package/dist/layers/scenegraph-layer/scenegraph-info-modal.js +0 -54
  1152. package/dist/layers/scenegraph-layer/scenegraph-layer-icon.js +0 -151
  1153. package/dist/layers/scenegraph-layer/scenegraph-layer.js +0 -227
  1154. package/dist/layers/trip-layer/trip-info-modal.js +0 -59
  1155. package/dist/layers/trip-layer/trip-layer-icon.js +0 -89
  1156. package/dist/layers/trip-layer/trip-layer.js +0 -361
  1157. package/dist/layers/trip-layer/trip-utils.js +0 -181
  1158. package/dist/layers/types.js +0 -44
  1159. package/dist/localization/en.js +0 -494
  1160. package/dist/localization/formatted-message.js +0 -40
  1161. package/dist/localization/index.js +0 -54
  1162. package/dist/localization/locales.js +0 -59
  1163. package/dist/middleware/index.js +0 -44
  1164. package/dist/processors/data-processor.js +0 -720
  1165. package/dist/processors/file-handler.js +0 -356
  1166. package/dist/processors/index.js +0 -104
  1167. package/dist/reducers/combined-updaters.js +0 -184
  1168. package/dist/reducers/composer-helpers.js +0 -111
  1169. package/dist/reducers/composers.js +0 -40
  1170. package/dist/reducers/core.js +0 -123
  1171. package/dist/reducers/index.js +0 -125
  1172. package/dist/reducers/map-state-updaters.js +0 -227
  1173. package/dist/reducers/map-state.js +0 -52
  1174. package/dist/reducers/map-style-updaters.js +0 -487
  1175. package/dist/reducers/map-style.js +0 -51
  1176. package/dist/reducers/provider-state-updaters.js +0 -466
  1177. package/dist/reducers/provider-state.js +0 -53
  1178. package/dist/reducers/root.js +0 -212
  1179. package/dist/reducers/ui-state-updaters.js +0 -755
  1180. package/dist/reducers/ui-state.js +0 -53
  1181. package/dist/reducers/vis-state-merger.js +0 -565
  1182. package/dist/reducers/vis-state-selectors.js +0 -47
  1183. package/dist/reducers/vis-state-updaters.js +0 -2156
  1184. package/dist/reducers/vis-state.js +0 -53
  1185. package/dist/schemas/dataset-schema.js +0 -169
  1186. package/dist/schemas/index.js +0 -125
  1187. package/dist/schemas/map-state-schema.js +0 -53
  1188. package/dist/schemas/map-style-schema.js +0 -108
  1189. package/dist/schemas/schema-manager.js +0 -244
  1190. package/dist/schemas/schema-utils.js +0 -58
  1191. package/dist/schemas/schema.js +0 -119
  1192. package/dist/schemas/versions.js +0 -34
  1193. package/dist/schemas/vis-state-schema.js +0 -906
  1194. package/dist/styles/base.js +0 -1297
  1195. package/dist/styles/index.js +0 -28
  1196. package/dist/styles/media-breakpoints.js +0 -51
  1197. package/dist/tasks/tasks.js +0 -94
  1198. package/dist/templates/export-map-html.js +0 -42
  1199. package/dist/utils/aggregate-utils.js +0 -71
  1200. package/dist/utils/color-utils.js +0 -129
  1201. package/dist/utils/custom-scales.js +0 -22
  1202. package/dist/utils/data-scale-utils.js +0 -75
  1203. package/dist/utils/data-utils.js +0 -462
  1204. package/dist/utils/dataset-utils.js +0 -237
  1205. package/dist/utils/dom-to-image.js +0 -479
  1206. package/dist/utils/dom-utils.js +0 -343
  1207. package/dist/utils/export-utils.js +0 -260
  1208. package/dist/utils/filter-utils.js +0 -1136
  1209. package/dist/utils/gl-utils.js +0 -43
  1210. package/dist/utils/gpu-filter-utils.js +0 -248
  1211. package/dist/utils/index.js +0 -220
  1212. package/dist/utils/interaction-utils.js +0 -177
  1213. package/dist/utils/layer-utils.js +0 -201
  1214. package/dist/utils/locale-utils.js +0 -56
  1215. package/dist/utils/map-info-utils.js +0 -31
  1216. package/dist/utils/map-style-utils/mapbox-gl-style-editor.js +0 -213
  1217. package/dist/utils/map-style-utils/mapbox-utils.js +0 -33
  1218. package/dist/utils/mapbox-utils.js +0 -36
  1219. package/dist/utils/notifications-utils.js +0 -90
  1220. package/dist/utils/observe-dimensions.js +0 -142
  1221. package/dist/utils/projection-utils.js +0 -72
  1222. package/dist/utils/searcher-utils.js +0 -42
  1223. package/dist/utils/split-map-utils.js +0 -112
  1224. package/dist/utils/table-utils/data-container-utils.js +0 -73
  1225. package/dist/utils/table-utils/data-row.js +0 -71
  1226. package/dist/utils/table-utils/index.js +0 -19
  1227. package/dist/utils/table-utils/indexed-data-container.js +0 -222
  1228. package/dist/utils/table-utils/kepler-table.js +0 -520
  1229. package/dist/utils/table-utils/row-data-container.js +0 -217
  1230. package/dist/utils/utils.js +0 -216
  1231. package/layers.js +0 -21
  1232. package/localization.js +0 -21
  1233. package/middleware.js +0 -21
  1234. package/processors.js +0 -21
  1235. package/reducers.js +0 -21
  1236. package/schemas.js +0 -21
  1237. package/src/actions/action-wrapper.js +0 -183
  1238. package/src/actions/actions.d.ts +0 -104
  1239. package/src/actions/actions.js +0 -178
  1240. package/src/actions/identity-actions.d.ts +0 -53
  1241. package/src/actions/identity-actions.js +0 -83
  1242. package/src/actions/index.d.ts +0 -23
  1243. package/src/actions/map-state-actions.d.ts +0 -46
  1244. package/src/actions/map-state-actions.js +0 -90
  1245. package/src/actions/map-style-actions.d.ts +0 -116
  1246. package/src/actions/map-style-actions.js +0 -135
  1247. package/src/actions/provider-actions.d.ts +0 -203
  1248. package/src/actions/provider-actions.js +0 -94
  1249. package/src/actions/ui-state-actions.d.ts +0 -200
  1250. package/src/actions/ui-state-actions.js +0 -272
  1251. package/src/actions/vis-state-actions.d.ts +0 -502
  1252. package/src/actions/vis-state-actions.js +0 -919
  1253. package/src/cloud-providers/index.d.ts +0 -53
  1254. package/src/cloud-providers/index.js +0 -21
  1255. package/src/cloud-providers/provider.js +0 -233
  1256. package/src/components/bottom-widget.d.ts +0 -33
  1257. package/src/components/bottom-widget.js +0 -235
  1258. package/src/components/common/action-panel.d.ts +0 -24
  1259. package/src/components/common/action-panel.js +0 -177
  1260. package/src/components/common/animation-control/animation-control.js +0 -155
  1261. package/src/components/common/animation-control/animation-controller.js +0 -224
  1262. package/src/components/common/animation-control/animation-speed-slider.js +0 -79
  1263. package/src/components/common/animation-control/floating-time-display.js +0 -192
  1264. package/src/components/common/animation-control/playback-controls.js +0 -278
  1265. package/src/components/common/animation-control/speed-control.js +0 -71
  1266. package/src/components/common/checkbox.js +0 -128
  1267. package/src/components/common/color-legend.js +0 -198
  1268. package/src/components/common/data-table/button.js +0 -47
  1269. package/src/components/common/data-table/cell-size.js +0 -180
  1270. package/src/components/common/data-table/grid.js +0 -55
  1271. package/src/components/common/data-table/index.js +0 -620
  1272. package/src/components/common/data-table/option-dropdown.js +0 -110
  1273. package/src/components/common/dataset-label.js +0 -40
  1274. package/src/components/common/error-boundary.js +0 -43
  1275. package/src/components/common/field-selector.js +0 -233
  1276. package/src/components/common/field-token.js +0 -56
  1277. package/src/components/common/file-uploader/file-drop.d.ts +0 -19
  1278. package/src/components/common/file-uploader/file-drop.js +0 -196
  1279. package/src/components/common/file-uploader/file-upload-progress.d.ts +0 -11
  1280. package/src/components/common/file-uploader/file-upload-progress.js +0 -110
  1281. package/src/components/common/file-uploader/file-upload.d.ts +0 -22
  1282. package/src/components/common/file-uploader/file-upload.js +0 -301
  1283. package/src/components/common/file-uploader/upload-button.d.ts.wip +0 -11
  1284. package/src/components/common/file-uploader/upload-button.js +0 -83
  1285. package/src/components/common/histogram-plot.js +0 -102
  1286. package/src/components/common/icons/add.js +0 -43
  1287. package/src/components/common/icons/anchor_window.js +0 -53
  1288. package/src/components/common/icons/arrow-down-alt.js +0 -43
  1289. package/src/components/common/icons/arrow-down-solid .js +0 -43
  1290. package/src/components/common/icons/arrow-down.js +0 -46
  1291. package/src/components/common/icons/arrow-left.js +0 -48
  1292. package/src/components/common/icons/arrow-right.js +0 -46
  1293. package/src/components/common/icons/arrow-up-alt.js +0 -46
  1294. package/src/components/common/icons/arrow-up-solid.js +0 -43
  1295. package/src/components/common/icons/arrow-up.js +0 -46
  1296. package/src/components/common/icons/base.js +0 -90
  1297. package/src/components/common/icons/bug.js +0 -46
  1298. package/src/components/common/icons/cancel.js +0 -43
  1299. package/src/components/common/icons/checkmark.js +0 -45
  1300. package/src/components/common/icons/clipboard.js +0 -46
  1301. package/src/components/common/icons/clock.js +0 -44
  1302. package/src/components/common/icons/close.js +0 -49
  1303. package/src/components/common/icons/code-alt.js +0 -43
  1304. package/src/components/common/icons/copy.js +0 -44
  1305. package/src/components/common/icons/crosshairs.js +0 -43
  1306. package/src/components/common/icons/cube-3d.js +0 -45
  1307. package/src/components/common/icons/cursor-click.js +0 -49
  1308. package/src/components/common/icons/data-table.js +0 -45
  1309. package/src/components/common/icons/db.js +0 -45
  1310. package/src/components/common/icons/delete.js +0 -44
  1311. package/src/components/common/icons/docs.js +0 -46
  1312. package/src/components/common/icons/drag-n-drop.js +0 -44
  1313. package/src/components/common/icons/draw-polygon.js +0 -60
  1314. package/src/components/common/icons/email.js +0 -45
  1315. package/src/components/common/icons/expand.js +0 -45
  1316. package/src/components/common/icons/eye-seen.js +0 -44
  1317. package/src/components/common/icons/eye-unseen.js +0 -44
  1318. package/src/components/common/icons/file-type.js +0 -57
  1319. package/src/components/common/icons/file.js +0 -43
  1320. package/src/components/common/icons/files.js +0 -42
  1321. package/src/components/common/icons/filter-funnel.js +0 -43
  1322. package/src/components/common/icons/free-window.js +0 -53
  1323. package/src/components/common/icons/gear.js +0 -45
  1324. package/src/components/common/icons/hash.js +0 -43
  1325. package/src/components/common/icons/histogram.js +0 -47
  1326. package/src/components/common/icons/index.js +0 -96
  1327. package/src/components/common/icons/info.js +0 -54
  1328. package/src/components/common/icons/layers.js +0 -43
  1329. package/src/components/common/icons/left-arrow.js +0 -43
  1330. package/src/components/common/icons/legend.js +0 -43
  1331. package/src/components/common/icons/line-chart.js +0 -45
  1332. package/src/components/common/icons/login.js +0 -46
  1333. package/src/components/common/icons/logout.js +0 -43
  1334. package/src/components/common/icons/map-icon.js +0 -69
  1335. package/src/components/common/icons/map.js +0 -69
  1336. package/src/components/common/icons/messages.js +0 -43
  1337. package/src/components/common/icons/minus.js +0 -45
  1338. package/src/components/common/icons/pause.js +0 -43
  1339. package/src/components/common/icons/picture.js +0 -43
  1340. package/src/components/common/icons/pin.js +0 -43
  1341. package/src/components/common/icons/play.js +0 -43
  1342. package/src/components/common/icons/polygon.js +0 -74
  1343. package/src/components/common/icons/rectangle.js +0 -75
  1344. package/src/components/common/icons/reduce.js +0 -48
  1345. package/src/components/common/icons/reset.js +0 -43
  1346. package/src/components/common/icons/rocket.js +0 -43
  1347. package/src/components/common/icons/save.js +0 -44
  1348. package/src/components/common/icons/save2.js +0 -47
  1349. package/src/components/common/icons/search.js +0 -44
  1350. package/src/components/common/icons/settings.js +0 -45
  1351. package/src/components/common/icons/share.js +0 -43
  1352. package/src/components/common/icons/split.js +0 -63
  1353. package/src/components/common/icons/square-select.js +0 -44
  1354. package/src/components/common/icons/table.js +0 -46
  1355. package/src/components/common/icons/trash.js +0 -51
  1356. package/src/components/common/icons/upload.js +0 -44
  1357. package/src/components/common/icons/vert-dots.js +0 -50
  1358. package/src/components/common/icons/vert-three-dots.js +0 -45
  1359. package/src/components/common/icons/warning.js +0 -46
  1360. package/src/components/common/image-preview.js +0 -111
  1361. package/src/components/common/info-helper.js +0 -84
  1362. package/src/components/common/item-selector/accessor.js +0 -45
  1363. package/src/components/common/item-selector/chickleted-input.js +0 -143
  1364. package/src/components/common/item-selector/dropdown-list.js +0 -258
  1365. package/src/components/common/item-selector/item-selector.js +0 -360
  1366. package/src/components/common/item-selector/typeahead.js +0 -507
  1367. package/src/components/common/line-chart.js +0 -134
  1368. package/src/components/common/loading-spinner.js +0 -64
  1369. package/src/components/common/logo.js +0 -92
  1370. package/src/components/common/map-layer-selector.d.ts +0 -10
  1371. package/src/components/common/map-layer-selector.js +0 -54
  1372. package/src/components/common/modal.js +0 -233
  1373. package/src/components/common/portaled.js +0 -264
  1374. package/src/components/common/progress-bar.d.ts +0 -13
  1375. package/src/components/common/progress-bar.js +0 -49
  1376. package/src/components/common/range-brush.js +0 -256
  1377. package/src/components/common/range-plot.js +0 -139
  1378. package/src/components/common/range-slider.js +0 -299
  1379. package/src/components/common/slider/mouse-event.js +0 -97
  1380. package/src/components/common/slider/slider-bar-handle.js +0 -97
  1381. package/src/components/common/slider/slider-handle.js +0 -181
  1382. package/src/components/common/slider/slider.js +0 -213
  1383. package/src/components/common/styled-components.js +0 -657
  1384. package/src/components/common/switch.js +0 -50
  1385. package/src/components/common/time-range-slider-time-title.js +0 -76
  1386. package/src/components/common/time-range-slider.js +0 -163
  1387. package/src/components/common/time-slider-marker.js +0 -168
  1388. package/src/components/common/toolbar-item.d.ts +0 -14
  1389. package/src/components/common/toolbar-item.js +0 -83
  1390. package/src/components/common/toolbar.js +0 -45
  1391. package/src/components/common/vertical-toolbar.js +0 -35
  1392. package/src/components/container.js +0 -173
  1393. package/src/components/context.d.ts +0 -10
  1394. package/src/components/context.js +0 -32
  1395. package/src/components/editor/editor.js +0 -218
  1396. package/src/components/editor/feature-action-panel.js +0 -143
  1397. package/src/components/editor/feature-styles.js +0 -75
  1398. package/src/components/editor/handle-style.js +0 -89
  1399. package/src/components/filters/filter-panels/filter-panel-types.d.ts +0 -28
  1400. package/src/components/filters/filter-panels/filter-panel-with-field-select.js +0 -124
  1401. package/src/components/filters/filter-panels/multi-select-filter-panel.js +0 -75
  1402. package/src/components/filters/filter-panels/new-filter-panel.js +0 -99
  1403. package/src/components/filters/filter-panels/polygon-filter-panel.js +0 -96
  1404. package/src/components/filters/filter-panels/range-filter-panel.js +0 -75
  1405. package/src/components/filters/filter-panels/single-select-filter-panel.js +0 -75
  1406. package/src/components/filters/filter-panels/time-range-filter-panel.js +0 -95
  1407. package/src/components/filters/multi-select-filter.js +0 -36
  1408. package/src/components/filters/polygon-filter.d.ts +0 -13
  1409. package/src/components/filters/polygon-filter.js +0 -73
  1410. package/src/components/filters/range-filter.js +0 -43
  1411. package/src/components/filters/single-select-filter.js +0 -49
  1412. package/src/components/filters/time-range-filter.js +0 -68
  1413. package/src/components/filters/time-widget.js +0 -228
  1414. package/src/components/geocoder/geocoder.d.ts +0 -33
  1415. package/src/components/geocoder/geocoder.js +0 -272
  1416. package/src/components/geocoder-panel.js +0 -191
  1417. package/src/components/index.js +0 -247
  1418. package/src/components/injector.js +0 -161
  1419. package/src/components/kepler-gl.js +0 -518
  1420. package/src/components/map/coordinate-info.js +0 -53
  1421. package/src/components/map/layer-hover-info.d.ts +0 -12
  1422. package/src/components/map/layer-hover-info.js +0 -185
  1423. package/src/components/map/layer-selector-panel.d.ts +0 -16
  1424. package/src/components/map/layer-selector-panel.js +0 -106
  1425. package/src/components/map/locale-panel.d.ts +0 -12
  1426. package/src/components/map/locale-panel.js +0 -91
  1427. package/src/components/map/map-control-panel.d.ts +0 -11
  1428. package/src/components/map/map-control-panel.js +0 -98
  1429. package/src/components/map/map-control-tooltip.d.ts +0 -8
  1430. package/src/components/map/map-control-tooltip.js +0 -40
  1431. package/src/components/map/map-control.d.ts +0 -37
  1432. package/src/components/map/map-control.js +0 -100
  1433. package/src/components/map/map-draw-panel.d.ts +0 -16
  1434. package/src/components/map/map-draw-panel.js +0 -125
  1435. package/src/components/map/map-legend-panel.d.ts +0 -20
  1436. package/src/components/map/map-legend-panel.js +0 -100
  1437. package/src/components/map/map-legend.d.ts +0 -58
  1438. package/src/components/map/map-legend.js +0 -228
  1439. package/src/components/map/map-popover.d.ts +0 -28
  1440. package/src/components/map/map-popover.js +0 -250
  1441. package/src/components/map/split-map-button.d.ts +0 -19
  1442. package/src/components/map/split-map-button.js +0 -82
  1443. package/src/components/map/toggle-3d-button.d.ts +0 -16
  1444. package/src/components/map/toggle-3d-button.js +0 -75
  1445. package/src/components/map-container.d.ts +0 -18
  1446. package/src/components/map-container.js +0 -499
  1447. package/src/components/maps-layout.d.ts +0 -5
  1448. package/src/components/maps-layout.js +0 -40
  1449. package/src/components/modal-container.d.ts +0 -37
  1450. package/src/components/modal-container.js +0 -543
  1451. package/src/components/modals/add-map-style-modal.js +0 -298
  1452. package/src/components/modals/cloud-tile.js +0 -147
  1453. package/src/components/modals/data-table-modal.js +0 -217
  1454. package/src/components/modals/delete-data-modal.js +0 -48
  1455. package/src/components/modals/error-display.js +0 -39
  1456. package/src/components/modals/export-data-modal.js +0 -193
  1457. package/src/components/modals/export-image-modal.d.ts +0 -21
  1458. package/src/components/modals/export-image-modal.js +0 -144
  1459. package/src/components/modals/export-map-modal/export-html-map.d.ts +0 -21
  1460. package/src/components/modals/export-map-modal/export-html-map.js +0 -145
  1461. package/src/components/modals/export-map-modal/export-json-map.js +0 -100
  1462. package/src/components/modals/export-map-modal/export-map-modal.js +0 -114
  1463. package/src/components/modals/image-modal-container.d.ts +0 -13
  1464. package/src/components/modals/image-modal-container.js +0 -76
  1465. package/src/components/modals/load-data-modal.d.ts +0 -30
  1466. package/src/components/modals/load-data-modal.js +0 -94
  1467. package/src/components/modals/load-storage-map.js +0 -381
  1468. package/src/components/modals/loading-dialog.js +0 -69
  1469. package/src/components/modals/modal-tabs.js +0 -126
  1470. package/src/components/modals/overwrite-map-modal.d.ts +0 -18
  1471. package/src/components/modals/overwrite-map-modal.js +0 -97
  1472. package/src/components/modals/provider-modal-container.d.ts +0 -12
  1473. package/src/components/modals/provider-modal-container.js +0 -60
  1474. package/src/components/modals/save-map-modal.d.ts +0 -32
  1475. package/src/components/modals/save-map-modal.js +0 -244
  1476. package/src/components/modals/share-map-modal.js +0 -208
  1477. package/src/components/modals/status-panel.js +0 -95
  1478. package/src/components/modals/storage-map-viewer.js +0 -177
  1479. package/src/components/notification-panel/notification-item.js +0 -132
  1480. package/src/components/notification-panel.js +0 -72
  1481. package/src/components/performance.js +0 -103
  1482. package/src/components/plot-container.js +0 -228
  1483. package/src/components/side-panel/common/dataset-info.js +0 -45
  1484. package/src/components/side-panel/common/dataset-tag.js +0 -55
  1485. package/src/components/side-panel/common/dataset-title.js +0 -146
  1486. package/src/components/side-panel/common/source-data-catalog.js +0 -61
  1487. package/src/components/side-panel/common/source-data-selector.js +0 -79
  1488. package/src/components/side-panel/filter-manager.js +0 -105
  1489. package/src/components/side-panel/filter-panel/filter-panel-header.js +0 -83
  1490. package/src/components/side-panel/filter-panel/filter-panel.js +0 -126
  1491. package/src/components/side-panel/interaction-manager.js +0 -46
  1492. package/src/components/side-panel/interaction-panel/brush-config.js +0 -51
  1493. package/src/components/side-panel/interaction-panel/interaction-panel.js +0 -115
  1494. package/src/components/side-panel/interaction-panel/tooltip-config/tooltip-chicklet.js +0 -199
  1495. package/src/components/side-panel/interaction-panel/tooltip-config.js +0 -190
  1496. package/src/components/side-panel/layer-manager.js +0 -290
  1497. package/src/components/side-panel/layer-panel/color-dimension-scale-selector.js +0 -33
  1498. package/src/components/side-panel/layer-panel/color-palette.js +0 -90
  1499. package/src/components/side-panel/layer-panel/color-range-selector.js +0 -359
  1500. package/src/components/side-panel/layer-panel/color-selector.js +0 -196
  1501. package/src/components/side-panel/layer-panel/column-selector.js +0 -70
  1502. package/src/components/side-panel/layer-panel/custom-markers-config-group.js +0 -30
  1503. package/src/components/side-panel/layer-panel/custom-palette.js +0 -296
  1504. package/src/components/side-panel/layer-panel/custom-picker.js +0 -88
  1505. package/src/components/side-panel/layer-panel/dimension-scale-selector.js +0 -48
  1506. package/src/components/side-panel/layer-panel/hex-column-config.js +0 -45
  1507. package/src/components/side-panel/layer-panel/layer-column-config.js +0 -113
  1508. package/src/components/side-panel/layer-panel/layer-config-group.js +0 -237
  1509. package/src/components/side-panel/layer-panel/layer-configurator.js +0 -1412
  1510. package/src/components/side-panel/layer-panel/layer-panel-header.js +0 -236
  1511. package/src/components/side-panel/layer-panel/layer-panel.js +0 -171
  1512. package/src/components/side-panel/layer-panel/layer-type-dropdown-list.js +0 -105
  1513. package/src/components/side-panel/layer-panel/layer-type-list-item.js +0 -83
  1514. package/src/components/side-panel/layer-panel/layer-type-selector.js +0 -89
  1515. package/src/components/side-panel/layer-panel/layer-visibility-by-zoom.js +0 -123
  1516. package/src/components/side-panel/layer-panel/single-color-palette.js +0 -98
  1517. package/src/components/side-panel/layer-panel/text-label-panel.js +0 -179
  1518. package/src/components/side-panel/layer-panel/vis-config-by-field-selector.js +0 -163
  1519. package/src/components/side-panel/layer-panel/vis-config-slider.js +0 -82
  1520. package/src/components/side-panel/layer-panel/vis-config-switch.js +0 -87
  1521. package/src/components/side-panel/map-manager.js +0 -114
  1522. package/src/components/side-panel/map-style-panel/map-layer-selector.js +0 -128
  1523. package/src/components/side-panel/map-style-panel/map-style-selector.js +0 -111
  1524. package/src/components/side-panel/panel-dropdown.js +0 -53
  1525. package/src/components/side-panel/panel-header-action.js +0 -106
  1526. package/src/components/side-panel/panel-header.js +0 -321
  1527. package/src/components/side-panel/panel-tab.js +0 -62
  1528. package/src/components/side-panel/panel-title.js +0 -32
  1529. package/src/components/side-panel/panel-toggle.js +0 -70
  1530. package/src/components/side-panel/side-bar.js +0 -136
  1531. package/src/components/side-panel.d.ts +0 -33
  1532. package/src/components/side-panel.js +0 -253
  1533. package/src/connect/keplergl-connect.js +0 -47
  1534. package/src/connect/with-local-selector.d.ts +0 -11
  1535. package/src/connect/with-local-selector.js +0 -67
  1536. package/src/constants/action-types.d.ts +0 -135
  1537. package/src/constants/action-types.js +0 -184
  1538. package/src/constants/color-ranges.js +0 -72
  1539. package/src/constants/default-settings.js +0 -994
  1540. package/src/constants/index.js +0 -80
  1541. package/src/deckgl-layers/3d-building-layer/3d-building-layer.js +0 -56
  1542. package/src/deckgl-layers/3d-building-layer/3d-building-utils.js +0 -192
  1543. package/src/deckgl-layers/column-layer/enhanced-column-layer.js +0 -63
  1544. package/src/deckgl-layers/grid-layer/enhanced-cpu-grid-layer.js +0 -70
  1545. package/src/deckgl-layers/hexagon-layer/enhanced-hexagon-layer.js +0 -70
  1546. package/src/deckgl-layers/layer-utils/cluster-utils.js +0 -76
  1547. package/src/deckgl-layers/layer-utils/cpu-aggregator.js +0 -583
  1548. package/src/deckgl-layers/layer-utils/shader-utils.js +0 -41
  1549. package/src/deckgl-layers/line-layer/line-layer.js +0 -122
  1550. package/src/deckgl-layers/svg-icon-layer/scatterplot-icon-layer.js +0 -57
  1551. package/src/deckgl-layers/svg-icon-layer/svg-icon-layer.js +0 -85
  1552. package/src/index.js +0 -52
  1553. package/src/layers/aggregation-layer.js +0 -356
  1554. package/src/layers/arc-layer/arc-layer-icon.js +0 -67
  1555. package/src/layers/arc-layer/arc-layer.js +0 -221
  1556. package/src/layers/base-layer.js +0 -1545
  1557. package/src/layers/cluster-layer/cluster-layer.js +0 -125
  1558. package/src/layers/geojson-layer/geojson-layer-icon.js +0 -68
  1559. package/src/layers/geojson-layer/geojson-layer.js +0 -344
  1560. package/src/layers/geojson-layer/geojson-utils.js +0 -179
  1561. package/src/layers/grid-layer/grid-layer-icon.js +0 -53
  1562. package/src/layers/grid-layer/grid-layer.js +0 -95
  1563. package/src/layers/grid-layer/grid-utils.js +0 -71
  1564. package/src/layers/h3-hexagon-layer/h3-hexagon-layer.js +0 -264
  1565. package/src/layers/h3-hexagon-layer/h3-utils.js +0 -65
  1566. package/src/layers/heatmap-layer/heatmap-layer.js +0 -226
  1567. package/src/layers/hexagon-layer/hexagon-layer.js +0 -95
  1568. package/src/layers/hexagon-layer/hexagon-utils.js +0 -63
  1569. package/src/layers/icon-layer/icon-info-modal.js +0 -155
  1570. package/src/layers/icon-layer/icon-layer.js +0 -324
  1571. package/src/layers/index.d.ts +0 -128
  1572. package/src/layers/index.js +0 -72
  1573. package/src/layers/layer-factory.d.ts +0 -149
  1574. package/src/layers/layer-factory.js +0 -487
  1575. package/src/layers/layer-text-label.js +0 -62
  1576. package/src/layers/layer-update.js +0 -71
  1577. package/src/layers/line-layer/line-layer.js +0 -161
  1578. package/src/layers/mapbox-utils.js +0 -195
  1579. package/src/layers/mapboxgl-layer.js +0 -154
  1580. package/src/layers/point-layer/point-layer.js +0 -412
  1581. package/src/layers/s2-geometry-layer/s2-geometry-layer.js +0 -265
  1582. package/src/layers/s2-geometry-layer/s2-utils.js +0 -36
  1583. package/src/layers/scenegraph-layer/scenegraph-layer.js +0 -182
  1584. package/src/layers/trip-layer/trip-layer.js +0 -295
  1585. package/src/layers/trip-layer/trip-utils.js +0 -169
  1586. package/src/localization/en.js +0 -504
  1587. package/src/localization/formatted-message.js +0 -33
  1588. package/src/localization/index.js +0 -32
  1589. package/src/localization/locales.js +0 -46
  1590. package/src/middleware/index.js +0 -34
  1591. package/src/processors/data-processor.d.ts +0 -57
  1592. package/src/processors/data-processor.js +0 -684
  1593. package/src/processors/file-handler.d.ts +0 -46
  1594. package/src/processors/file-handler.js +0 -220
  1595. package/src/processors/index.js +0 -44
  1596. package/src/reducers/combined-updaters.d.ts +0 -26
  1597. package/src/reducers/combined-updaters.js +0 -198
  1598. package/src/reducers/composer-helpers.d.ts +0 -32
  1599. package/src/reducers/composer-helpers.js +0 -70
  1600. package/src/reducers/core.d.ts +0 -25
  1601. package/src/reducers/core.js +0 -97
  1602. package/src/reducers/index.d.ts +0 -118
  1603. package/src/reducers/index.js +0 -53
  1604. package/src/reducers/map-state-updaters.d.ts +0 -64
  1605. package/src/reducers/map-state-updaters.js +0 -224
  1606. package/src/reducers/map-state.js +0 -47
  1607. package/src/reducers/map-style-updaters.d.ts +0 -76
  1608. package/src/reducers/map-style-updaters.js +0 -541
  1609. package/src/reducers/map-style.js +0 -53
  1610. package/src/reducers/provider-state-updaters.d.ts +0 -88
  1611. package/src/reducers/provider-state-updaters.js +0 -428
  1612. package/src/reducers/provider-state.js +0 -53
  1613. package/src/reducers/root.js +0 -230
  1614. package/src/reducers/types.d.ts +0 -10
  1615. package/src/reducers/ui-state-updaters.d.ts +0 -198
  1616. package/src/reducers/ui-state-updaters.js +0 -766
  1617. package/src/reducers/ui-state.js +0 -73
  1618. package/src/reducers/vis-state-merger.d.ts +0 -78
  1619. package/src/reducers/vis-state-merger.js +0 -557
  1620. package/src/reducers/vis-state-selectors.js +0 -35
  1621. package/src/reducers/vis-state-updaters.d.ts +0 -534
  1622. package/src/reducers/vis-state-updaters.js +0 -2137
  1623. package/src/reducers/vis-state.js +0 -155
  1624. package/src/schemas/dataset-schema.js +0 -141
  1625. package/src/schemas/index.d.ts +0 -24
  1626. package/src/schemas/index.js +0 -42
  1627. package/src/schemas/schema-manager.d.ts +0 -229
  1628. package/src/schemas/schema-manager.js +0 -228
  1629. package/src/schemas/schema.d.ts +0 -47
  1630. package/src/schemas/schema.js +0 -90
  1631. package/src/schemas/versions.d.ts +0 -23
  1632. package/src/schemas/vis-state-schema.js +0 -754
  1633. package/src/styles/base.js +0 -1620
  1634. package/src/styles/media-breakpoints.js +0 -47
  1635. package/src/typedefs/README.md +0 -3
  1636. package/src/typedefs/deck.gl__core.d.ts +0 -64
  1637. package/src/typedefs/deck.gl__mesh-layers.d.ts +0 -33
  1638. package/src/utils/aggregate-utils.js +0 -71
  1639. package/src/utils/color-utils.js +0 -115
  1640. package/src/utils/data-scale-utils.d.ts +0 -26
  1641. package/src/utils/data-scale-utils.js +0 -61
  1642. package/src/utils/data-utils.d.ts +0 -46
  1643. package/src/utils/data-utils.js +0 -447
  1644. package/src/utils/dataset-utils.d.ts +0 -10
  1645. package/src/utils/dataset-utils.js +0 -255
  1646. package/src/utils/dom-to-image.js +0 -533
  1647. package/src/utils/dom-utils.js +0 -354
  1648. package/src/utils/export-utils.js +0 -247
  1649. package/src/utils/filter-utils.d.ts +0 -192
  1650. package/src/utils/filter-utils.js +0 -1114
  1651. package/src/utils/gpu-filter-utils.d.ts +0 -28
  1652. package/src/utils/gpu-filter-utils.js +0 -253
  1653. package/src/utils/index.d.ts +0 -5
  1654. package/src/utils/index.js +0 -55
  1655. package/src/utils/interaction-utils.d.ts +0 -36
  1656. package/src/utils/interaction-utils.js +0 -185
  1657. package/src/utils/layer-utils.d.ts +0 -78
  1658. package/src/utils/layer-utils.js +0 -206
  1659. package/src/utils/map-style-utils/mapbox-gl-style-editor.js +0 -201
  1660. package/src/utils/notifications-utils.js +0 -83
  1661. package/src/utils/observe-dimensions.d.ts +0 -18
  1662. package/src/utils/observe-dimensions.js +0 -115
  1663. package/src/utils/split-map-utils.js +0 -104
  1664. package/src/utils/table-utils/data-container-interface.d.ts +0 -140
  1665. package/src/utils/table-utils/data-container-utils.d.ts +0 -43
  1666. package/src/utils/table-utils/data-container-utils.js +0 -61
  1667. package/src/utils/table-utils/data-row.d.ts +0 -65
  1668. package/src/utils/table-utils/data-row.js +0 -54
  1669. package/src/utils/table-utils/index.d.ts +0 -1
  1670. package/src/utils/table-utils/indexed-data-container.d.ts +0 -26
  1671. package/src/utils/table-utils/indexed-data-container.js +0 -152
  1672. package/src/utils/table-utils/kepler-table.d.ts +0 -114
  1673. package/src/utils/table-utils/kepler-table.js +0 -508
  1674. package/src/utils/table-utils/row-data-container.d.ts +0 -30
  1675. package/src/utils/table-utils/row-data-container.js +0 -151
  1676. package/src/utils/utils.js +0 -202
  1677. package/styles.js +0 -21
  1678. /package/src/actions/{index.js → index.ts} +0 -0
  1679. /package/src/components/common/data-table/{canvas.js → canvas.tsx} +0 -0
  1680. /package/src/components/editor/{constants.js → constants.ts} +0 -0
  1681. /package/src/components/filters/{components.js → components.ts} +0 -0
  1682. /package/src/components/filters/{index.js → index.ts} +0 -0
  1683. /package/src/components/map/{map-control-toolbar.js → map-control-toolbar.tsx} +0 -0
  1684. /package/src/components/modals/export-map-modal/{components.js → components.tsx} +0 -0
  1685. /package/src/components/modals/{modal-dialog.js → modal-dialog.tsx} +0 -0
  1686. /package/src/components/side-panel/{cloud-storage-dropdown.js → cloud-storage-dropdown.tsx} +0 -0
  1687. /package/src/components/side-panel/{custom-panel.js → custom-panel.tsx} +0 -0
  1688. /package/src/components/side-panel/layer-panel/{layer-aggregation-resolution.js → layer-aggregation-resolution.tsx} +0 -0
  1689. /package/src/constants/{color-palette.js → color-palette.ts} +0 -0
  1690. /package/src/constants/{custom-color-ranges.js → custom-color-ranges.ts} +0 -0
  1691. /package/src/constants/{keyevent.js → keyevent.ts} +0 -0
  1692. /package/src/constants/{tooltip.js → tooltip.ts} +0 -0
  1693. /package/src/constants/{user-feedbacks.js → user-feedbacks.ts} +0 -0
  1694. /package/src/constants/{user-guides.js → user-guides.ts} +0 -0
  1695. /package/src/layers/cluster-layer/{cluster-layer-icon.js → cluster-layer-icon.tsx} +0 -0
  1696. /package/src/layers/{default-layer-icon.js → default-layer-icon.tsx} +0 -0
  1697. /package/src/layers/h3-hexagon-layer/{h3-hexagon-layer-icon.js → h3-hexagon-layer-icon.tsx} +0 -0
  1698. /package/src/layers/heatmap-layer/{heatmap-layer-icon.js → heatmap-layer-icon.tsx} +0 -0
  1699. /package/src/layers/hexagon-layer/{hexagon-layer-icon.js → hexagon-layer-icon.tsx} +0 -0
  1700. /package/src/layers/icon-layer/{icon-layer-icon.js → icon-layer-icon.tsx} +0 -0
  1701. /package/src/layers/line-layer/{line-layer-icon.js → line-layer-icon.tsx} +0 -0
  1702. /package/src/layers/point-layer/{point-layer-icon.js → point-layer-icon.tsx} +0 -0
  1703. /package/src/layers/s2-geometry-layer/{s2-layer-icon.js → s2-layer-icon.tsx} +0 -0
  1704. /package/src/layers/scenegraph-layer/{scenegraph-info-modal.js → scenegraph-info-modal.tsx} +0 -0
  1705. /package/src/layers/scenegraph-layer/{scenegraph-layer-icon.js → scenegraph-layer-icon.tsx} +0 -0
  1706. /package/src/layers/trip-layer/{trip-info-modal.js → trip-info-modal.tsx} +0 -0
  1707. /package/src/layers/trip-layer/{trip-layer-icon.js → trip-layer-icon.tsx} +0 -0
  1708. /package/src/layers/{types.js → types.ts} +0 -0
  1709. /package/src/reducers/{composers.js → composers.ts} +0 -0
  1710. /package/src/schemas/{map-state-schema.js → map-state-schema.ts} +0 -0
  1711. /package/src/schemas/{map-style-schema.js → map-style-schema.ts} +0 -0
  1712. /package/src/schemas/{schema-utils.js → schema-utils.ts} +0 -0
  1713. /package/src/schemas/{versions.js → versions.ts} +0 -0
  1714. /package/src/styles/{index.js → index.ts} +0 -0
  1715. /package/src/tasks/{tasks.js → tasks.ts} +0 -0
  1716. /package/src/templates/{export-map-html.js → export-map-html.ts} +0 -0
  1717. /package/src/utils/{gl-utils.js → gl-utils.ts} +0 -0
  1718. /package/src/utils/{locale-utils.js → locale-utils.ts} +0 -0
  1719. /package/src/utils/{map-info-utils.js → map-info-utils.ts} +0 -0
  1720. /package/src/utils/map-style-utils/{mapbox-utils.js → mapbox-utils.ts} +0 -0
  1721. /package/src/utils/{mapbox-utils.js → mapbox-utils.ts} +0 -0
  1722. /package/src/utils/{projection-utils.js → projection-utils.ts} +0 -0
  1723. /package/src/utils/{searcher-utils.js → searcher-utils.ts} +0 -0
  1724. /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';
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
+ }