@kepler.gl/actions 3.1.0-alpha.1 → 3.1.0-alpha.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,1024 @@
1
+ /// <reference types="deck.gl" />
2
+ import { PickInfo } from '@deck.gl/core/lib/deck';
3
+ import { default as ActionTypes } from './action-types';
4
+ import { FileCacheItem } from '@kepler.gl/processors';
5
+ import { Layer, LayerBaseConfig } from '@kepler.gl/layers';
6
+ import { KeplerTable } from '@kepler.gl/table';
7
+ import { AddDataToMapPayload, ValueOf, Merge, RGBColor, NestedPartial, LayerVisConfig, ColorUI, Feature, FeatureSelectionContext, InteractionConfig, Filter, ParsedConfig, ParsedLayer, EffectPropsPartial, SyncTimelineMode } from '@kepler.gl/types';
8
+ export declare type ApplyLayerConfigUpdaterAction = {
9
+ oldLayerId: string;
10
+ newLayerConfig: ParsedLayer;
11
+ layerIndex?: number;
12
+ };
13
+ /**
14
+ * Update layer base config: dataId, label, column, isVisible
15
+ * @param oldLayerId - layer id to be updated
16
+ * @param newLayerConfig - new layer config
17
+ * @param layerIndex - (Optional) Index of the layer to be updated (can be useful in some cases, because
18
+ * the layer id might change during update, e.g. when the type of the layer changes)
19
+ * @returns action
20
+ * @public
21
+ */
22
+ export declare function applyLayerConfig(oldLayerId: string, newLayerConfig: ParsedLayer, layerIndex?: number): Merge<ApplyLayerConfigUpdaterAction, {
23
+ type: typeof ActionTypes.APPLY_LAYER_CONFIG;
24
+ }>;
25
+ export declare type LayerConfigChangeUpdaterAction = {
26
+ oldLayer: Layer;
27
+ newConfig: Partial<LayerBaseConfig>;
28
+ };
29
+ /**
30
+ * Update layer base config: dataId, label, column, isVisible
31
+ * @param oldLayer - layer to be updated
32
+ * @param newConfig - new config to be merged with old config
33
+ * @returns action
34
+ * @public
35
+ */
36
+ export declare function layerConfigChange(oldLayer: Layer, newConfig: Partial<LayerBaseConfig>): Merge<LayerConfigChangeUpdaterAction, {
37
+ type: typeof ActionTypes.LAYER_CONFIG_CHANGE;
38
+ }>;
39
+ export declare type LayerTextLabelChangeUpdaterAction = {
40
+ oldLayer: Layer;
41
+ idx: number | 'all';
42
+ prop: string;
43
+ value: any;
44
+ };
45
+ /**
46
+ * Update layer text label
47
+ * @param oldLayer - layer to be updated
48
+ * @param idx -`idx` of text label to be updated
49
+ * @param prop - `prop` of text label, e,g, `anchor`, `alignment`, `color`, `size`, `field`, `outlineWidth`, `outlineColor`
50
+ * @param value - new value
51
+ * @returns action
52
+ * @public
53
+ */
54
+ export declare function layerTextLabelChange(oldLayer: Layer, idx: number | 'all', prop: string, value: any): Merge<LayerTextLabelChangeUpdaterAction, {
55
+ type: typeof ActionTypes.LAYER_TEXT_LABEL_CHANGE;
56
+ }>;
57
+ export declare type LayerSetIsValidUpdaterAction = {
58
+ oldLayer: Layer;
59
+ isValid: boolean;
60
+ };
61
+ /**
62
+ * Changes value of isValid flag for a layer.
63
+ * The action also updates visibility of the layer based on isValid.
64
+ * @param oldLayer - layer to be updated
65
+ * @param isValid - new value for isValid flag
66
+ * @returns action
67
+ * @public
68
+ */
69
+ export declare function layerSetIsValid(oldLayer: Layer, isValid: boolean): Merge<LayerSetIsValidUpdaterAction, {
70
+ type: typeof ActionTypes.LAYER_SET_IS_VALID;
71
+ }>;
72
+ export declare type LayerTypeChangeUpdaterAction = {
73
+ oldLayer: Layer;
74
+ newType: string;
75
+ };
76
+ /**
77
+ * Update layer type. Previews layer config will be copied if applicable.
78
+ * @param oldLayer - layer to be updated
79
+ * @param newType - new type
80
+ * @returns action
81
+ * @public
82
+ */
83
+ export declare function layerTypeChange(oldLayer: Layer, newType: string): Merge<LayerTypeChangeUpdaterAction, {
84
+ type: typeof ActionTypes.LAYER_TYPE_CHANGE;
85
+ }>;
86
+ export declare type LayerVisualChannelConfigChangeUpdaterAction = {
87
+ oldLayer: Layer;
88
+ newConfig: Partial<LayerBaseConfig>;
89
+ channel: string;
90
+ newVisConfig?: Partial<LayerVisConfig>;
91
+ };
92
+ /**
93
+ * Update layer visual channel
94
+ * @memberof visStateActions
95
+ * @param oldLayer - layer to be updated
96
+ * @param newConfig - new visual channel config
97
+ * @param channel - channel to be updated
98
+ * @returns action
99
+ * @public
100
+ */
101
+ export declare function layerVisualChannelConfigChange(oldLayer: Layer, newConfig: Partial<LayerBaseConfig>, channel: string, newVisConfig?: Partial<LayerVisConfig>): Merge<LayerVisualChannelConfigChangeUpdaterAction, {
102
+ type: typeof ActionTypes.LAYER_VISUAL_CHANNEL_CHANGE;
103
+ }>;
104
+ export declare type LayerVisConfigChangeUpdaterAction = {
105
+ oldLayer: Layer;
106
+ newVisConfig: Partial<LayerVisConfig>;
107
+ };
108
+ /**
109
+ * Update layer `visConfig`
110
+ * @memberof visStateActions
111
+ * @param oldLayer - layer to be updated
112
+ * @param newVisConfig - new visConfig as a key value map: e.g. `{opacity: 0.8}`
113
+ * @returns action
114
+ * @public
115
+ */
116
+ export declare function layerVisConfigChange(oldLayer: Layer, newVisConfig: Partial<LayerVisConfig>): Merge<LayerVisConfigChangeUpdaterAction, {
117
+ type: typeof ActionTypes.LAYER_VIS_CONFIG_CHANGE;
118
+ }>;
119
+ export declare type LayerColorUIChangeUpdaterAction = {
120
+ oldLayer: Layer;
121
+ prop: string;
122
+ newConfig: NestedPartial<ColorUI>;
123
+ };
124
+ /**
125
+ * Set the color palette ui for layer color
126
+ * @memberof visStateActions
127
+ * @param oldLayer - layer to be updated
128
+ * @param prop - which color prop
129
+ * @param newConfig - to be merged
130
+ * @returns action
131
+ * @public
132
+ */
133
+ export declare function layerColorUIChange(oldLayer: Layer, prop: string, newConfig: NestedPartial<ColorUI>): Merge<LayerColorUIChangeUpdaterAction, {
134
+ type: typeof ActionTypes.LAYER_COLOR_UI_CHANGE;
135
+ }>;
136
+ export declare type UpdateLayerBlendingUpdaterAction = {
137
+ mode: 'additive' | 'normal' | 'subtractive';
138
+ };
139
+ /**
140
+ * Update layer blending mode
141
+ * @memberof visStateActions
142
+ * @param mode one of `additive`, `normal` and `subtractive`
143
+ * @returns action
144
+ * @public
145
+ */
146
+ export declare function updateLayerBlending(mode: 'additive' | 'normal' | 'subtractive'): Merge<UpdateLayerBlendingUpdaterAction, {
147
+ type: typeof ActionTypes.UPDATE_LAYER_BLENDING;
148
+ }>;
149
+ export declare type UpdateOverlayBlendingUpdaterAction = {
150
+ mode: 'screen' | 'normal' | 'darken';
151
+ };
152
+ /**
153
+ * Update overlay blending mode
154
+ * @memberof visStateActions
155
+ * @param mode one of `screen`, `normal` and `darken`
156
+ * @returns action
157
+ * @public
158
+ */
159
+ export declare function updateOverlayBlending(mode: 'screen' | 'normal' | 'darken'): Merge<UpdateOverlayBlendingUpdaterAction, {
160
+ type: typeof ActionTypes.UPDATE_OVERLAY_BLENDING;
161
+ }>;
162
+ export declare type InteractionConfigChangeUpdaterAction = {
163
+ config: ValueOf<InteractionConfig>;
164
+ };
165
+ /**
166
+ * Update `interactionConfig`
167
+ * @memberof visStateActions
168
+ * @param config - new config as key value map: `{tooltip: {enabled: true}}`
169
+ * @returns action
170
+ * @public
171
+ */
172
+ export declare function interactionConfigChange(config: ValueOf<InteractionConfig>): Merge<InteractionConfigChangeUpdaterAction, {
173
+ type: typeof ActionTypes.INTERACTION_CONFIG_CHANGE;
174
+ }>;
175
+ export declare type SetFilterUpdaterAction = {
176
+ idx: number;
177
+ prop: string | string[];
178
+ value: any;
179
+ valueIndex?: number;
180
+ };
181
+ /**
182
+ * Update filter property
183
+ * @memberof visStateActions
184
+ * @param idx -`idx` of filter to be updated
185
+ * @param prop - `prop` of filter, e,g, `dataId`, `name`, `value`
186
+ * or an array e.g. ['idx', 'name']. in that case the value
187
+ * should also be an array of the corresponding values (by index)
188
+ * @param value - new value
189
+ * @param valueIndex - dataId index
190
+ * @returns action
191
+ * @public
192
+ */
193
+ export declare function setFilter(idx: number, prop: string | string[], value: any, valueIndex?: number): Merge<SetFilterUpdaterAction, {
194
+ type: typeof ActionTypes.SET_FILTER;
195
+ }>;
196
+ export declare type SetFilterAnimationTimeUpdaterAction = {
197
+ idx: number;
198
+ prop: string;
199
+ value: any;
200
+ valueIndex?: number;
201
+ };
202
+ /**
203
+ * Same as Update filter
204
+ * @memberof visStateActions
205
+ * @param idx -`idx` of filter to be updated
206
+ * @param prop - `prop` of filter, e,g, `dataId`, `name`, `value`
207
+ * @param value - new value
208
+ * @param valueIndex - dataId index
209
+ * @returns action
210
+ * @public
211
+ */
212
+ export declare function setFilterAnimationTime(idx: number, prop: string, value: any, valueIndex?: number): Merge<SetFilterAnimationTimeUpdaterAction, {
213
+ type: typeof ActionTypes.SET_FILTER_ANIMATION_TIME;
214
+ }>;
215
+ export declare type SetFilterAnimationWindowUpdaterAction = {
216
+ id: string;
217
+ animationWindow: string;
218
+ };
219
+ /**
220
+ * Same as Update filter
221
+ * @memberof visStateActions
222
+ * @public
223
+ */
224
+ export declare function setFilterAnimationWindow({ id, animationWindow }: SetFilterAnimationWindowUpdaterAction): Merge<SetFilterAnimationWindowUpdaterAction, {
225
+ type: typeof ActionTypes.SET_FILTER_ANIMATION_WINDOW;
226
+ }>;
227
+ export declare type AddFilterUpdaterAction = {
228
+ dataId?: string | string[] | null;
229
+ id?: string;
230
+ };
231
+ /**
232
+ * Add a new filter
233
+ * @memberof visStateActions
234
+ * @param dataId - dataset `id` this new filter is associated with
235
+ * @param id - `id` for the new filter
236
+ * @returns action
237
+ * @public
238
+ */
239
+ export declare function addFilter(dataId: string | null, id?: string): Merge<AddFilterUpdaterAction, {
240
+ type: typeof ActionTypes.ADD_FILTER;
241
+ }>;
242
+ export declare type CreateOrUpdateFilterUpdaterAction = {
243
+ id?: string;
244
+ dataId?: string | string[];
245
+ field?: string | string[];
246
+ value?: any;
247
+ };
248
+ /**
249
+ * Create or updates a filter
250
+ * @memberof visStateActions
251
+ * @param dataId - dataset `id` this new filter is associated with
252
+ * @returns action
253
+ * @public
254
+ */
255
+ export declare function createOrUpdateFilter(id?: string, dataId?: string | string[], field?: string | string[], value?: any): Merge<CreateOrUpdateFilterUpdaterAction, {
256
+ type: typeof ActionTypes.CREATE_OR_UPDATE_FILTER;
257
+ }>;
258
+ export declare type AddLayerUpdaterAction = {
259
+ config?: object;
260
+ datasetId?: string;
261
+ };
262
+ /**
263
+ * Add a new layer
264
+ * @memberof visStateActions
265
+ * @param config - new layer config
266
+ * @param datasetId - dataset id used for creating an empty layer
267
+ * @returns action
268
+ * @public
269
+ */
270
+ export declare function addLayer(config?: object, datasetId?: string): Merge<AddLayerUpdaterAction, {
271
+ type: typeof ActionTypes.ADD_LAYER;
272
+ }>;
273
+ export declare type ReorderLayerUpdaterAction = {
274
+ order: string[];
275
+ };
276
+ /**
277
+ * Reorder layer, order is an array of layer indexes, index 0 will be the one at the bottom
278
+ * @memberof visStateActions
279
+ * @param order an array of layer indexes
280
+ * @returns action
281
+ * @public
282
+ * @example
283
+ *
284
+ * bring `layers[1]` below `layers[0]`, the sequence layers will be rendered is `layers[1].id`, `layers[0].id`, `layers[2].id`, `layers[3].id`.
285
+ * `layers[1]` will be at the bottom, `layers[13]` will be at the top.
286
+ * this.props.dispatch(reorderLayer([`layers[1].id`, `layers[0].id`, `layers[2].id`, `layers[3].id`]));
287
+ */
288
+ export declare function reorderLayer(order: string[]): Merge<ReorderLayerUpdaterAction, {
289
+ type: typeof ActionTypes.REORDER_LAYER;
290
+ }>;
291
+ export declare type RemoveFilterUpdaterAction = {
292
+ idx: number;
293
+ };
294
+ /**
295
+ * Remove a filter from `visState.filters`, once a filter is removed, data will be re-filtered and layer will be updated
296
+ * @memberof visStateActions
297
+ * @param idx idx of filter to be removed
298
+ * @returns action
299
+ * @public
300
+ */
301
+ export declare function removeFilter(idx: number): Merge<RemoveFilterUpdaterAction, {
302
+ type: typeof ActionTypes.REMOVE_FILTER;
303
+ }>;
304
+ export declare type RemoveLayerUpdaterAction = {
305
+ id: string;
306
+ };
307
+ /**
308
+ * Remove a layer
309
+ * @memberof visStateActions
310
+ * @param id idx of layer to be removed
311
+ * @returns action
312
+ * @public
313
+ */
314
+ export declare function removeLayer(id: string): Merge<RemoveLayerUpdaterAction, {
315
+ type: typeof ActionTypes.REMOVE_LAYER;
316
+ }>;
317
+ export declare type DuplicateLayerUpdaterAction = {
318
+ id: string;
319
+ };
320
+ /**
321
+ * Duplicate a layer
322
+ * @memberof visStateActions
323
+ * @param id id of layer to be duplicated
324
+ * @returns action
325
+ * @public
326
+ */
327
+ export declare function duplicateLayer(id: string): Merge<DuplicateLayerUpdaterAction, {
328
+ type: typeof ActionTypes.DUPLICATE_LAYER;
329
+ }>;
330
+ export declare type AddEffectUpdaterAction = {
331
+ config: EffectPropsPartial;
332
+ };
333
+ /**
334
+ * Add a new effect
335
+ * @memberof visStateActions
336
+ * @param config - new effect config
337
+ * @returns action
338
+ * @public
339
+ */
340
+ export declare function addEffect(config: EffectPropsPartial): Merge<AddEffectUpdaterAction, {
341
+ type: typeof ActionTypes.ADD_EFFECT;
342
+ }>;
343
+ export declare type ReorderEffectUpdaterAction = {
344
+ order: string[];
345
+ };
346
+ /**
347
+ * Reorder effects
348
+ * @memberof visStateActions
349
+ * @param order an array of effect ids
350
+ * @returns action
351
+ * @public
352
+ */
353
+ export declare function reorderEffect(order: string[]): Merge<ReorderEffectUpdaterAction, {
354
+ type: typeof ActionTypes.REORDER_EFFECT;
355
+ }>;
356
+ export declare type RemoveEffectUpdaterAction = {
357
+ id: string;
358
+ };
359
+ /**
360
+ * Remove an effect
361
+ * @memberof visStateActions
362
+ * @param id idx of the effect to be removed
363
+ * @returns action
364
+ * @public
365
+ */
366
+ export declare function removeEffect(id: string): Merge<RemoveEffectUpdaterAction, {
367
+ type: typeof ActionTypes.REMOVE_EFFECT;
368
+ }>;
369
+ export declare type UpdateEffectUpdaterAction = {
370
+ id: string;
371
+ props: EffectPropsPartial;
372
+ };
373
+ /**
374
+ * Update an effect
375
+ * @memberof visStateActions
376
+ * @param props idx of the effect to be updated with specified props
377
+ * @returns action
378
+ * @public
379
+ */
380
+ export declare function updateEffect(id: string, props: EffectPropsPartial): Merge<UpdateEffectUpdaterAction, {
381
+ type: typeof ActionTypes.UPDATE_EFFECT;
382
+ }>;
383
+ export declare type RemoveDatasetUpdaterAction = {
384
+ dataId: string;
385
+ };
386
+ /**
387
+ * Remove a dataset and all layers, filters, tooltip configs that based on it
388
+ * @memberof visStateActions
389
+ * @param dataId dataset id
390
+ * @returns action
391
+ * @public
392
+ */
393
+ export declare function removeDataset(dataId: string): Merge<RemoveDatasetUpdaterAction, {
394
+ type: typeof ActionTypes.REMOVE_DATASET;
395
+ }>;
396
+ export declare type ShowDatasetTableUpdaterAction = {
397
+ dataId: string;
398
+ };
399
+ /**
400
+ * Display dataset table in a modal
401
+ * @memberof visStateActions
402
+ * @param dataId dataset id to show in table
403
+ * @returns action
404
+ * @public
405
+ */
406
+ export declare function showDatasetTable(dataId: string): Merge<ShowDatasetTableUpdaterAction, {
407
+ type: typeof ActionTypes.SHOW_DATASET_TABLE;
408
+ }>;
409
+ export declare type UpdateDatasetColorUpdater = {
410
+ dataId: string;
411
+ newColor: RGBColor;
412
+ };
413
+ /**
414
+ * Update dataset color to custom by means of color picker
415
+ * @memberof visStateActions
416
+ * @param dataId dataset `id` this custom color is associated with
417
+ * @param newColor custom color in RGBformat
418
+ * @returns action
419
+ * @public
420
+ */
421
+ export declare function updateTableColor(dataId: string, newColor: RGBColor): Merge<UpdateDatasetColorUpdater, {
422
+ type: typeof ActionTypes.UPDATE_TABLE_COLOR;
423
+ }>;
424
+ export declare type SortTableColumnUpdaterAction = {
425
+ dataId: string;
426
+ column: string;
427
+ mode?: string;
428
+ };
429
+ /**
430
+ * Sort dataset column, for table display
431
+ * @memberof visStateActions
432
+ * @param dataId
433
+ * @param column
434
+ * @param mode
435
+ * @returns action
436
+ * @public
437
+ */
438
+ export declare function sortTableColumn(dataId: string, column: string, mode?: string): Merge<SortTableColumnUpdaterAction, {
439
+ type: typeof ActionTypes.SORT_TABLE_COLUMN;
440
+ }>;
441
+ export declare type PinTableColumnUpdaterAction = {
442
+ dataId: string;
443
+ column: string;
444
+ };
445
+ /**
446
+ * Pin dataset column, for table display
447
+ * @param dataId
448
+ * @param column
449
+ * @returns action
450
+ * @public
451
+ */
452
+ export declare function pinTableColumn(dataId: string, column: string): Merge<PinTableColumnUpdaterAction, {
453
+ type: typeof ActionTypes.PIN_TABLE_COLUMN;
454
+ }>;
455
+ export declare type CopyTableColumnUpdaterAction = {
456
+ dataId: string;
457
+ column: string;
458
+ };
459
+ /**
460
+ * Copy column, for table display
461
+ * @param dataId
462
+ * @param column
463
+ * @returns action
464
+ * @public
465
+ */
466
+ export declare function copyTableColumn(dataId: string, column: string): Merge<CopyTableColumnUpdaterAction, {
467
+ type: typeof ActionTypes.COPY_TABLE_COLUMN;
468
+ }>;
469
+ export declare type SetColumnDisplayFormatUpdaterAction = {
470
+ dataId: string;
471
+ formats: {
472
+ [key: string]: string;
473
+ };
474
+ };
475
+ /**
476
+ * Set column display format
477
+ * @param dataId
478
+ * @param formats
479
+ * @returns action
480
+ * @public
481
+ */
482
+ export declare function setColumnDisplayFormat(dataId: SetColumnDisplayFormatUpdaterAction['dataId'], formats: SetColumnDisplayFormatUpdaterAction['formats']): Merge<SetColumnDisplayFormatUpdaterAction, {
483
+ type: typeof ActionTypes.SET_COLUMN_DISPLAY_FORMAT;
484
+ }>;
485
+ export declare type AddDataToMapUpdaterOptions = {
486
+ centrMap?: boolean;
487
+ readOnly?: boolean;
488
+ keepExistingConfig?: boolean;
489
+ };
490
+ export declare type UpdateVisDataUpdaterAction = {
491
+ datasets: AddDataToMapPayload['datasets'];
492
+ options: AddDataToMapPayload['options'];
493
+ config?: ParsedConfig;
494
+ };
495
+ /**
496
+ * Add new dataset to `visState`, with option to load a map config along with the datasets
497
+ * @memberof visStateActions
498
+ * @param datasets - ***required** datasets can be a dataset or an array of datasets
499
+ * Each dataset object needs to have `info` and `data` property.
500
+ * @param {object} options
501
+ * @param options.centerMap `default: true` if `centerMap` is set to `true` kepler.gl will
502
+ * place the map view within the data points boundaries
503
+ * @param options.readOnly `default: false` if `readOnly` is set to `true`
504
+ * the left setting panel will be hidden
505
+ * @param config this object will contain the full kepler.gl instance configuration {mapState, mapStyle, visState}
506
+ * @returns action
507
+ * @public
508
+ */
509
+ export declare function updateVisData(datasets: AddDataToMapPayload['datasets'], options: AddDataToMapPayload['options'], config?: ParsedConfig): Merge<UpdateVisDataUpdaterAction, {
510
+ type: typeof ActionTypes.UPDATE_VIS_DATA;
511
+ }>;
512
+ export declare type RenameDatasetUpdaterAction = {
513
+ dataId: string;
514
+ label: string;
515
+ };
516
+ /**
517
+ * Rename an existing dataset in `visState`
518
+ * @memberof visStateActions
519
+ * @param dataId - ***required** Id of the dataset to update
520
+ * @param label - ***required** New name for the dataset
521
+ * @returns action
522
+ * @public
523
+ */
524
+ export declare function renameDataset(dataId: string, label: string): Merge<RenameDatasetUpdaterAction, {
525
+ type: typeof ActionTypes.RENAME_DATASET;
526
+ }>;
527
+ export declare type UpdateDatasetPropsUpdaterAction = {
528
+ dataId: string;
529
+ props: {
530
+ label?: string;
531
+ color?: RGBColor;
532
+ metadata?: Record<string, unknown>;
533
+ };
534
+ };
535
+ /**
536
+ * Update an existing dataset props in `visState`
537
+ * @param dataId - ***required** Id of the dataset to update
538
+ * @param props - ***required** New props to update
539
+ * @returns action
540
+ */
541
+ export declare function updateDatasetProps(dataId: string, props: {
542
+ label?: string;
543
+ color?: RGBColor;
544
+ metadata?: Record<string, unknown>;
545
+ }): Merge<UpdateDatasetPropsUpdaterAction, {
546
+ type: typeof ActionTypes.UPDATE_DATASET_PROPS;
547
+ }>;
548
+ export declare type ToggleFilterAnimationUpdaterAction = {
549
+ idx: number;
550
+ };
551
+ /**
552
+ * Start and end filter animation
553
+ * @memberof visStateActions
554
+ * @param {Number} idx of filter
555
+ * @returns action
556
+ * @public
557
+ */
558
+ export declare function toggleFilterAnimation(idx: number): Merge<ToggleFilterAnimationUpdaterAction, {
559
+ type: typeof ActionTypes.TOGGLE_FILTER_ANIMATION;
560
+ }>;
561
+ export declare type UpdateFilterAnimationSpeedUpdaterAction = {
562
+ idx: number;
563
+ speed: number;
564
+ };
565
+ /**
566
+ * Change filter animation speed
567
+ * @memberof visStateActions
568
+ * @param idx - `idx` of filter
569
+ * @param speed - `speed` to change it to. `speed` is a multiplier
570
+ * @returns action
571
+ * @public
572
+ */
573
+ export declare function updateFilterAnimationSpeed(idx: number, speed: number): Merge<UpdateFilterAnimationSpeedUpdaterAction, {
574
+ type: typeof ActionTypes.UPDATE_FILTER_ANIMATION_SPEED;
575
+ }>;
576
+ export declare type SetLayerAnimationTimeUpdaterAction = {
577
+ value: number | null;
578
+ };
579
+ /**
580
+ * Reset animation
581
+ * @memberof visStateActions
582
+ * @param value - Current value of the slider
583
+ * @returns action
584
+ * @public
585
+ */
586
+ export declare function setLayerAnimationTime(value: number): Merge<SetLayerAnimationTimeUpdaterAction, {
587
+ type: typeof ActionTypes.SET_LAYER_ANIMATION_TIME;
588
+ }>;
589
+ export declare type UpdateLayerAnimationSpeedUpdaterAction = {
590
+ speed: number;
591
+ };
592
+ /**
593
+ * update trip layer animation speed
594
+ * @memberof visStateActions
595
+ * @param speed - `speed` to change it to. `speed` is a multiplier
596
+ * @returns action
597
+ * @public
598
+ */
599
+ export declare function updateLayerAnimationSpeed(speed: number): Merge<UpdateLayerAnimationSpeedUpdaterAction, {
600
+ type: typeof ActionTypes.UPDATE_LAYER_ANIMATION_SPEED;
601
+ }>;
602
+ export declare type ToggleLayerAnimationUpdaterAction = void;
603
+ /**
604
+ * start end end layer animation
605
+ * @memberof visStateActions
606
+ * @returns action
607
+ * @public
608
+ */
609
+ export declare function toggleLayerAnimation(): Merge<ToggleLayerAnimationUpdaterAction, {
610
+ type: typeof ActionTypes.TOGGLE_LAYER_ANIMATION;
611
+ }>;
612
+ export declare type ToggleLayerAnimationControlUpdaterAction = void;
613
+ /**
614
+ * hide and show layer animation control
615
+ * @memberof visStateActions
616
+ * @returns action
617
+ * @public
618
+ */
619
+ export declare function toggleLayerAnimationControl(): Merge<ToggleLayerAnimationControlUpdaterAction, {
620
+ type: typeof ActionTypes.TOGGLE_LAYER_ANIMATION_CONTROL;
621
+ }>;
622
+ export declare type SetFilterViewUpdaterAction = {
623
+ idx: number;
624
+ view: Filter['view'];
625
+ };
626
+ /**
627
+ * Show larger time filter at bottom for time playback (apply to time filter only)
628
+ * @memberof visStateActions
629
+ * @param idx - index of filter to enlarge
630
+ * @param view - type of filter view
631
+ * @returns action
632
+ * @public
633
+ */
634
+ export declare function setFilterView(idx: number, view: Filter['view']): Merge<SetFilterViewUpdaterAction, {
635
+ type: typeof ActionTypes.SET_FILTER_VIEW;
636
+ }>;
637
+ export declare type ToggleFilterFeatureUpdaterAction = {
638
+ idx: number;
639
+ };
640
+ /**
641
+ * Show/hide filter feature on map
642
+ * @memberof visStateActions
643
+ * @param idx - index of filter feature to show/hide
644
+ * @return action
645
+ */
646
+ export declare function toggleFilterFeature(idx: number): Merge<ToggleFilterFeatureUpdaterAction, {
647
+ type: typeof ActionTypes.TOGGLE_FILTER_FEATURE;
648
+ }>;
649
+ export declare type OnLayerHoverUpdaterAction = {
650
+ info: PickInfo<any> | null;
651
+ mapIndex?: number;
652
+ };
653
+ /**
654
+ * Trigger layer hover event with hovered object
655
+ * @memberof visStateActions
656
+ * @param info - Object hovered, returned by deck.gl.
657
+ * @param mapIndex - Optional property for limiting the display of the `<MapPopover>` to the `<MapContainer>` the user is interacting with.
658
+ * @returns action
659
+ * @public
660
+ */
661
+ export declare function onLayerHover(info: PickInfo<any> | null, mapIndex?: number): Merge<OnLayerHoverUpdaterAction, {
662
+ type: typeof ActionTypes.LAYER_HOVER;
663
+ }>;
664
+ export declare type OnLayerClickUpdaterAction = {
665
+ info: PickInfo<any> | null;
666
+ };
667
+ /**
668
+ * Trigger layer click event with clicked object
669
+ * @memberof visStateActions
670
+ * @param info - Object clicked, returned by deck.gl
671
+ * @returns action
672
+ * @public
673
+ */
674
+ export declare function onLayerClick(info: PickInfo<any> | null): Merge<OnLayerClickUpdaterAction, {
675
+ type: typeof ActionTypes.LAYER_CLICK;
676
+ }>;
677
+ export declare type OnMapClickUpdaterAction = void;
678
+ /**
679
+ * Trigger map click event, unselect clicked object
680
+ * @memberof visStateActions
681
+ * @returns action
682
+ * @public
683
+ */
684
+ export declare function onMapClick(): Merge<OnMapClickUpdaterAction, {
685
+ type: typeof ActionTypes.MAP_CLICK;
686
+ }>;
687
+ export declare type OnMouseMoveUpdaterAction = {
688
+ evt: any;
689
+ };
690
+ /**
691
+ * Trigger map mouse moveevent, payload would be
692
+ * React-map-gl MapLayerMouseEvent
693
+ * https://visgl.github.io/react-map-gl/docs/api-reference/types#maplayermouseevent
694
+ *
695
+ * @memberof visStateActions
696
+ * @param evt - MapLayerMouseEvent
697
+ * @returns action
698
+ * @public
699
+ */
700
+ export declare function onMouseMove(evt: any): Merge<OnMouseMoveUpdaterAction, {
701
+ type: typeof ActionTypes.MOUSE_MOVE;
702
+ }>;
703
+ export declare type ToggleLayerForMapUpdaterAction = {
704
+ mapIndex: number;
705
+ layerId: string;
706
+ };
707
+ /**
708
+ * Toggle visibility of a layer in a split map
709
+ * @memberof visStateActions
710
+ * @param mapIndex - index of the split map
711
+ * @param layerId - id of the layer
712
+ * @returns action
713
+ * @public
714
+ */
715
+ export declare function toggleLayerForMap(mapIndex: number, layerId: string): Merge<ToggleLayerForMapUpdaterAction, {
716
+ type: typeof ActionTypes.TOGGLE_LAYER_FOR_MAP;
717
+ }>;
718
+ declare type FilterPlotNewProp = {
719
+ yAxis?: null | Record<string, any>;
720
+ plotType?: {
721
+ type: string;
722
+ };
723
+ };
724
+ export declare type SetFilterPlotUpdaterAction = {
725
+ idx: number;
726
+ newProp: FilterPlotNewProp;
727
+ valueIndex?: number;
728
+ };
729
+ /**
730
+ * Set the property of a filter plot
731
+ * @memberof visStateActions
732
+ * @param idx
733
+ * @param newProp key value mapping of new prop `{yAxis: 'histogram'}`
734
+ * @param valueIndex dataId index
735
+ * @returns action
736
+ * @public
737
+ */
738
+ export declare function setFilterPlot(idx: number, newProp: FilterPlotNewProp, valueIndex?: number): Merge<SetFilterPlotUpdaterAction, {
739
+ type: typeof ActionTypes.SET_FILTER_PLOT;
740
+ }>;
741
+ export declare type SetMapInfoUpdaterAction = {
742
+ info: any;
743
+ };
744
+ /**
745
+ * Set the property of a filter plot
746
+ * @memberof visStateActions
747
+ * @param info
748
+ * @returns action
749
+ * @public
750
+ */
751
+ export declare function setMapInfo(info: any): Merge<SetMapInfoUpdaterAction, {
752
+ type: typeof ActionTypes.SET_MAP_INFO;
753
+ }>;
754
+ export declare type LoadFilesUpdaterAction = {
755
+ files: File[];
756
+ onFinish?(result: any): any;
757
+ };
758
+ /**
759
+ * Trigger file loading dispatch `addDataToMap` if succeed, or `loadFilesErr` if failed
760
+ * @memberof visStateActions
761
+ * @param files array of fileblob
762
+ * @returns action
763
+ * @public
764
+ */
765
+ export declare function loadFiles(files: File[], onFinish?: (result: any) => any): Merge<LoadFilesUpdaterAction, {
766
+ type: typeof ActionTypes.LOAD_FILES;
767
+ }>;
768
+ /**
769
+ * Called with next file to load
770
+ * @memberof visStateActions
771
+ * @returns action
772
+ * @public
773
+ */
774
+ export declare function loadNextFile(): {
775
+ type: typeof ActionTypes.LOAD_NEXT_FILE;
776
+ };
777
+ export declare type loadFilesSuccessUpdaterAction = {
778
+ result: FileCacheItem[];
779
+ };
780
+ /**
781
+ * called when all files are processed and loaded
782
+ * @memberof visStateActions
783
+ * @param result
784
+ * @returns action
785
+ */
786
+ export declare function loadFilesSuccess(result: FileCacheItem[]): Merge<loadFilesSuccessUpdaterAction, {
787
+ type: typeof ActionTypes.LOAD_FILES_SUCCESS;
788
+ }>;
789
+ export declare type LoadFileStepSuccessAction = {
790
+ fileName: string;
791
+ fileCache: FileCacheItem[];
792
+ };
793
+ /**
794
+ * called when successfully loaded one file, ready to move on to the next one
795
+ * @memberof visStateActions
796
+ * @param result
797
+ * @returns action
798
+ */
799
+ export declare function loadFileStepSuccess({ fileName, fileCache }: {
800
+ fileName: string;
801
+ fileCache: FileCacheItem[];
802
+ }): Merge<LoadFileStepSuccessAction, {
803
+ type: typeof ActionTypes.LOAD_FILE_STEP_SUCCESS;
804
+ }>;
805
+ export declare type LoadFilesErrUpdaterAction = {
806
+ fileName: string;
807
+ error: any;
808
+ };
809
+ /**
810
+ * Trigger loading file error
811
+ * @memberof visStateActions
812
+ * @param error
813
+ * @returns action
814
+ * @public
815
+ */
816
+ export declare function loadFilesErr(fileName: string, error: any): Merge<LoadFilesErrUpdaterAction, {
817
+ type: typeof ActionTypes.LOAD_FILES_ERR;
818
+ }>;
819
+ export declare type SetFeaturesUpdaterAction = {
820
+ features: Feature[];
821
+ };
822
+ /**
823
+ * Store features to state
824
+ * @memberof visStateActions
825
+ * @param features
826
+ * @returns action
827
+ */
828
+ export declare function setFeatures(features: Feature[]): Merge<SetFeaturesUpdaterAction, {
829
+ type: typeof ActionTypes.SET_FEATURES;
830
+ }>;
831
+ export declare type SetPolygonFilterLayerUpdaterAction = {
832
+ layer: Layer;
833
+ feature: Feature;
834
+ };
835
+ /**
836
+ * It will apply the provide feature as filter to the given layer.
837
+ * If the given feature is already applied as filter to the layer, it will remove the layer from the filter
838
+ * @memberof visStateActions
839
+ * @param layer
840
+ * @param feature
841
+ * @returns action
842
+ */
843
+ export declare function setPolygonFilterLayer(layer: Layer, feature: Feature): Merge<SetPolygonFilterLayerUpdaterAction, {
844
+ type: typeof ActionTypes.SET_POLYGON_FILTER_LAYER;
845
+ }>;
846
+ export declare type SetSelectedFeatureUpdaterAction = {
847
+ feature: Feature | null;
848
+ selectionContext?: FeatureSelectionContext;
849
+ };
850
+ /**
851
+ * Set the current feature to be edited/deleted,
852
+ * and the context of how the feature was selected.
853
+ * @memberof visStateActions
854
+ * @param feature
855
+ * @param selectionContext
856
+ * @returns action
857
+ */
858
+ export declare function setSelectedFeature(feature: Feature | null, selectionContext?: FeatureSelectionContext): Merge<SetSelectedFeatureUpdaterAction, {
859
+ type: typeof ActionTypes.SET_SELECTED_FEATURE;
860
+ }>;
861
+ export declare type DeleteFeatureUpdaterAction = {
862
+ feature: Feature;
863
+ };
864
+ /**
865
+ * Delete the given feature
866
+ * @memberof visStateActions
867
+ * @param feature
868
+ * @returns action
869
+ */
870
+ export declare function deleteFeature(feature: Feature): Merge<DeleteFeatureUpdaterAction, {
871
+ type: typeof ActionTypes.DELETE_FEATURE;
872
+ }>;
873
+ export declare type SetEditorModeUpdaterAction = {
874
+ mode: string;
875
+ };
876
+ /** Set the map mode
877
+ * @memberof visStateActions
878
+ * @param mode one of EDITOR_MODES
879
+ * @returns action
880
+ * @public
881
+ * @example
882
+ * import {setMapMode} from 'kepler.gl/actions';
883
+ * import {EDITOR_MODES} from 'kepler.gl/constants';
884
+ *
885
+ * this.props.dispatch(setMapMode(EDITOR_MODES.DRAW_POLYGON));
886
+ */
887
+ export declare function setEditorMode(mode: string): Merge<SetEditorModeUpdaterAction, {
888
+ type: typeof ActionTypes.SET_EDITOR_MODE;
889
+ }>;
890
+ export declare type ApplyCPUFilterUpdaterAction = {
891
+ dataId: string | string[];
892
+ };
893
+ /**
894
+ * Trigger CPU filter of selected dataset
895
+ * @memberof visStateActions
896
+ * @param dataId - single dataId or an array of dataIds
897
+ * @returns action
898
+ * @public
899
+ */
900
+ export declare function applyCPUFilter(dataId: string | string[]): Merge<ApplyCPUFilterUpdaterAction, {
901
+ type: typeof ActionTypes.APPLY_CPU_FILTER;
902
+ }>;
903
+ export declare type ToggleEditorVisibilityUpdaterAction = void;
904
+ /**
905
+ * Toggle editor layer visibility
906
+ * @memberof visStateActions
907
+ * @return action
908
+ */
909
+ export declare function toggleEditorVisibility(): Merge<ToggleEditorVisibilityUpdaterAction, {
910
+ type: typeof ActionTypes.TOGGLE_EDITOR_VISIBILITY;
911
+ }>;
912
+ declare type FileContent = {
913
+ fileName: string;
914
+ header: string[];
915
+ data: any;
916
+ };
917
+ export declare type NextFileBatchUpdaterAction = {
918
+ payload: {
919
+ gen: AsyncGenerator<FileContent>;
920
+ fileName: string;
921
+ progress?: any;
922
+ accumulated?: any;
923
+ onFinish: (result: any) => any;
924
+ };
925
+ };
926
+ /**
927
+ * Process the next file batch
928
+ * @memberof visStateActions
929
+ * @param payload - batch payload
930
+ * @return action
931
+ */
932
+ export declare function nextFileBatch(payload: NextFileBatchUpdaterAction['payload']): Merge<NextFileBatchUpdaterAction, {
933
+ type: typeof ActionTypes.NEXT_FILE_BATCH;
934
+ }>;
935
+ export declare type ProcessFileContentUpdaterAction = {
936
+ payload: {
937
+ content: FileContent;
938
+ fileCache: FileCacheItem[];
939
+ };
940
+ };
941
+ /**
942
+ * Process the file content
943
+ * @memberof visStateActions
944
+ * @param payload - the file content
945
+ * @return action
946
+ */
947
+ export declare function processFileContent(payload: ProcessFileContentUpdaterAction['payload']): Merge<ProcessFileContentUpdaterAction, {
948
+ type: typeof ActionTypes.PROCESS_FILE_CONTENT;
949
+ }>;
950
+ export declare type SetLayerAnimationTimeConfigAction = {
951
+ config: {
952
+ timezone?: string;
953
+ timeFormat?: string;
954
+ };
955
+ };
956
+ /**
957
+ * Set layer animation time format and timezone
958
+ * @memberof visStateActions
959
+ * @param config - {timeFormat: string, timezone: string}
960
+ * @return action
961
+ */
962
+ export declare function setLayerAnimationTimeConfig(config: SetLayerAnimationTimeConfigAction['config']): Merge<SetLayerAnimationTimeConfigAction, {
963
+ type: typeof ActionTypes.SET_LAYER_ANIMATION_TIME_CONFIG;
964
+ }>;
965
+ export declare type SetFilterAnimationTimeConfigAction = {
966
+ idx: number;
967
+ config: {
968
+ timezone?: string;
969
+ timeFormat?: string;
970
+ };
971
+ };
972
+ /**
973
+ * Set Filter animation time format and timezone
974
+ * @memberof visStateActions
975
+ * @param idx
976
+ * @param config
977
+ * @return action
978
+ */
979
+ export declare function setFilterAnimationTimeConfig(idx: SetFilterAnimationTimeConfigAction['idx'], config: SetFilterAnimationTimeConfigAction['config']): Merge<SetFilterAnimationTimeConfigAction, {
980
+ type: typeof ActionTypes.SET_FILTER_ANIMATION_TIME_CONFIG;
981
+ }>;
982
+ export declare type LayerFilteredItemsChangeAction = {
983
+ event: {
984
+ id: string;
985
+ count: number;
986
+ };
987
+ layer: Layer;
988
+ };
989
+ /**
990
+ * deck.gl layer gpu filter callback
991
+ * @memberof visStateActions
992
+ * @param layer
993
+ * @param event
994
+ * @return action
995
+ */
996
+ export declare function layerFilteredItemsChange(layer: LayerFilteredItemsChangeAction['layer'], event: LayerFilteredItemsChangeAction['event']): Merge<LayerFilteredItemsChangeAction, {
997
+ type: typeof ActionTypes.LAYER_FILTERED_ITEMS_CHANGE;
998
+ }>;
999
+ export declare type SyncTimeFilterWithLayerTimelineAction = {
1000
+ idx: number;
1001
+ enable: boolean;
1002
+ };
1003
+ export declare function syncTimeFilterWithLayerTimeline(idx: SyncTimeFilterWithLayerTimelineAction['idx'], enable: SyncTimeFilterWithLayerTimelineAction['enable']): Merge<SyncTimeFilterWithLayerTimelineAction, {
1004
+ type: typeof ActionTypes.SYNC_TIME_FILTER_WITH_LAYER_TIMELINE;
1005
+ }>;
1006
+ export declare type setTimeFilterSyncTimelineModeAction = {
1007
+ id: string;
1008
+ mode: SyncTimelineMode;
1009
+ };
1010
+ export declare function setTimeFilterSyncTimelineMode({ id, mode }: setTimeFilterSyncTimelineModeAction): Merge<setTimeFilterSyncTimelineModeAction, {
1011
+ type: typeof ActionTypes.SYNC_TIME_FILTER_TIMELINE_MODE;
1012
+ }>;
1013
+ export declare type CreateNewDatasetSuccessPayload = {
1014
+ results: (PromiseFulfilledResult<KeplerTable> | PromiseRejectedResult)[];
1015
+ addToMapOptions: AddDataToMapPayload['options'];
1016
+ };
1017
+ /**
1018
+ * Called when a new dataset is created successfully via async table methods
1019
+ * @param payload
1020
+ * @param payload.results - results of promises.allSettlted
1021
+ * @returns
1022
+ */
1023
+ export declare const createNewDatasetSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<CreateNewDatasetSuccessPayload, string>;
1024
+ export {};