@kepler.gl/actions 3.3.0-alpha.2 → 3.3.0-alpha.20

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 (37) hide show
  1. package/dist/action-types.d.ts +101 -1
  2. package/dist/action-wrapper.d.ts +22 -17
  3. package/dist/actions.d.ts +13 -0
  4. package/dist/cjs/action-types.js +265 -0
  5. package/dist/cjs/action-wrapper.js +177 -0
  6. package/dist/cjs/actions.js +193 -0
  7. package/dist/cjs/identity-actions.js +86 -0
  8. package/dist/cjs/index.js +182 -0
  9. package/dist/cjs/map-state-actions.js +174 -0
  10. package/dist/cjs/map-style-actions.js +211 -0
  11. package/dist/cjs/provider-actions.js +99 -0
  12. package/dist/cjs/ui-state-actions.js +460 -0
  13. package/dist/cjs/vis-state-actions.js +1859 -0
  14. package/dist/esm/action-types.js +259 -0
  15. package/dist/esm/action-wrapper.js +171 -0
  16. package/dist/esm/actions.js +186 -0
  17. package/dist/esm/identity-actions.js +79 -0
  18. package/dist/esm/index.js +27 -0
  19. package/dist/esm/map-state-actions.js +167 -0
  20. package/dist/esm/map-style-actions.js +204 -0
  21. package/dist/esm/provider-actions.js +93 -0
  22. package/dist/esm/ui-state-actions.js +454 -0
  23. package/dist/esm/vis-state-actions.js +1728 -0
  24. package/dist/map-state-actions.d.ts +51 -3
  25. package/dist/ui-state-actions.d.ts +74 -1
  26. package/dist/vis-state-actions.d.ts +573 -21
  27. package/package.json +24 -21
  28. package/dist/action-types.js +0 -213
  29. package/dist/action-wrapper.js +0 -174
  30. package/dist/actions.js +0 -187
  31. package/dist/identity-actions.js +0 -86
  32. package/dist/index.js +0 -183
  33. package/dist/map-state-actions.js +0 -129
  34. package/dist/map-style-actions.js +0 -211
  35. package/dist/provider-actions.js +0 -99
  36. package/dist/ui-state-actions.js +0 -388
  37. package/dist/vis-state-actions.js +0 -1299
@@ -1,8 +1,8 @@
1
1
  import { default as ActionTypes } from './action-types';
2
- import { FileCacheItem } from '@kepler.gl/processors';
2
+ import { FileCacheItem, ZipArchiveExpansion } from '@kepler.gl/processors';
3
3
  import { Layer, LayerBaseConfig } from '@kepler.gl/layers';
4
- import { KeplerTable } from '@kepler.gl/table';
5
- import { AddDataToMapPayload, ValueOf, Merge, PickInfo, RGBColor, NestedPartial, LayerVisConfig, ColorUI, Feature, FeatureSelectionContext, InteractionConfig, Filter, ParsedConfig, ParsedLayer, EffectPropsPartial, AnnotationPropsPartial, SyncTimelineMode, AnimationConfig, FilterAnimationConfig, LayerOrder, LayerOrderGroup } from '@kepler.gl/types';
4
+ import { GroupByOp, JoinOp, KeplerTable, SuitabilityOp } from '@kepler.gl/table';
5
+ import { AddDataToMapOptions, AddDataToMapPayload, ViewportPadding, ValueOf, Merge, PickInfo, RGBColor, NestedPartial, LayerVisConfig, ColorUI, Feature, FeatureSelectionContext, InteractionConfig, Filter, ParsedConfig, ParsedLayer, EffectPropsPartial, AnnotationPropsPartial, SyncTimelineMode, AnimationConfig, FilterAnimationConfig, LayerOrder, LayerOrderGroup, ProtoDataset, ChartConfig, CameraBookmark, CameraTour } from '@kepler.gl/types';
6
6
  export type ApplyLayerConfigUpdaterAction = {
7
7
  oldLayerId: string;
8
8
  newLayerConfig: ParsedLayer;
@@ -86,15 +86,23 @@ export declare function layerSetIsValid(oldLayer: Layer, isValid: boolean): Merg
86
86
  export type LayerTypeChangeUpdaterAction = {
87
87
  oldLayer: Layer;
88
88
  newType: string;
89
+ /**
90
+ * Fit the map when this is the layer type dropdown assigning a type to an
91
+ * empty layer. Omitted for programmatic calls and saved-config applies.
92
+ */
93
+ fitBounds?: boolean;
89
94
  };
90
95
  /**
91
96
  * Update layer type. Previews layer config will be copied if applicable.
92
97
  * @param oldLayer - layer to be updated
93
98
  * @param newType - new type
99
+ * @param options.fitBounds fit the map when the layer type dropdown gives an empty layer its first type
94
100
  * @returns action
95
101
  * @public
96
102
  */
97
- export declare function layerTypeChange(oldLayer: Layer, newType: string): Merge<LayerTypeChangeUpdaterAction, {
103
+ export declare function layerTypeChange(oldLayer: Layer, newType: string, options?: {
104
+ fitBounds?: boolean;
105
+ }): Merge<LayerTypeChangeUpdaterAction, {
98
106
  type: typeof ActionTypes.LAYER_TYPE_CHANGE;
99
107
  }>;
100
108
  export type LayerVisualChannelConfigChangeUpdaterAction = {
@@ -454,6 +462,51 @@ export type UpdateEffectUpdaterAction = {
454
462
  export declare function updateEffect(id: string, props: EffectPropsPartial): Merge<UpdateEffectUpdaterAction, {
455
463
  type: typeof ActionTypes.UPDATE_EFFECT;
456
464
  }>;
465
+ export type AddChartUpdaterAction = {
466
+ chart: ChartConfig;
467
+ };
468
+ /**
469
+ * Add a chart to the charts panel
470
+ * @memberof visStateActions
471
+ * @param chart - chart config
472
+ * @returns action
473
+ * @public
474
+ */
475
+ export declare function addChart(chart: ChartConfig): Merge<AddChartUpdaterAction, {
476
+ type: typeof ActionTypes.ADD_CHART;
477
+ }>;
478
+ export type UpdateChartUpdaterAction = {
479
+ id: string;
480
+ props: Partial<ChartConfig>;
481
+ };
482
+ /**
483
+ * Update a chart
484
+ * @memberof visStateActions
485
+ * @param id - chart id
486
+ * @param props - partial chart config
487
+ * @returns action
488
+ * @public
489
+ */
490
+ export declare function updateChart(id: string, props: Partial<ChartConfig>): Merge<UpdateChartUpdaterAction, {
491
+ type: typeof ActionTypes.UPDATE_CHART;
492
+ }>;
493
+ export type RemoveChartUpdaterAction = {
494
+ id: string;
495
+ };
496
+ /**
497
+ * Remove a chart
498
+ * @memberof visStateActions
499
+ * @param id - chart id
500
+ * @returns action
501
+ * @public
502
+ */
503
+ export declare function removeChart(id: string): Merge<RemoveChartUpdaterAction, {
504
+ type: typeof ActionTypes.REMOVE_CHART;
505
+ }>;
506
+ /** Replace the ordered collection of saved camera bookmarks. */
507
+ export declare const setCameraBookmarks: import("@reduxjs/toolkit").ActionCreatorWithPayload<CameraBookmark[], string>;
508
+ /** Replace the single authored camera tour; null removes it. */
509
+ export declare const setCameraTour: import("@reduxjs/toolkit").ActionCreatorWithPayload<CameraTour | null, string>;
457
510
  export type AddAnnotationUpdaterAction = {
458
511
  config?: AnnotationPropsPartial;
459
512
  };
@@ -564,6 +617,125 @@ export type UpdateDatasetColorUpdater = {
564
617
  export declare function updateTableColor(dataId: string, newColor: RGBColor): Merge<UpdateDatasetColorUpdater, {
565
618
  type: typeof ActionTypes.UPDATE_TABLE_COLOR;
566
619
  }>;
620
+ export type RefreshDatasetUpdaterAction = {
621
+ dataId: string;
622
+ };
623
+ /**
624
+ * Re-fetch an externally hosted dataset from its source URL.
625
+ * @memberof visStateActions
626
+ * @param dataId dataset id
627
+ * @returns action
628
+ * @public
629
+ */
630
+ export declare function refreshDataset(dataId: string): Merge<RefreshDatasetUpdaterAction, {
631
+ type: typeof ActionTypes.REFRESH_DATASET;
632
+ }>;
633
+ export type RefreshDatasetSuccessUpdaterAction = {
634
+ dataId: string;
635
+ result: {
636
+ data: ProtoDataset['data'] | null;
637
+ notModified: boolean;
638
+ etag?: string;
639
+ lastModified?: string;
640
+ size?: number;
641
+ };
642
+ };
643
+ /**
644
+ * Apply a successful remote dataset refresh.
645
+ * @memberof visStateActions
646
+ * @returns action
647
+ */
648
+ export declare function refreshDatasetSuccess(dataId: string, result: RefreshDatasetSuccessUpdaterAction['result']): Merge<RefreshDatasetSuccessUpdaterAction, {
649
+ type: typeof ActionTypes.REFRESH_DATASET_SUCCESS;
650
+ }>;
651
+ export type RefreshDatasetErrorUpdaterAction = {
652
+ dataId: string;
653
+ error: Error;
654
+ };
655
+ /**
656
+ * Record a failed remote dataset refresh.
657
+ * @memberof visStateActions
658
+ * @returns action
659
+ */
660
+ export declare function refreshDatasetError(dataId: string, error: Error): Merge<RefreshDatasetErrorUpdaterAction, {
661
+ type: typeof ActionTypes.REFRESH_DATASET_ERROR;
662
+ }>;
663
+ export type RefreshDatasetProgressUpdaterAction = {
664
+ dataId: string;
665
+ percent: number;
666
+ };
667
+ /**
668
+ * Update download progress for an in-flight remote dataset refresh (0–100).
669
+ * @memberof visStateActions
670
+ * @returns action
671
+ */
672
+ export declare function refreshDatasetProgress(dataId: string, percent: number): Merge<RefreshDatasetProgressUpdaterAction, {
673
+ type: typeof ActionTypes.REFRESH_DATASET_PROGRESS;
674
+ }>;
675
+ /**
676
+ * One dataset row: a column-ordered array (same as `ProtoDataset.data.rows`)
677
+ * or a field-name record. Missing keys become `null`.
678
+ */
679
+ export type DatasetRow = any[] | Record<string, unknown>;
680
+ export type AddToDatasetOptions = {
681
+ /**
682
+ * Field name used as a unique key. Matching rows are replaced in place;
683
+ * keys that are not in the table are appended. Last incoming row wins when
684
+ * the same key appears twice. DuckDB tables no-op with a warning. Nested, binary, and
685
+ * geoarrow Arrow columns also no-op (primitive Arrow columns concat in place).
686
+ */
687
+ upsertBy?: string;
688
+ };
689
+ export type AddToDatasetUpdaterAction = {
690
+ dataId: string;
691
+ rows: DatasetRow | DatasetRow[];
692
+ options?: AddToDatasetOptions;
693
+ };
694
+ /**
695
+ * Append rows to an existing in-memory row or Arrow dataset without `addDataToMap`.
696
+ * Keeps layer identity and style. Pass `options.upsertBy` to replace rows that
697
+ * share that key and append the rest.
698
+ *
699
+ * DuckDB tables (no INSERT yet) warn and leave the table unchanged. Arrow
700
+ * tables concat primitive columns in place; nested, binary, and geoarrow
701
+ * columns are rejected. Use `addDataToMap` with `keepExistingConfig` for a
702
+ * full replace.
703
+ * @memberof visStateActions
704
+ * @param dataId dataset id
705
+ * @param rows one row or an array of rows (arrays in field order, or objects keyed by field name)
706
+ * @param options optional `{upsertBy}` field name
707
+ * @returns action
708
+ * @public
709
+ */
710
+ export declare function addToDataset(dataId: string, rows: DatasetRow | DatasetRow[], options?: AddToDatasetOptions): Merge<AddToDatasetUpdaterAction, {
711
+ type: typeof ActionTypes.ADD_TO_DATASET;
712
+ }>;
713
+ export type RemoveFromDatasetByField = {
714
+ field: string;
715
+ values: unknown | unknown[];
716
+ };
717
+ export type RemoveFromDatasetUpdaterAction = {
718
+ dataId: string;
719
+ rowIndexes?: number | number[];
720
+ byField?: RemoveFromDatasetByField;
721
+ };
722
+ /**
723
+ * Delete rows from an existing in-memory row or Arrow dataset without restyling layers.
724
+ * The second argument is either row indexes or `{field, values}` to match a
725
+ * column (e.g. an id). Out-of-range indexes are a no-op for the whole action.
726
+ *
727
+ * DuckDB tables warn and leave the table unchanged. Arrow tables concat the
728
+ * kept slices in place. For a full table replace use `addDataToMap` with
729
+ * `keepExistingConfig`.
730
+ * @memberof visStateActions
731
+ * @param dataId dataset id
732
+ * @param rowIndexesOrMatcher one index, an array of indexes, or `{field, values}`
733
+ * @returns action
734
+ * @public
735
+ */
736
+ export declare function removeFromDataset(dataId: string, rowIndexesOrMatcher: number | number[] | RemoveFromDatasetByField): Merge<RemoveFromDatasetUpdaterAction, {
737
+ type: typeof ActionTypes.REMOVE_FROM_DATASET;
738
+ }>;
567
739
  export type SortTableColumnUpdaterAction = {
568
740
  dataId: string;
569
741
  column: string;
@@ -595,6 +767,32 @@ export type PinTableColumnUpdaterAction = {
595
767
  export declare function pinTableColumn(dataId: string, column: string): Merge<PinTableColumnUpdaterAction, {
596
768
  type: typeof ActionTypes.PIN_TABLE_COLUMN;
597
769
  }>;
770
+ export type ToggleTableColumnHiddenUpdaterAction = {
771
+ dataId: string;
772
+ column: string;
773
+ };
774
+ /**
775
+ * Hide or show a dataset column in the attribute table and in data export.
776
+ * @param dataId
777
+ * @param column
778
+ * @returns action
779
+ * @public
780
+ */
781
+ export declare function toggleTableColumnHidden(dataId: string, column: string): Merge<ToggleTableColumnHiddenUpdaterAction, {
782
+ type: typeof ActionTypes.TOGGLE_TABLE_COLUMN_HIDDEN;
783
+ }>;
784
+ export type ShowAllTableColumnsUpdaterAction = {
785
+ dataId: string;
786
+ };
787
+ /**
788
+ * Show every attribute-table column that was hidden.
789
+ * @param dataId
790
+ * @returns action
791
+ * @public
792
+ */
793
+ export declare function showAllTableColumns(dataId: string): Merge<ShowAllTableColumnsUpdaterAction, {
794
+ type: typeof ActionTypes.SHOW_ALL_TABLE_COLUMNS;
795
+ }>;
598
796
  export type CopyTableColumnUpdaterAction = {
599
797
  dataId: string;
600
798
  column: string;
@@ -625,8 +823,56 @@ export type SetColumnDisplayFormatUpdaterAction = {
625
823
  export declare function setColumnDisplayFormat(dataId: SetColumnDisplayFormatUpdaterAction['dataId'], formats: SetColumnDisplayFormatUpdaterAction['formats']): Merge<SetColumnDisplayFormatUpdaterAction, {
626
824
  type: typeof ActionTypes.SET_COLUMN_DISPLAY_FORMAT;
627
825
  }>;
826
+ export type LoadColumnStatsUpdaterAction = {
827
+ dataId: string;
828
+ fieldName: string | string[];
829
+ };
830
+ /**
831
+ * Lazily compute column statistics for the data table header.
832
+ * @param dataId
833
+ * @param fieldName one or more field names
834
+ * @returns action
835
+ * @public
836
+ */
837
+ export declare function loadColumnStats(dataId: string, fieldName: string | string[]): Merge<LoadColumnStatsUpdaterAction, {
838
+ type: typeof ActionTypes.LOAD_COLUMN_STATS;
839
+ }>;
840
+ export type LoadColumnStatsSuccessUpdaterAction = {
841
+ dataId: string;
842
+ fieldName: string;
843
+ result: any;
844
+ filterProps?: any;
845
+ fieldType?: string;
846
+ };
847
+ /**
848
+ * Column statistics finished loading
849
+ * @returns action
850
+ * @public
851
+ */
852
+ export declare function loadColumnStatsSuccess(dataId: string, fieldName: string, result: any, filterProps?: any, request?: {
853
+ fieldType: string;
854
+ }): Merge<LoadColumnStatsSuccessUpdaterAction, {
855
+ type: typeof ActionTypes.LOAD_COLUMN_STATS_SUCCESS;
856
+ }>;
857
+ export type LoadColumnStatsErrorUpdaterAction = {
858
+ dataId: string;
859
+ fieldName: string;
860
+ error: Error;
861
+ fieldType?: string;
862
+ };
863
+ /**
864
+ * Column statistics failed to load
865
+ * @returns action
866
+ * @public
867
+ */
868
+ export declare function loadColumnStatsError(dataId: string, fieldName: string, error: Error, request?: {
869
+ fieldType: string;
870
+ }): Merge<LoadColumnStatsErrorUpdaterAction, {
871
+ type: typeof ActionTypes.LOAD_COLUMN_STATS_ERROR;
872
+ }>;
628
873
  export type AddDataToMapUpdaterOptions = {
629
874
  centerMap?: boolean;
875
+ padding?: ViewportPadding;
630
876
  readOnly?: boolean;
631
877
  keepExistingConfig?: boolean;
632
878
  };
@@ -643,6 +889,8 @@ export type UpdateVisDataUpdaterAction = {
643
889
  * @param {object} options
644
890
  * @param options.centerMap `default: true` if `centerMap` is set to `true` kepler.gl will
645
891
  * place the map view within the data points boundaries
892
+ * @param options.padding padding in pixels applied when `centerMap` is true so data is not hidden
893
+ * under the side panel or other UI. Can be a number or `{top, bottom, left, right}`.
646
894
  * @param options.readOnly `default: false` if `readOnly` is set to `true`
647
895
  * the left setting panel will be hidden
648
896
  * @param config this object will contain the full kepler.gl instance configuration {mapState, mapStyle, visState}
@@ -688,6 +936,78 @@ export declare function updateDatasetProps(dataId: string, props: {
688
936
  }): Merge<UpdateDatasetPropsUpdaterAction, {
689
937
  type: typeof ActionTypes.UPDATE_DATASET_PROPS;
690
938
  }>;
939
+ export type UpdateDatasetUpdaterAction = {
940
+ dataId: string;
941
+ /** New column data + field descriptors, e.g. `{cols, fields, arrowTable}` (same shape `KeplerTable.importData` accepts). */
942
+ data: ProtoDataset['data'];
943
+ /**
944
+ * Optional old → new column-name map, used to carry layers/filters/tooltips
945
+ * across a rename (name-based reconciliation alone would treat a renamed
946
+ * column as removed).
947
+ */
948
+ renames?: Record<string, string>;
949
+ };
950
+ /**
951
+ * Update an existing dataset's schema (columns + fields) in place.
952
+ * Unlike `addDataToMap`, this keeps the dataset `id`/`label`/`color`/`metadata`
953
+ * and reconciles layers, filters and tooltip config that referenced the old
954
+ * columns. Used by the AI assistant's `map.add-column` command.
955
+ * @param dataId - ***required** Id of the dataset to update
956
+ * @param data - ***required** New column data + field descriptors
957
+ * @param renames - (Optional) old column name → new column name, so layers/filters follow a rename
958
+ * @returns action
959
+ */
960
+ export declare function updateDataset(dataId: string, data: ProtoDataset['data'], renames?: Record<string, string>): Merge<UpdateDatasetUpdaterAction, {
961
+ type: typeof ActionTypes.UPDATE_DATASET;
962
+ }>;
963
+ export type RenameTableColumnUpdaterAction = {
964
+ dataId: string;
965
+ fieldName: string;
966
+ newName: string;
967
+ };
968
+ /**
969
+ * Rename a dataset column. The new name becomes the field identity stored in
970
+ * layers, filters, charts, dataset operations, and saved maps.
971
+ * @param dataId - dataset id
972
+ * @param fieldName - current column name
973
+ * @param newName - next column name
974
+ * @returns action
975
+ * @public
976
+ */
977
+ export declare function renameTableColumn(dataId: string, fieldName: string, newName: string): Merge<RenameTableColumnUpdaterAction, {
978
+ type: typeof ActionTypes.RENAME_TABLE_COLUMN;
979
+ }>;
980
+ export type ChangeTableColumnTypeUpdaterAction = {
981
+ dataId: string;
982
+ fieldName: string;
983
+ newType: string;
984
+ };
985
+ /**
986
+ * Convert every value in a dataset column and update its field type atomically.
987
+ * Invalid values leave the dataset unchanged and produce an error notification.
988
+ * @param dataId - dataset id
989
+ * @param fieldName - column name
990
+ * @param newType - target kepler.gl field type
991
+ * @returns action
992
+ * @public
993
+ */
994
+ export declare function changeTableColumnType(dataId: string, fieldName: string, newType: string): Merge<ChangeTableColumnTypeUpdaterAction, {
995
+ type: typeof ActionTypes.CHANGE_TABLE_COLUMN_TYPE;
996
+ }>;
997
+ export type DeleteTableColumnUpdaterAction = {
998
+ dataId: string;
999
+ fieldName: string;
1000
+ };
1001
+ /**
1002
+ * Delete a dataset column and drop references that required it.
1003
+ * @param dataId - dataset id
1004
+ * @param fieldName - column name
1005
+ * @returns action
1006
+ * @public
1007
+ */
1008
+ export declare function deleteTableColumn(dataId: string, fieldName: string): Merge<DeleteTableColumnUpdaterAction, {
1009
+ type: typeof ActionTypes.DELETE_TABLE_COLUMN;
1010
+ }>;
691
1011
  export type ToggleFilterAnimationUpdaterAction = {
692
1012
  idx: number;
693
1013
  };
@@ -872,7 +1192,8 @@ export declare function toggleLayerForMap(mapIndex: number, layerId: string): Me
872
1192
  type FilterPlotNewProp = {
873
1193
  yAxis?: null | Record<string, any>;
874
1194
  plotType?: {
875
- type: string;
1195
+ type?: string;
1196
+ [key: string]: any;
876
1197
  };
877
1198
  };
878
1199
  export type SetFilterPlotUpdaterAction = {
@@ -905,18 +1226,26 @@ export type SetMapInfoUpdaterAction = {
905
1226
  export declare function setMapInfo(info: any): Merge<SetMapInfoUpdaterAction, {
906
1227
  type: typeof ActionTypes.SET_MAP_INFO;
907
1228
  }>;
1229
+ export type LoadFilesOptions = AddDataToMapOptions & {
1230
+ /** Parse the files, then wait for an explicit add instead of calling `addDataToMap`. */
1231
+ deferAddToMap?: boolean;
1232
+ };
908
1233
  export type LoadFilesUpdaterAction = {
909
1234
  files: File[];
910
- onFinish?(result: any): any;
1235
+ onFinish?(result: any, options?: LoadFilesOptions): any;
1236
+ /** Forwarded to `addDataToMap` when loading finishes. Omitted options keep their defaults. */
1237
+ options?: LoadFilesOptions;
911
1238
  };
912
1239
  /**
913
1240
  * Trigger file loading dispatch `addDataToMap` if succeed, or `loadFilesErr` if failed
914
1241
  * @memberof visStateActions
915
1242
  * @param files array of fileblob
1243
+ * @param onFinish called with the processed file cache. Defaults to `loadFilesSuccess`
1244
+ * @param options forwarded to `addDataToMap`. `autoCreateLayers` defaults to true when omitted
916
1245
  * @returns action
917
1246
  * @public
918
1247
  */
919
- export declare function loadFiles(files: File[], onFinish?: (result: any) => any): Merge<LoadFilesUpdaterAction, {
1248
+ export declare function loadFiles(files: File[], onFinish?: (result: any, options?: LoadFilesOptions) => any, options?: LoadFilesOptions): Merge<LoadFilesUpdaterAction, {
920
1249
  type: typeof ActionTypes.LOAD_FILES;
921
1250
  }>;
922
1251
  /**
@@ -925,21 +1254,94 @@ export declare function loadFiles(files: File[], onFinish?: (result: any) => any
925
1254
  * @returns action
926
1255
  * @public
927
1256
  */
928
- export declare function loadNextFile(): {
1257
+ export declare function loadNextFile(loadId?: number): {
929
1258
  type: typeof ActionTypes.LOAD_NEXT_FILE;
1259
+ loadId?: number;
930
1260
  };
1261
+ export type ExpandZipArchiveSuccessAction = {
1262
+ loadId: number;
1263
+ archiveName: string;
1264
+ expansion: ZipArchiveExpansion;
1265
+ };
1266
+ /**
1267
+ * A zip in the load queue has been unpacked. The updater either parses a
1268
+ * single shapefile archive or enqueues one dataset per supported member.
1269
+ * @memberof visStateActions
1270
+ */
1271
+ export declare function expandZipArchiveSuccess(payload: ExpandZipArchiveSuccessAction): Merge<ExpandZipArchiveSuccessAction, {
1272
+ type: typeof ActionTypes.EXPAND_ZIP_ARCHIVE_SUCCESS;
1273
+ }>;
931
1274
  export type loadFilesSuccessUpdaterAction = {
932
1275
  result: FileCacheItem[];
1276
+ options?: AddDataToMapOptions;
1277
+ /** Set when a file-load pause finishes, so a canceled load can be ignored. */
1278
+ loadId?: number;
933
1279
  };
934
1280
  /**
935
1281
  * called when all files are processed and loaded
936
1282
  * @memberof visStateActions
937
1283
  * @param result
1284
+ * @param options forwarded to `addDataToMap`
938
1285
  * @returns action
939
1286
  */
940
- export declare function loadFilesSuccess(result: FileCacheItem[]): Merge<loadFilesSuccessUpdaterAction, {
1287
+ export declare function loadFilesSuccess(result: FileCacheItem[], options?: AddDataToMapOptions): Merge<loadFilesSuccessUpdaterAction, {
941
1288
  type: typeof ActionTypes.LOAD_FILES_SUCCESS;
942
1289
  }>;
1290
+ export type ConfirmReplaceDatasetUpdaterAction = {
1291
+ result: FileCacheItem[];
1292
+ datasetToReplaceId: string;
1293
+ deleteOriginalDataset?: boolean;
1294
+ };
1295
+ /**
1296
+ * Confirm a staged upload as a replacement for one dataset.
1297
+ * The first dataset remaps that dataset's layers and filters. Further datasets are added.
1298
+ * @memberof visStateActions
1299
+ * @param payload.result staged file cache the user left checked
1300
+ * @param payload.datasetToReplaceId dataset the menu action selected
1301
+ * @param payload.deleteOriginalDataset drop the original table. Defaults to true
1302
+ * @public
1303
+ */
1304
+ export declare function confirmReplaceDataset(payload: {
1305
+ result: FileCacheItem[];
1306
+ datasetToReplaceId: string;
1307
+ deleteOriginalDataset?: boolean;
1308
+ }): Merge<ConfirmReplaceDatasetUpdaterAction, {
1309
+ type: typeof ActionTypes.CONFIRM_REPLACE_DATASET;
1310
+ }>;
1311
+ export type StageLoadedFilesUpdaterAction = {
1312
+ result: FileCacheItem[];
1313
+ /** Set when a file-load pause finishes, so a canceled load can be ignored. */
1314
+ loadId?: number;
1315
+ };
1316
+ /**
1317
+ * Store processed files without adding them to the map or closing the modal.
1318
+ * @memberof visStateActions
1319
+ * @param result processed file cache
1320
+ * @returns action
1321
+ * @public
1322
+ */
1323
+ export declare function stageLoadedFiles(result: FileCacheItem[]): Merge<StageLoadedFilesUpdaterAction, {
1324
+ type: typeof ActionTypes.STAGE_LOADED_FILES;
1325
+ }>;
1326
+ /**
1327
+ * Add already-parsed or remote datasets to the Add Data list without starting a file load.
1328
+ * @memberof visStateActions
1329
+ * @param result datasets to keep until Add Data
1330
+ * @returns action
1331
+ * @public
1332
+ */
1333
+ export declare function appendStagedLoadedFiles(result: FileCacheItem[]): Merge<StageLoadedFilesUpdaterAction, {
1334
+ type: typeof ActionTypes.APPEND_STAGED_LOADED_FILES;
1335
+ }>;
1336
+ /**
1337
+ * Drop files staged for the Add Data button and stop an in-progress modal load.
1338
+ * @memberof visStateActions
1339
+ * @returns action
1340
+ * @public
1341
+ */
1342
+ export declare function clearStagedLoadedFiles(): {
1343
+ type: typeof ActionTypes.CLEAR_STAGED_LOADED_FILES;
1344
+ };
943
1345
  export type LoadFileStepSuccessAction = {
944
1346
  fileName: string;
945
1347
  fileCache: FileCacheItem[];
@@ -959,6 +1361,8 @@ export declare function loadFileStepSuccess({ fileName, fileCache }: {
959
1361
  export type LoadFilesErrUpdaterAction = {
960
1362
  fileName: string;
961
1363
  error: any;
1364
+ /** Set when the failure belongs to one load, so a newer load can ignore it. */
1365
+ loadId?: number;
962
1366
  };
963
1367
  /**
964
1368
  * Trigger loading file error
@@ -967,12 +1371,27 @@ export type LoadFilesErrUpdaterAction = {
967
1371
  * @returns action
968
1372
  * @public
969
1373
  */
970
- export declare function loadFilesErr(fileName: string, error: any): Merge<LoadFilesErrUpdaterAction, {
1374
+ export declare function loadFilesErr(fileName: string, error: any, loadId?: number): Merge<LoadFilesErrUpdaterAction, {
971
1375
  type: typeof ActionTypes.LOAD_FILES_ERR;
972
1376
  }>;
973
1377
  export type SetFeaturesUpdaterAction = {
974
1378
  features: Feature[];
975
1379
  };
1380
+ export type SetEditorFeaturePropertiesUpdaterAction = {
1381
+ feature: Feature;
1382
+ properties: Record<string, unknown>;
1383
+ };
1384
+ /**
1385
+ * Set user-facing GeoJSON properties on a Draw on Map sketch.
1386
+ * Editor-only keys such as `filterId` and `isClosed` are preserved.
1387
+ * @memberof visStateActions
1388
+ * @param feature
1389
+ * @param properties
1390
+ * @returns action
1391
+ */
1392
+ export declare function setEditorFeatureProperties(feature: Feature, properties: Record<string, unknown>): Merge<SetEditorFeaturePropertiesUpdaterAction, {
1393
+ type: typeof ActionTypes.SET_EDITOR_FEATURE_PROPERTIES;
1394
+ }>;
976
1395
  /**
977
1396
  * Store features to state
978
1397
  * @memberof visStateActions
@@ -1039,16 +1458,16 @@ export declare function deleteFeature(feature: Feature): Merge<DeleteFeatureUpda
1039
1458
  export type SetEditorModeUpdaterAction = {
1040
1459
  mode: string;
1041
1460
  };
1042
- /** Set the map mode
1461
+ /** Set the Draw on Map editor mode.
1043
1462
  * @memberof visStateActions
1044
- * @param mode one of EDITOR_MODES
1463
+ * @param mode one of `EDITOR_MODES`: `EDIT`, `DRAW_POINT`, `DRAW_LINESTRING`, `DRAW_POLYGON`, `DRAW_RECTANGLE`, `DRAW_CIRCLE`
1045
1464
  * @returns action
1046
1465
  * @public
1047
1466
  * @example
1048
- * import {setMapMode} from '@kepler.gl/actions';
1467
+ * import {setEditorMode} from '@kepler.gl/actions';
1049
1468
  * import {EDITOR_MODES} from '@kepler.gl/constants';
1050
1469
  *
1051
- * this.props.dispatch(setMapMode(EDITOR_MODES.DRAW_POLYGON));
1470
+ * this.props.dispatch(setEditorMode(EDITOR_MODES.DRAW_LINESTRING));
1052
1471
  */
1053
1472
  export declare function setEditorMode(mode: string): Merge<SetEditorModeUpdaterAction, {
1054
1473
  type: typeof ActionTypes.SET_EDITOR_MODE;
@@ -1075,10 +1494,48 @@ export type ToggleEditorVisibilityUpdaterAction = void;
1075
1494
  export declare function toggleEditorVisibility(): Merge<ToggleEditorVisibilityUpdaterAction, {
1076
1495
  type: typeof ActionTypes.TOGGLE_EDITOR_VISIBILITY;
1077
1496
  }>;
1497
+ export type ConvertEditorFeaturesToLayerUpdaterAction = void;
1498
+ /**
1499
+ * Convert editor sketch features into a GeoJSON dataset and layer, then clear the sketches.
1500
+ * The new dataset/layer is labeled `Drawn Geometry` plus a two-digit number.
1501
+ * No-ops when `enableDrawOnMapSketches` is false in application config.
1502
+ * @memberof visStateActions
1503
+ * @return action
1504
+ * @public
1505
+ * @example
1506
+ * import {convertEditorFeaturesToLayer} from '@kepler.gl/actions';
1507
+ *
1508
+ * this.props.dispatch(convertEditorFeaturesToLayer());
1509
+ */
1510
+ export declare function convertEditorFeaturesToLayer(): Merge<ConvertEditorFeaturesToLayerUpdaterAction, {
1511
+ type: typeof ActionTypes.CONVERT_EDITOR_FEATURES_TO_LAYER;
1512
+ }>;
1513
+ export type ExtractDataFromFeatureUpdaterAction = {
1514
+ layerId: string;
1515
+ };
1516
+ /**
1517
+ * Copy in-memory rows that fall inside the currently selected Draw on Map polygon
1518
+ * into a new local dataset. Vector tile layers extract a snapshot of features
1519
+ * already loaded in the current view. Raster tile layers download a PNG clip and
1520
+ * a GeoJSON file with the export rectangle and zonal stats. No-ops for WMS/3D/bitmap tiles, unsupported layer types,
1521
+ * and non-polygon drawings.
1522
+ * @memberof visStateActions
1523
+ * @param layerId Layer whose dataset should be extracted
1524
+ * @return action
1525
+ * @public
1526
+ * @example
1527
+ * import {extractDataFromFeature} from '@kepler.gl/actions';
1528
+ *
1529
+ * this.props.dispatch(extractDataFromFeature({layerId: 'point-layer-id'}));
1530
+ */
1531
+ export declare function extractDataFromFeature({ layerId }: ExtractDataFromFeatureUpdaterAction): Merge<ExtractDataFromFeatureUpdaterAction, {
1532
+ type: typeof ActionTypes.EXTRACT_DATA_FROM_FEATURE;
1533
+ }>;
1078
1534
  type FileContent = {
1079
1535
  fileName: string;
1080
1536
  header: string[];
1081
1537
  data: any;
1538
+ prepareProgressiveReplay?: boolean;
1082
1539
  };
1083
1540
  export type NextFileBatchUpdaterAction = {
1084
1541
  payload: {
@@ -1087,6 +1544,8 @@ export type NextFileBatchUpdaterAction = {
1087
1544
  progress?: any;
1088
1545
  accumulated?: any;
1089
1546
  onFinish: (result: any) => any;
1547
+ /** Carried across batches so progressive loads keep the original add-data options. */
1548
+ options?: LoadFilesOptions;
1090
1549
  };
1091
1550
  };
1092
1551
  /**
@@ -1212,14 +1671,92 @@ export declare function setTimeFilterSyncTimelineMode({ id, mode }: setTimeFilte
1212
1671
  export type CreateNewDatasetSuccessPayload = {
1213
1672
  results: (PromiseFulfilledResult<KeplerTable> | PromiseRejectedResult)[];
1214
1673
  addToMapOptions: AddDataToMapPayload['options'];
1674
+ /** Dataset ids whose hydrate download progress should be cleared. */
1675
+ progressIds?: string[];
1215
1676
  };
1216
- /**
1217
- * Called when a new dataset is created successfully via async table methods
1218
- * @memberof visStateActions
1219
- * @param payload
1220
- * @param payload.results - results of promises.allSettlted
1221
- * @returns
1222
- */
1677
+ export type AddGroupByUpdaterAction = {
1678
+ dataId: string;
1679
+ };
1680
+ export declare function addGroupBy(dataId: string): Merge<AddGroupByUpdaterAction, {
1681
+ type: typeof ActionTypes.ADD_GROUP_BY;
1682
+ }>;
1683
+ export type SetGroupByConfigUpdaterAction = {
1684
+ id: string;
1685
+ config: Partial<GroupByOp>;
1686
+ };
1687
+ export declare function setGroupByConfig(id: string, config: Partial<GroupByOp>): Merge<SetGroupByConfigUpdaterAction, {
1688
+ type: typeof ActionTypes.SET_GROUP_BY_CONFIG;
1689
+ }>;
1690
+ export type RunGroupByUpdaterAction = {
1691
+ id: string;
1692
+ };
1693
+ export declare function runGroupBy(id: string): Merge<RunGroupByUpdaterAction, {
1694
+ type: typeof ActionTypes.RUN_GROUP_BY;
1695
+ }>;
1696
+ export type AddJoinUpdaterAction = {
1697
+ dataId: string;
1698
+ implementation?: JoinOp['implementation'];
1699
+ };
1700
+ export declare function addJoin(dataId: string, implementation?: JoinOp['implementation']): Merge<AddJoinUpdaterAction, {
1701
+ type: typeof ActionTypes.ADD_JOIN;
1702
+ }>;
1703
+ export type SetJoinConfigUpdaterAction = {
1704
+ id: string;
1705
+ config: Partial<JoinOp>;
1706
+ };
1707
+ export declare function setJoinConfig(id: string, config: Partial<JoinOp>): Merge<SetJoinConfigUpdaterAction, {
1708
+ type: typeof ActionTypes.SET_JOIN_CONFIG;
1709
+ }>;
1710
+ export type RunJoinUpdaterAction = {
1711
+ id: string;
1712
+ };
1713
+ export declare function runJoin(id: string): Merge<RunJoinUpdaterAction, {
1714
+ type: typeof ActionTypes.RUN_JOIN;
1715
+ }>;
1716
+ export type AddSpatialJoinUpdaterAction = {
1717
+ dataId: string;
1718
+ };
1719
+ export declare function addSpatialJoin(dataId: string): Merge<AddSpatialJoinUpdaterAction, {
1720
+ type: typeof ActionTypes.ADD_SPATIAL_JOIN;
1721
+ }>;
1722
+ export type SetSpatialJoinConfigUpdaterAction = {
1723
+ id: string;
1724
+ config: Partial<JoinOp>;
1725
+ };
1726
+ export declare function setSpatialJoinConfig(id: string, config: Partial<JoinOp>): Merge<SetSpatialJoinConfigUpdaterAction, {
1727
+ type: typeof ActionTypes.SET_SPATIAL_JOIN_CONFIG;
1728
+ }>;
1729
+ export type RunSpatialJoinUpdaterAction = {
1730
+ id: string;
1731
+ };
1732
+ export declare function runSpatialJoin(id: string): Merge<RunSpatialJoinUpdaterAction, {
1733
+ type: typeof ActionTypes.RUN_SPATIAL_JOIN;
1734
+ }>;
1735
+ export type AddSuitabilityUpdaterAction = {
1736
+ dataId: string;
1737
+ };
1738
+ export declare function addSuitability(dataId: string): Merge<AddSuitabilityUpdaterAction, {
1739
+ type: typeof ActionTypes.ADD_SUITABILITY;
1740
+ }>;
1741
+ export type SetSuitabilityConfigUpdaterAction = {
1742
+ id: string;
1743
+ config: Partial<SuitabilityOp>;
1744
+ };
1745
+ export declare function setSuitabilityConfig(id: string, config: Partial<SuitabilityOp>): Merge<SetSuitabilityConfigUpdaterAction, {
1746
+ type: typeof ActionTypes.SET_SUITABILITY_CONFIG;
1747
+ }>;
1748
+ export type RunSuitabilityUpdaterAction = {
1749
+ id: string;
1750
+ };
1751
+ export declare function runSuitability(id: string): Merge<RunSuitabilityUpdaterAction, {
1752
+ type: typeof ActionTypes.RUN_SUITABILITY;
1753
+ }>;
1754
+ export type RemoveDatasetOpUpdaterAction = {
1755
+ id: string;
1756
+ };
1757
+ export declare function removeDatasetOp(id: string): Merge<RemoveDatasetOpUpdaterAction, {
1758
+ type: typeof ActionTypes.REMOVE_DATASET_OP;
1759
+ }>;
1223
1760
  export declare const createNewDatasetSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<CreateNewDatasetSuccessPayload, string>;
1224
1761
  export type SetLoadingIndicatorPayload = {
1225
1762
  change: number;
@@ -1232,4 +1769,19 @@ export type SetLoadingIndicatorPayload = {
1232
1769
  * @public
1233
1770
  */
1234
1771
  export declare const setLoadingIndicator: import("@reduxjs/toolkit").ActionCreatorWithPayload<SetLoadingIndicatorPayload, string>;
1772
+ export type SetLoadingProgressUpdaterAction = {
1773
+ id: string;
1774
+ percent: number;
1775
+ /** Download is finished and the file is being parsed into a dataset. */
1776
+ phase?: 'processing';
1777
+ };
1778
+ /**
1779
+ * Update download progress for an in-flight dataset load shown on the map
1780
+ * loading indicator (0–100).
1781
+ * @memberof visStateActions
1782
+ * @returns action
1783
+ */
1784
+ export declare function setLoadingProgress(id: string, percent: number, phase?: 'processing'): Merge<SetLoadingProgressUpdaterAction, {
1785
+ type: typeof ActionTypes.SET_LOADING_PROGRESS;
1786
+ }>;
1235
1787
  export {};