@kepler.gl/actions 3.3.0-alpha.6 → 3.3.0-alpha.7

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, AnnotationPropsPartial, SyncTimelineMode, AnimationConfig, FilterAnimationConfig, LayerOrder, LayerOrderGroup } from '@kepler.gl/types';
5
+ import { AddDataToMapPayload, ViewportPadding, 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;
@@ -625,8 +625,50 @@ export type SetColumnDisplayFormatUpdaterAction = {
625
625
  export declare function setColumnDisplayFormat(dataId: SetColumnDisplayFormatUpdaterAction['dataId'], formats: SetColumnDisplayFormatUpdaterAction['formats']): Merge<SetColumnDisplayFormatUpdaterAction, {
626
626
  type: typeof ActionTypes.SET_COLUMN_DISPLAY_FORMAT;
627
627
  }>;
628
+ export type LoadColumnStatsUpdaterAction = {
629
+ dataId: string;
630
+ fieldName: string | string[];
631
+ };
632
+ /**
633
+ * Lazily compute column statistics for the data table header.
634
+ * @param dataId
635
+ * @param fieldName one or more field names
636
+ * @returns action
637
+ * @public
638
+ */
639
+ export declare function loadColumnStats(dataId: string, fieldName: string | string[]): Merge<LoadColumnStatsUpdaterAction, {
640
+ type: typeof ActionTypes.LOAD_COLUMN_STATS;
641
+ }>;
642
+ export type LoadColumnStatsSuccessUpdaterAction = {
643
+ dataId: string;
644
+ fieldName: string;
645
+ result: any;
646
+ filterProps?: any;
647
+ };
648
+ /**
649
+ * Column statistics finished loading
650
+ * @returns action
651
+ * @public
652
+ */
653
+ export declare function loadColumnStatsSuccess(dataId: string, fieldName: string, result: any, filterProps?: any): Merge<LoadColumnStatsSuccessUpdaterAction, {
654
+ type: typeof ActionTypes.LOAD_COLUMN_STATS_SUCCESS;
655
+ }>;
656
+ export type LoadColumnStatsErrorUpdaterAction = {
657
+ dataId: string;
658
+ fieldName: string;
659
+ error: Error;
660
+ };
661
+ /**
662
+ * Column statistics failed to load
663
+ * @returns action
664
+ * @public
665
+ */
666
+ export declare function loadColumnStatsError(dataId: string, fieldName: string, error: Error): Merge<LoadColumnStatsErrorUpdaterAction, {
667
+ type: typeof ActionTypes.LOAD_COLUMN_STATS_ERROR;
668
+ }>;
628
669
  export type AddDataToMapUpdaterOptions = {
629
670
  centerMap?: boolean;
671
+ padding?: ViewportPadding;
630
672
  readOnly?: boolean;
631
673
  keepExistingConfig?: boolean;
632
674
  };
@@ -643,6 +685,8 @@ export type UpdateVisDataUpdaterAction = {
643
685
  * @param {object} options
644
686
  * @param options.centerMap `default: true` if `centerMap` is set to `true` kepler.gl will
645
687
  * place the map view within the data points boundaries
688
+ * @param options.padding padding in pixels applied when `centerMap` is true so data is not hidden
689
+ * under the side panel or other UI. Can be a number or `{top, bottom, left, right}`.
646
690
  * @param options.readOnly `default: false` if `readOnly` is set to `true`
647
691
  * the left setting panel will be hidden
648
692
  * @param config this object will contain the full kepler.gl instance configuration {mapState, mapStyle, visState}
@@ -973,6 +1017,21 @@ export declare function loadFilesErr(fileName: string, error: any): Merge<LoadFi
973
1017
  export type SetFeaturesUpdaterAction = {
974
1018
  features: Feature[];
975
1019
  };
1020
+ export type SetEditorFeaturePropertiesUpdaterAction = {
1021
+ feature: Feature;
1022
+ properties: Record<string, unknown>;
1023
+ };
1024
+ /**
1025
+ * Set user-facing GeoJSON properties on a Draw on Map sketch.
1026
+ * Editor-only keys such as `filterId` and `isClosed` are preserved.
1027
+ * @memberof visStateActions
1028
+ * @param feature
1029
+ * @param properties
1030
+ * @returns action
1031
+ */
1032
+ export declare function setEditorFeatureProperties(feature: Feature, properties: Record<string, unknown>): Merge<SetEditorFeaturePropertiesUpdaterAction, {
1033
+ type: typeof ActionTypes.SET_EDITOR_FEATURE_PROPERTIES;
1034
+ }>;
976
1035
  /**
977
1036
  * Store features to state
978
1037
  * @memberof visStateActions
@@ -1039,16 +1098,16 @@ export declare function deleteFeature(feature: Feature): Merge<DeleteFeatureUpda
1039
1098
  export type SetEditorModeUpdaterAction = {
1040
1099
  mode: string;
1041
1100
  };
1042
- /** Set the map mode
1101
+ /** Set the Draw on Map editor mode.
1043
1102
  * @memberof visStateActions
1044
- * @param mode one of EDITOR_MODES
1103
+ * @param mode one of `EDITOR_MODES`: `EDIT`, `DRAW_POINT`, `DRAW_LINESTRING`, `DRAW_POLYGON`, `DRAW_RECTANGLE`
1045
1104
  * @returns action
1046
1105
  * @public
1047
1106
  * @example
1048
- * import {setMapMode} from '@kepler.gl/actions';
1107
+ * import {setEditorMode} from '@kepler.gl/actions';
1049
1108
  * import {EDITOR_MODES} from '@kepler.gl/constants';
1050
1109
  *
1051
- * this.props.dispatch(setMapMode(EDITOR_MODES.DRAW_POLYGON));
1110
+ * this.props.dispatch(setEditorMode(EDITOR_MODES.DRAW_LINESTRING));
1052
1111
  */
1053
1112
  export declare function setEditorMode(mode: string): Merge<SetEditorModeUpdaterAction, {
1054
1113
  type: typeof ActionTypes.SET_EDITOR_MODE;
@@ -1075,6 +1134,22 @@ export type ToggleEditorVisibilityUpdaterAction = void;
1075
1134
  export declare function toggleEditorVisibility(): Merge<ToggleEditorVisibilityUpdaterAction, {
1076
1135
  type: typeof ActionTypes.TOGGLE_EDITOR_VISIBILITY;
1077
1136
  }>;
1137
+ export type ConvertEditorFeaturesToLayerUpdaterAction = void;
1138
+ /**
1139
+ * Convert editor sketch features into a GeoJSON dataset and layer, then clear the sketches.
1140
+ * The new dataset/layer is labeled `Drawn Geometry` plus a two-digit number.
1141
+ * No-ops when `enableDrawOnMapSketches` is false in application config.
1142
+ * @memberof visStateActions
1143
+ * @return action
1144
+ * @public
1145
+ * @example
1146
+ * import {convertEditorFeaturesToLayer} from '@kepler.gl/actions';
1147
+ *
1148
+ * this.props.dispatch(convertEditorFeaturesToLayer());
1149
+ */
1150
+ export declare function convertEditorFeaturesToLayer(): Merge<ConvertEditorFeaturesToLayerUpdaterAction, {
1151
+ type: typeof ActionTypes.CONVERT_EDITOR_FEATURES_TO_LAYER;
1152
+ }>;
1078
1153
  type FileContent = {
1079
1154
  fileName: string;
1080
1155
  header: string[];
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@kepler.gl/actions",
3
3
  "author": "Shan He <shan@uber.com>",
4
- "version": "3.3.0-alpha.6",
4
+ "version": "3.3.0-alpha.7",
5
5
  "description": "kepler.gl constants used by kepler.gl components, actions and reducers",
6
6
  "license": "MIT",
7
7
  "main": "dist/cjs/index.js",
@@ -29,18 +29,18 @@
29
29
  ],
30
30
  "dependencies": {
31
31
  "@deck.gl/core": "^9.3.1",
32
- "@kepler.gl/cloud-providers": "3.3.0-alpha.6",
33
- "@kepler.gl/constants": "3.3.0-alpha.6",
34
- "@kepler.gl/layers": "3.3.0-alpha.6",
35
- "@kepler.gl/processors": "3.3.0-alpha.6",
36
- "@kepler.gl/table": "3.3.0-alpha.6",
37
- "@kepler.gl/types": "3.3.0-alpha.6",
38
- "@kepler.gl/utils": "3.3.0-alpha.6",
32
+ "@kepler.gl/cloud-providers": "3.3.0-alpha.7",
33
+ "@kepler.gl/constants": "3.3.0-alpha.7",
34
+ "@kepler.gl/layers": "3.3.0-alpha.7",
35
+ "@kepler.gl/processors": "3.3.0-alpha.7",
36
+ "@kepler.gl/table": "3.3.0-alpha.7",
37
+ "@kepler.gl/types": "3.3.0-alpha.7",
38
+ "@kepler.gl/utils": "3.3.0-alpha.7",
39
39
  "@reduxjs/toolkit": "^1.7.2",
40
- "@types/lodash": "4.17.5",
40
+ "@types/lodash": "4.17.24",
41
41
  "@types/react-redux": "^7.1.23",
42
42
  "@types/redux-actions": "^2.6.2",
43
- "lodash": "4.17.23",
43
+ "lodash": "4.18.1",
44
44
  "react-palm": "^3.3.8",
45
45
  "react-redux": "^8.0.5",
46
46
  "redux": "^5.0.0",