@kepler.gl/actions 3.3.0-alpha.12 → 3.3.0-alpha.14

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,5 +1,5 @@
1
1
  import { default as ActionTypes } from './action-types';
2
- import { Bounds, Merge, Viewport, ViewportPadding } from '@kepler.gl/types';
2
+ import { Bounds, MapState, Merge, Viewport, ViewportPadding } from '@kepler.gl/types';
3
3
  import { MapSplitMode, MapViewMode, GlobeConfig } from '@kepler.gl/constants';
4
4
  export type TogglePerspectiveUpdaterAction = void;
5
5
  /**
@@ -61,6 +61,23 @@ export type UpdateMapUpdaterAction = {
61
61
  export declare const updateMap: (viewport: Viewport, mapIndex?: number) => Merge<UpdateMapUpdaterAction, {
62
62
  type: typeof ActionTypes.UPDATE_MAP;
63
63
  }>;
64
+ export type ApplyMapStateUpdaterAction = {
65
+ payload: Partial<MapState>;
66
+ meta?: {
67
+ mapIndex?: number;
68
+ };
69
+ };
70
+ /**
71
+ * Apply a partial map state, as used by the viewport JSON editor.
72
+ * Width and height of the current viewport are preserved.
73
+ * @memberof mapStateActions
74
+ * @param mapState - Partial map state from saved JSON
75
+ * @param mapIndex - Split-map pane to apply camera fields to when viewports are unsynced
76
+ * @public
77
+ */
78
+ export declare const applyMapState: (mapState: Partial<MapState>, mapIndex?: number) => Merge<ApplyMapStateUpdaterAction, {
79
+ type: typeof ActionTypes.APPLY_MAP_STATE;
80
+ }>;
64
81
  export type ToggleSplitMapUpdaterAction = {
65
82
  payload: number;
66
83
  };
@@ -161,7 +161,7 @@ export type SetExportImageSettingUpdaterAction = {
161
161
  payload: Partial<ExportImage>;
162
162
  };
163
163
  /**
164
- * Set `exportImage` settings: ratio, resolution, legend
164
+ * Set `exportImage` settings: ratio, resolution, legend, charts
165
165
  * @memberof uiStateActions
166
166
  * @param newSetting - {ratio: '1x'}
167
167
  * @public
@@ -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, ViewportPadding, ValueOf, Merge, PickInfo, RGBColor, NestedPartial, LayerVisConfig, ColorUI, Feature, FeatureSelectionContext, InteractionConfig, Filter, ParsedConfig, ParsedLayer, EffectPropsPartial, AnnotationPropsPartial, SyncTimelineMode, AnimationConfig, FilterAnimationConfig, LayerOrder, LayerOrderGroup, ProtoDataset } 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, ProtoDataset, ChartConfig } from '@kepler.gl/types';
6
6
  export type ApplyLayerConfigUpdaterAction = {
7
7
  oldLayerId: string;
8
8
  newLayerConfig: ParsedLayer;
@@ -454,6 +454,47 @@ export type UpdateEffectUpdaterAction = {
454
454
  export declare function updateEffect(id: string, props: EffectPropsPartial): Merge<UpdateEffectUpdaterAction, {
455
455
  type: typeof ActionTypes.UPDATE_EFFECT;
456
456
  }>;
457
+ export type AddChartUpdaterAction = {
458
+ chart: ChartConfig;
459
+ };
460
+ /**
461
+ * Add a chart to the charts panel
462
+ * @memberof visStateActions
463
+ * @param chart - chart config
464
+ * @returns action
465
+ * @public
466
+ */
467
+ export declare function addChart(chart: ChartConfig): Merge<AddChartUpdaterAction, {
468
+ type: typeof ActionTypes.ADD_CHART;
469
+ }>;
470
+ export type UpdateChartUpdaterAction = {
471
+ id: string;
472
+ props: Partial<ChartConfig>;
473
+ };
474
+ /**
475
+ * Update a chart
476
+ * @memberof visStateActions
477
+ * @param id - chart id
478
+ * @param props - partial chart config
479
+ * @returns action
480
+ * @public
481
+ */
482
+ export declare function updateChart(id: string, props: Partial<ChartConfig>): Merge<UpdateChartUpdaterAction, {
483
+ type: typeof ActionTypes.UPDATE_CHART;
484
+ }>;
485
+ export type RemoveChartUpdaterAction = {
486
+ id: string;
487
+ };
488
+ /**
489
+ * Remove a chart
490
+ * @memberof visStateActions
491
+ * @param id - chart id
492
+ * @returns action
493
+ * @public
494
+ */
495
+ export declare function removeChart(id: string): Merge<RemoveChartUpdaterAction, {
496
+ type: typeof ActionTypes.REMOVE_CHART;
497
+ }>;
457
498
  export type AddAnnotationUpdaterAction = {
458
499
  config?: AnnotationPropsPartial;
459
500
  };
@@ -1291,6 +1332,26 @@ export type ConvertEditorFeaturesToLayerUpdaterAction = void;
1291
1332
  export declare function convertEditorFeaturesToLayer(): Merge<ConvertEditorFeaturesToLayerUpdaterAction, {
1292
1333
  type: typeof ActionTypes.CONVERT_EDITOR_FEATURES_TO_LAYER;
1293
1334
  }>;
1335
+ export type ExtractDataFromFeatureUpdaterAction = {
1336
+ layerId: string;
1337
+ };
1338
+ /**
1339
+ * Copy in-memory rows that fall inside the currently selected Draw on Map polygon
1340
+ * into a new local dataset. Vector tile layers extract a snapshot of features
1341
+ * already loaded in the current view. No-ops for raster/WMS/3D/bitmap tiles,
1342
+ * unsupported layer types, and non-polygon drawings.
1343
+ * @memberof visStateActions
1344
+ * @param layerId Layer whose dataset should be extracted
1345
+ * @return action
1346
+ * @public
1347
+ * @example
1348
+ * import {extractDataFromFeature} from '@kepler.gl/actions';
1349
+ *
1350
+ * this.props.dispatch(extractDataFromFeature({layerId: 'point-layer-id'}));
1351
+ */
1352
+ export declare function extractDataFromFeature({ layerId }: ExtractDataFromFeatureUpdaterAction): Merge<ExtractDataFromFeatureUpdaterAction, {
1353
+ type: typeof ActionTypes.EXTRACT_DATA_FROM_FEATURE;
1354
+ }>;
1294
1355
  type FileContent = {
1295
1356
  fileName: string;
1296
1357
  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.12",
4
+ "version": "3.3.0-alpha.14",
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,13 +29,13 @@
29
29
  ],
30
30
  "dependencies": {
31
31
  "@deck.gl/core": "^9.3.1",
32
- "@kepler.gl/cloud-providers": "3.3.0-alpha.12",
33
- "@kepler.gl/constants": "3.3.0-alpha.12",
34
- "@kepler.gl/layers": "3.3.0-alpha.12",
35
- "@kepler.gl/processors": "3.3.0-alpha.12",
36
- "@kepler.gl/table": "3.3.0-alpha.12",
37
- "@kepler.gl/types": "3.3.0-alpha.12",
38
- "@kepler.gl/utils": "3.3.0-alpha.12",
32
+ "@kepler.gl/cloud-providers": "3.3.0-alpha.14",
33
+ "@kepler.gl/constants": "3.3.0-alpha.14",
34
+ "@kepler.gl/layers": "3.3.0-alpha.14",
35
+ "@kepler.gl/processors": "3.3.0-alpha.14",
36
+ "@kepler.gl/table": "3.3.0-alpha.14",
37
+ "@kepler.gl/types": "3.3.0-alpha.14",
38
+ "@kepler.gl/utils": "3.3.0-alpha.14",
39
39
  "@reduxjs/toolkit": "^1.7.2",
40
40
  "@types/react-redux": "^7.1.23",
41
41
  "@types/redux-actions": "^2.6.2",