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

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