@kepler.gl/types 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.
package/actions.d.ts CHANGED
@@ -2,6 +2,7 @@
2
2
  // Copyright contributors to the kepler.gl project
3
3
 
4
4
  import {SavedMap, ParsedConfig, SavedConfigV1, MinSavedConfigV1} from './schemas';
5
+ import type {LayerVisConfig} from './layers';
5
6
 
6
7
  /** EXPORT_FILE_TO_CLOUD */
7
8
  export type MapData = {
@@ -69,6 +70,7 @@ export type AddDataToMapOptions = {
69
70
  keepExistingConfig?: boolean;
70
71
  autoCreateLayers?: boolean;
71
72
  autoCreateTooltips?: boolean;
73
+ layerVisConfig?: Partial<LayerVisConfig>;
72
74
  };
73
75
 
74
76
  export type AddDataToMapPayload = {
@@ -0,0 +1,50 @@
1
+ // SPDX-License-Identifier: MIT
2
+ // Copyright contributors to the kepler.gl project
3
+
4
+ import {AnnotationKind} from '@kepler.gl/constants';
5
+
6
+ export {AnnotationKind} from '@kepler.gl/constants';
7
+ export {isAnnotationKind, isAnnotationWithArm} from '@kepler.gl/constants';
8
+
9
+ export type BaseAnnotation = {
10
+ id: string;
11
+ kind: AnnotationKind;
12
+ isVisible: boolean;
13
+ autoSize: boolean;
14
+ autoSizeY: boolean;
15
+ anchorPoint: [number, number];
16
+ label: string;
17
+ editorState?: Record<string, any>;
18
+ mapIndex?: number;
19
+ lineColor: string;
20
+ lineWidth: number;
21
+ textWidth: number;
22
+ textHeight: number;
23
+ textVerticalAlign?: 'top' | 'middle' | 'bottom';
24
+ };
25
+
26
+ export type AnnotationWithArm = BaseAnnotation & {
27
+ armLength: number;
28
+ angle: number;
29
+ };
30
+
31
+ export type TextAnnotation = BaseAnnotation & {
32
+ kind: AnnotationKind.TEXT;
33
+ };
34
+
35
+ export type PointAnnotation = AnnotationWithArm & {
36
+ kind: AnnotationKind.POINT;
37
+ };
38
+
39
+ export type ArrowAnnotation = AnnotationWithArm & {
40
+ kind: AnnotationKind.ARROW;
41
+ };
42
+
43
+ export type CircleAnnotation = AnnotationWithArm & {
44
+ kind: AnnotationKind.CIRCLE;
45
+ radiusInMeters: number;
46
+ };
47
+
48
+ export type Annotation = TextAnnotation | PointAnnotation | ArrowAnnotation | CircleAnnotation;
49
+
50
+ export type AnnotationPropsPartial = Partial<Annotation>;
package/datasets.d.ts CHANGED
@@ -9,11 +9,6 @@ export type DomainStops = {
9
9
  interpolation: 'interpolate';
10
10
  };
11
11
 
12
- export type ZoomStopsConfig = {
13
- enabled?: boolean;
14
- stops: ZoomStops | null;
15
- };
16
-
17
12
  export type DatasetAttribution = {
18
13
  title: string;
19
14
  url: string | null;
package/effects.d.ts CHANGED
@@ -3,16 +3,18 @@
3
3
 
4
4
  type EffectParameterDescription = {
5
5
  name: string;
6
- type?: 'number' | 'array' | 'color';
6
+ type?: 'number' | 'array' | 'color' | 'checkbox';
7
7
  label?: string | false | (string | false)[];
8
+ tooltip?: string;
8
9
  min: number;
9
10
  max: number;
10
- defaultValue?: number | number[];
11
+ defaultValue?: number | number[] | boolean;
11
12
  };
12
13
 
13
14
  export type EffectDescription = {
14
15
  type: string;
15
16
  name: string;
17
+ description?: string;
16
18
  parameters: EffectParameterDescription[];
17
19
  };
18
20
 
package/index.d.ts CHANGED
@@ -8,6 +8,7 @@ export * from './schemas';
8
8
  export * from './types';
9
9
  export * from './components';
10
10
  export * from './effects';
11
+ export * from './annotations';
11
12
  export * from './datasets';
12
13
 
13
14
  export * as StacTypes from './stac';
package/layers.d.ts CHANGED
@@ -27,7 +27,7 @@ export type LayerBaseConfig = {
27
27
  };
28
28
 
29
29
  // for aggregate layer, aggregatedBins is returned for custom color scale
30
- aggregatedBins?: AggregatedBin[];
30
+ aggregatedBins?: Record<number, AggregatedBin>;
31
31
 
32
32
  columnMode?: string;
33
33
  heightField?: VisualChannelField;
@@ -162,12 +162,13 @@ export type LayerTextLabel = {
162
162
  color: RGBColor;
163
163
  background: boolean;
164
164
  size: number;
165
+ weight: number;
165
166
  offset: [number, number];
166
167
  anchor: string;
167
168
  alignment: string;
168
169
  outlineWidth: number;
169
170
  outlineColor: RGBAColor;
170
- backgroundColor: RGBAColor;
171
+ backgroundColor: RGBAColor | null;
171
172
  };
172
173
 
173
174
  export type ColorRangeConfig = {
@@ -243,6 +244,8 @@ export type VisConfigNumber = VisConfig & {
243
244
  defaultValue: number;
244
245
  range: SizeRange;
245
246
  step: number;
247
+ focusRange?: [number, number];
248
+ focusWeight?: number;
246
249
  };
247
250
 
248
251
  export type VisConfigBoolean = VisConfig & {
@@ -341,6 +344,12 @@ export type LayerVisConfigSettings = {
341
344
  allowHover: VisConfigBoolean;
342
345
  showNeighborOnHover: VisConfigBoolean;
343
346
  showHighlightColor: VisConfigBoolean;
347
+ scenegraph: VisConfigInput;
348
+ scenegraphEnabled: VisConfigBoolean;
349
+ scenegraphCustomModelUrl: VisConfigInput;
350
+ scenegraphColorEnabled: VisConfigBoolean;
351
+ scenegraphUseTrailColor: VisConfigBoolean;
352
+ scenegraphColor: VisConfigColorSelect;
344
353
  [key: string]: LayerVisConfigTypes;
345
354
  };
346
355
 
@@ -404,6 +413,7 @@ export type TextConfigNumber = {
404
413
 
405
414
  export type LayerTextConfig = {
406
415
  fontSize: TextConfigNumber;
416
+ fontWeight: TextConfigNumber;
407
417
  outlineWidth: TextConfigNumber;
408
418
  textAnchor: TextConfigSelect;
409
419
  textAlignment: TextConfigSelect;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@kepler.gl/types",
3
3
  "author": "Shan He <shan@uber.com>",
4
- "version": "3.3.0-alpha.0",
4
+ "version": "3.3.0-alpha.2",
5
5
  "description": "kepler.gl types used by kepler.gl components, actions and reducers",
6
6
  "license": "MIT",
7
7
  "types": "index.d.ts",
@@ -27,13 +27,15 @@
27
27
  },
28
28
  "maintainers": [
29
29
  "Shan He <heshan0131@gmail.com>",
30
- "Giuseppe Macri <gmacri@uber.com>"
30
+ "Giuseppe Macri <gmacri@uber.com>",
31
+ "Igor Dykhta <dikhta.igor@gmail.com>",
32
+ "Xun Li <lixun910@gmail.com>"
31
33
  ],
32
34
  "engines": {
33
- "node": ">=18"
35
+ "node": ">=20"
34
36
  },
35
37
  "volta": {
36
- "node": "18.18.2",
38
+ "node": "20.19.3",
37
39
  "yarn": "4.4.0"
38
40
  },
39
41
  "packageManager": "yarn@4.4.0"
package/reducers.d.ts CHANGED
@@ -2,6 +2,7 @@
2
2
  // Copyright contributors to the kepler.gl project
3
3
 
4
4
  import {Field, Millisecond} from './types';
5
+ import {MapSplitMode} from '@kepler.gl/constants';
5
6
  type MapViewState = {
6
7
  latitude: number;
7
8
  longitude: number;
@@ -24,6 +25,7 @@ export type MapState = {
24
25
  height: number;
25
26
  minZoom?: number;
26
27
  maxZoom?: number;
28
+ maxPitch?: number;
27
29
  maxBounds?: Bounds;
28
30
  initialState?: any;
29
31
  scale?: number;
@@ -37,6 +39,10 @@ export type MapState = {
37
39
  isZoomLocked: boolean;
38
40
  /** An array of either 0 or 2 Viewport objects (index 0 for left map; index 1 for right map) */
39
41
  splitMapViewports: Viewport[];
42
+ /** The current split map mode (single, dual, swipe) */
43
+ mapSplitMode: MapSplitMode;
44
+ /** Swipe compare divider position as a percentage (0-100) */
45
+ swipeComparePercentage: number;
40
46
  };
41
47
 
42
48
  export type Bounds = [number, number, number, number];
@@ -249,6 +255,20 @@ export type SplitMap = {
249
255
  layers: SplitMapLayers;
250
256
  };
251
257
 
258
+ export type LayerOrderGroup = {
259
+ id: string;
260
+ label: string;
261
+ isVisible: boolean;
262
+ layerOrder: LayerOrder;
263
+ isIncludedInLegend: boolean;
264
+ };
265
+
266
+ export type LayerOrderEntry = string | LayerOrderGroup;
267
+ export type LayerOrder = LayerOrderEntry[];
268
+ export type FlatLayerOrder = string[];
269
+ export type LayerOrderHierarchyEntry = ['layer', any] | ['layerGroup', LayerOrderGroup];
270
+ export type LayerOrderHierarchy = LayerOrderHierarchyEntry[];
271
+
252
272
  /** See "Locale aware formats" at https://momentjs.com/docs/#/parsing/string-format/ */
253
273
  export type AnimationConfigTimeFormat = 'L' | 'L LT' | 'L LTS';
254
274
 
@@ -317,6 +337,9 @@ export type TooltipInfo = BaseInteraction & {
317
337
  export type Geocoder = BaseInteraction & {
318
338
  id: 'geocoder';
319
339
  position: number[] | null;
340
+ config: {
341
+ limitSearch: boolean;
342
+ };
320
343
  };
321
344
  export type Brush = BaseInteraction & {
322
345
  id: 'brush';
@@ -419,6 +442,17 @@ export type ExportMap = {
419
442
  format: 'HTML' | 'JSON';
420
443
  };
421
444
 
445
+ export type ExportVideo = {
446
+ mediaType: string;
447
+ cameraPreset: string;
448
+ fileName: string;
449
+ resolution: string;
450
+ durationMs: number;
451
+ swipeStartPct: number;
452
+ swipeEndPct: number;
453
+ swipeEasing: 'linear' | 'ease-in-out';
454
+ };
455
+
422
456
  export type MapControlItem = {
423
457
  show: boolean;
424
458
  active: boolean;
@@ -448,6 +482,7 @@ export type MapControls = {
448
482
  mapDraw?: MapControlItem;
449
483
  mapLocale?: MapControlItem;
450
484
  effect?: MapControlItem;
485
+ annotation?: MapControlItem;
451
486
  aiAssistant?: MapControlItem;
452
487
  };
453
488
 
@@ -480,6 +515,8 @@ export type UiState = {
480
515
  exportData: ExportData;
481
516
  // html export
482
517
  exportMap: ExportMap;
518
+ // export video modal ui
519
+ exportVideo: ExportVideo;
483
520
  // map control panels
484
521
  mapControls: MapControls;
485
522
  // ui notifications
@@ -520,6 +557,8 @@ export type Viewport = {
520
557
  minZoom?: number;
521
558
  /** Maximum allowed viewport zoom */
522
559
  maxZoom?: number;
560
+ /** Maximum pitch angle in degrees */
561
+ maxPitch?: number;
523
562
  /** Maximum geographical bounds, pan/zoom operations are constrained within those bounds */
524
563
  maxBounds?: Bounds;
525
564
  /** viewport transition duration use by geocoder panel **/
package/schemas.d.ts CHANGED
@@ -35,6 +35,7 @@ export type SavedInteractionConfig = {
35
35
  };
36
36
  geocoder: {
37
37
  enabled: boolean;
38
+ limitSearch?: boolean;
38
39
  };
39
40
  brush: InteractionConfig['brush']['config'] & {
40
41
  enabled: boolean;
@@ -106,6 +107,7 @@ export type SavedVisState = {
106
107
  splitMaps: SplitMap[];
107
108
  animationConfig: SavedAnimationConfig;
108
109
  editor?: SavedEditor;
110
+ layerOrder?: any[];
109
111
  };
110
112
 
111
113
  // Min saved config can be passed to addDataToMap
@@ -131,18 +133,25 @@ export type ParsedVisState = {
131
133
  overlayBlending?: string;
132
134
  splitMaps?: SplitMap[];
133
135
  animationConfig?: Partial<SavedAnimationConfig>;
136
+ layerOrder?: any[];
134
137
  };
135
138
 
136
139
  export type ParsedUiState = {
137
- mapControls: {
138
- mapLegend: {
139
- active: boolean;
140
- settings: {
141
- position: string;
142
- contentHeight: number;
140
+ mapControls?: {
141
+ mapLegend?: {
142
+ active?: boolean;
143
+ settings?: {
144
+ position?: {
145
+ x: number;
146
+ y: number;
147
+ anchorX: 'left' | 'right';
148
+ anchorY: 'top' | 'bottom';
149
+ };
150
+ contentHeight?: number;
143
151
  };
144
152
  };
145
153
  };
154
+ locale?: string;
146
155
  };
147
156
 
148
157
  export type SavedMapState = {
package/stac.d.ts CHANGED
@@ -49,6 +49,7 @@ export type FullWidthHalfMaxFWHM = number;
49
49
  export interface Fields {
50
50
  'eo:cloud_cover'?: CloudCover;
51
51
  'eo:bands'?: Bands;
52
+ bands?: CoreBand[];
52
53
  /**
53
54
  * This interface was referenced by `Fields`'s JSON-Schema definition
54
55
  * via the `patternProperty` "^(?!eo:)".
@@ -57,6 +58,7 @@ export interface Fields {
57
58
  }
58
59
  export interface Band {
59
60
  name?: NameOfTheBand;
61
+ description?: string;
60
62
  common_name?: CommonNameOfTheBand;
61
63
  center_wavelength?: CenterWavelength;
62
64
  full_width_half_max?: FullWidthHalfMaxFWHM;
@@ -111,7 +113,7 @@ export type GeoJSONGeometry =
111
113
  | GeoJSONMultiPoint2
112
114
  | GeoJSONMultiLineString2
113
115
  | GeoJSONMultiPolygon2;
114
- export type STACVersion = '1.0.0';
116
+ export type STACVersion = '1.0.0' | '1.1.0' | string;
115
117
  export type ReferenceToAJSONSchema = string;
116
118
  export type STACExtensions = ReferenceToAJSONSchema[];
117
119
  /**
@@ -429,7 +431,7 @@ export interface ProviderFields {
429
431
  * This object represents Collections in a SpatioTemporal Asset Catalog.
430
432
  */
431
433
  export type STACCollectionSpecification = STACCollection;
432
- export type STACVersion = '1.0.0';
434
+ export type STACVersion = '1.0.0' | '1.1.0' | string;
433
435
  export type ReferenceToAJSONSchema = string;
434
436
  export type STACExtensions = ReferenceToAJSONSchema[];
435
437
  export type TypeOfSTACEntity = 'Collection';
@@ -770,6 +772,7 @@ export type NumberOfPixelsInTheBucket = number;
770
772
 
771
773
  export interface Assetfields {
772
774
  'raster:bands'?: Bands;
775
+ bands?: CoreBand[];
773
776
  /**
774
777
  * This interface was referenced by `Assetfields`'s JSON-Schema definition
775
778
  * via the `patternProperty` "^(?!raster:)".
@@ -809,18 +812,42 @@ export interface StacExtensions {
809
812
  [k: string]: unknown;
810
813
  }
811
814
 
815
+ /**
816
+ * STAC 1.1.0 Core Band Object.
817
+ * Merges spectral (formerly eo:bands) and data-value (formerly raster:bands) fields
818
+ * into a single band object in common metadata.
819
+ */
820
+ export interface CoreBand {
821
+ name?: string;
822
+ description?: string;
823
+ 'eo:common_name'?: CommonNameOfTheBand;
824
+ 'eo:center_wavelength'?: number;
825
+ 'eo:full_width_half_max'?: number;
826
+ data_type?: DataTypeOfTheBand;
827
+ nodata?: NoDataPixelValue;
828
+ unit?: string;
829
+ bits_per_sample?: number;
830
+ sampling?: PixelSamplingInTheBand;
831
+ scale?: number;
832
+ offset?: number;
833
+ spatial_resolution?: number;
834
+ statistics?: Statistics;
835
+ histogram?: Histogram;
836
+ [k: string]: unknown;
837
+ }
838
+
812
839
  /**
813
840
  * STAC Item or Collection
814
841
  */
815
842
  export type STACObject = STACItem | STACCollection;
816
843
 
817
844
  /**
818
- * STAC Item including our required extensions: EO and Raster
845
+ * STAC Item including required extensions: EO and Raster (1.0.x) or core bands (1.1.0+)
819
846
  */
820
847
  export type CompleteSTACItem = STACItem & EOExtension & RasterExtension;
821
848
 
822
849
  /**
823
- * STAC Collection including our required extensions: Item Assets, EO, and Raster
850
+ * STAC Collection including required extensions (1.0.x) or core bands (1.1.0+)
824
851
  */
825
852
  export type CompleteSTACCollection = STACCollection &
826
853
  ItemAssetsDefinitionExtension &