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

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.
@@ -2,7 +2,7 @@ import { default as ActionTypes } from './action-types';
2
2
  import { FileCacheItem } from '@kepler.gl/processors';
3
3
  import { Layer, LayerBaseConfig } from '@kepler.gl/layers';
4
4
  import { KeplerTable } from '@kepler.gl/table';
5
- import { AddDataToMapPayload, ValueOf, Merge, PickInfo, RGBColor, NestedPartial, LayerVisConfig, ColorUI, Feature, FeatureSelectionContext, InteractionConfig, Filter, ParsedConfig, ParsedLayer, EffectPropsPartial, SyncTimelineMode, AnimationConfig, FilterAnimationConfig } from '@kepler.gl/types';
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';
6
6
  export type ApplyLayerConfigUpdaterAction = {
7
7
  oldLayerId: string;
8
8
  newLayerConfig: ParsedLayer;
@@ -299,7 +299,7 @@ export declare function addLayer(config?: object, datasetId?: string): Merge<Add
299
299
  type: typeof ActionTypes.ADD_LAYER;
300
300
  }>;
301
301
  export type ReorderLayerUpdaterAction = {
302
- order: string[];
302
+ order: LayerOrder;
303
303
  };
304
304
  /**
305
305
  * Reorder layer, order is an array of layer indexes, index 0 will be the one at the bottom
@@ -313,9 +313,55 @@ export type ReorderLayerUpdaterAction = {
313
313
  * `layers[1]` will be at the bottom, `layers[13]` will be at the top.
314
314
  * this.props.dispatch(reorderLayer([`layers[1].id`, `layers[0].id`, `layers[2].id`, `layers[3].id`]));
315
315
  */
316
- export declare function reorderLayer(order: string[]): Merge<ReorderLayerUpdaterAction, {
316
+ export declare function reorderLayer(order: LayerOrder): Merge<ReorderLayerUpdaterAction, {
317
317
  type: typeof ActionTypes.REORDER_LAYER;
318
318
  }>;
319
+ export type AddLayerGroupUpdaterAction = {
320
+ id?: string;
321
+ label?: string;
322
+ isVisible?: boolean;
323
+ layerOrder?: string[];
324
+ isIncludedInLegend?: boolean;
325
+ };
326
+ export declare function addLayerGroup(payload: AddLayerGroupUpdaterAction): Merge<AddLayerGroupUpdaterAction, {
327
+ type: typeof ActionTypes.ADD_LAYER_GROUP;
328
+ }>;
329
+ export type RemoveLayerGroupUpdaterAction = {
330
+ id: string;
331
+ };
332
+ export declare function removeLayerGroup(payload: RemoveLayerGroupUpdaterAction): Merge<RemoveLayerGroupUpdaterAction, {
333
+ type: typeof ActionTypes.REMOVE_LAYER_GROUP;
334
+ }>;
335
+ export type UpdateLayerGroupUpdaterAction = {
336
+ id: string;
337
+ options: Partial<Omit<LayerOrderGroup, 'id'>>;
338
+ };
339
+ export declare function updateLayerGroup(payload: UpdateLayerGroupUpdaterAction): Merge<UpdateLayerGroupUpdaterAction, {
340
+ type: typeof ActionTypes.UPDATE_LAYER_GROUP;
341
+ }>;
342
+ export type AddLayerToLayerGroupUpdaterAction = {
343
+ layerGroupId: string;
344
+ layerId: string;
345
+ };
346
+ export declare function addLayerToLayerGroup(payload: AddLayerToLayerGroupUpdaterAction): Merge<AddLayerToLayerGroupUpdaterAction, {
347
+ type: typeof ActionTypes.ADD_LAYER_TO_LAYER_GROUP;
348
+ }>;
349
+ export type RemoveLayerFromLayerGroupUpdaterAction = {
350
+ layerGroupId: string;
351
+ layerId: string;
352
+ };
353
+ export declare function removeLayerFromLayerGroup(payload: RemoveLayerFromLayerGroupUpdaterAction): Merge<RemoveLayerFromLayerGroupUpdaterAction, {
354
+ type: typeof ActionTypes.REMOVE_LAYER_FROM_LAYER_GROUP;
355
+ }>;
356
+ export type SwapLayerOrderEntriesUpdaterAction = {
357
+ originLayerId: string;
358
+ destinationLayerId?: string;
359
+ originLayerGroupId?: string;
360
+ destinationLayerGroupId?: string;
361
+ };
362
+ export declare function swapLayerOrderEntries(payload: SwapLayerOrderEntriesUpdaterAction): Merge<SwapLayerOrderEntriesUpdaterAction, {
363
+ type: typeof ActionTypes.SWAP_LAYER_ORDER_ENTRIES;
364
+ }>;
319
365
  export type RemoveFilterUpdaterAction = {
320
366
  idx: number;
321
367
  };
@@ -408,6 +454,75 @@ export type UpdateEffectUpdaterAction = {
408
454
  export declare function updateEffect(id: string, props: EffectPropsPartial): Merge<UpdateEffectUpdaterAction, {
409
455
  type: typeof ActionTypes.UPDATE_EFFECT;
410
456
  }>;
457
+ export type AddAnnotationUpdaterAction = {
458
+ config?: AnnotationPropsPartial;
459
+ };
460
+ /**
461
+ * Add a new annotation
462
+ * @memberof visStateActions
463
+ * @param config - new annotation config
464
+ * @returns action
465
+ * @public
466
+ */
467
+ export declare function addAnnotation(config?: AnnotationPropsPartial): Merge<AddAnnotationUpdaterAction, {
468
+ type: typeof ActionTypes.ADD_ANNOTATION;
469
+ }>;
470
+ export type RemoveAnnotationUpdaterAction = {
471
+ id: string;
472
+ };
473
+ /**
474
+ * Remove an annotation
475
+ * @memberof visStateActions
476
+ * @param id id of the annotation to be removed
477
+ * @returns action
478
+ * @public
479
+ */
480
+ export declare function removeAnnotation(id: string): Merge<RemoveAnnotationUpdaterAction, {
481
+ type: typeof ActionTypes.REMOVE_ANNOTATION;
482
+ }>;
483
+ export type UpdateAnnotationUpdaterAction = {
484
+ id: string;
485
+ config: AnnotationPropsPartial;
486
+ };
487
+ /**
488
+ * Update an annotation
489
+ * @memberof visStateActions
490
+ * @param id id of the annotation to be updated
491
+ * @param config partial annotation config to merge
492
+ * @returns action
493
+ * @public
494
+ */
495
+ export declare function updateAnnotation(id: string, config: AnnotationPropsPartial): Merge<UpdateAnnotationUpdaterAction, {
496
+ type: typeof ActionTypes.UPDATE_ANNOTATION;
497
+ }>;
498
+ export type DuplicateAnnotationUpdaterAction = {
499
+ id: string;
500
+ };
501
+ /**
502
+ * Duplicate an annotation
503
+ * @memberof visStateActions
504
+ * @param id id of the annotation to be duplicated
505
+ * @returns action
506
+ * @public
507
+ */
508
+ export declare function duplicateAnnotation(id: string): Merge<DuplicateAnnotationUpdaterAction, {
509
+ type: typeof ActionTypes.DUPLICATE_ANNOTATION;
510
+ }>;
511
+ export type SetSelectedAnnotationUpdaterAction = {
512
+ id: string | null;
513
+ isEditingText?: boolean;
514
+ };
515
+ /**
516
+ * Set the selected annotation
517
+ * @memberof visStateActions
518
+ * @param id id of annotation to select, or null to deselect
519
+ * @param isEditingText whether the text of the annotation is being edited
520
+ * @returns action
521
+ * @public
522
+ */
523
+ export declare function setSelectedAnnotation(id: string | null, isEditingText?: boolean): Merge<SetSelectedAnnotationUpdaterAction, {
524
+ type: typeof ActionTypes.SET_SELECTED_ANNOTATION;
525
+ }>;
411
526
  export type RemoveDatasetUpdaterAction = {
412
527
  dataId: string;
413
528
  };
@@ -882,6 +997,18 @@ export type SetPolygonFilterLayerUpdaterAction = {
882
997
  export declare function setPolygonFilterLayer(layer: Layer, feature: Feature): Merge<SetPolygonFilterLayerUpdaterAction, {
883
998
  type: typeof ActionTypes.SET_POLYGON_FILTER_LAYER;
884
999
  }>;
1000
+ export type SetPolygonFilterAllLayersUpdaterAction = {
1001
+ feature: Feature;
1002
+ };
1003
+ /**
1004
+ * Apply the provided feature as a polygon filter to all layers.
1005
+ * @memberof visStateActions
1006
+ * @param feature
1007
+ * @returns action
1008
+ */
1009
+ export declare function setPolygonFilterAllLayers(feature: Feature): Merge<SetPolygonFilterAllLayersUpdaterAction, {
1010
+ type: typeof ActionTypes.SET_POLYGON_FILTER_ALL_LAYERS;
1011
+ }>;
885
1012
  export type SetSelectedFeatureUpdaterAction = {
886
1013
  feature: Feature | null;
887
1014
  selectionContext?: FeatureSelectionContext;