@kepler.gl/types 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.
package/actions.d.ts CHANGED
@@ -31,6 +31,15 @@ export type ExportFileToCloudPayload = {
31
31
  /**
32
32
  * Input dataset parsed to addDataToMap
33
33
  */
34
+ export type ProtoDatasetField = {
35
+ name: string;
36
+ type: string;
37
+ format?: string;
38
+ displayName?: string;
39
+ analyzerType?: string;
40
+ id?: string;
41
+ metadata?: Record<string, any>;
42
+ };
34
43
  export type ProtoDataset = {
35
44
  info: {
36
45
  id?: string;
@@ -38,16 +47,10 @@ export type ProtoDataset = {
38
47
  format?: string;
39
48
  color?: RGBColor;
40
49
  type?: string;
50
+ hidden?: boolean;
41
51
  };
42
52
  data: {
43
- fields: {
44
- name: string;
45
- type?: string;
46
- format?: string;
47
- displayName?: string;
48
- analyzerType?: string;
49
- id?: string;
50
- }[];
53
+ fields: ProtoDatasetField[];
51
54
  rows: any[][];
52
55
  cols?: any[];
53
56
  };
package/layers.d.ts CHANGED
@@ -21,8 +21,45 @@ export type LayerBaseConfig = {
21
21
  };
22
22
  animation: {
23
23
  enabled: boolean;
24
- domain?: null;
24
+ domain?: [number, number] | null;
25
25
  };
26
+
27
+ columnMode?: string;
28
+ };
29
+
30
+ /**
31
+ * Used to configure geospatial data source columns like Longitude, Latitude, Geojson.
32
+ */
33
+ export type LayerColumn = {value: string | null; fieldIdx: number; optional?: boolean};
34
+ export type LayerConfigColumn = LayerColumn;
35
+
36
+ export type LayerColumns = {
37
+ [key: string]: LayerConfigColumn;
38
+ };
39
+
40
+ export type ColumnPair = {
41
+ pair: string | string[];
42
+ fieldPairKey: string | string[];
43
+ };
44
+
45
+ export type ColumnPairs = {[key: string]: ColumnPair};
46
+
47
+ export type ColumnLabels = {
48
+ [key: string]: string;
49
+ };
50
+
51
+ export type EnhancedFieldPair = {
52
+ name: string;
53
+ type: 'point';
54
+ pair: FieldPair['pair'];
55
+ };
56
+
57
+ export type SupportedColumnMode = {
58
+ key: string;
59
+ label: string;
60
+ requiredColumns: string[];
61
+ optionalColumns?: string[];
62
+ hasHelp?: boolean;
26
63
  };
27
64
 
28
65
  export type LayerColorConfig = {
@@ -61,23 +98,31 @@ export type LayerWeightConfig = {
61
98
  };
62
99
 
63
100
  export type Field = {
64
- analyzerType: string;
65
- id?: string;
66
101
  name: string;
67
102
  displayName: string;
68
- format: string;
69
103
  type: string;
70
104
  fieldIdx: number;
71
105
  valueAccessor(v: {index: number}): any;
72
- filterProps?: any;
73
- metadata?: any;
106
+ analyzerType?: string;
107
+ id?: string;
108
+ format: string;
109
+ filterProps?: FilterProps;
110
+ metadata?: Record<string, any>;
74
111
  displayFormat?: string;
75
112
  };
76
113
 
77
114
  export type FieldPair = {
78
115
  defaultName: string;
79
116
  pair: {
80
- [key: string]: {
117
+ lat: {
118
+ fieldIdx: number;
119
+ value: string;
120
+ };
121
+ lng: {
122
+ fieldIdx: number;
123
+ value: string;
124
+ };
125
+ altitude?: {
81
126
  fieldIdx: number;
82
127
  value: string;
83
128
  };
@@ -85,6 +130,8 @@ export type FieldPair = {
85
130
  suffix: string[];
86
131
  };
87
132
 
133
+ export type SizeRange = [number, number];
134
+
88
135
  export type LayerTextLabel = {
89
136
  field: Field | null;
90
137
  color: RGBColor;
@@ -105,12 +152,15 @@ export type ColorUI = {
105
152
  showSketcher: boolean | number;
106
153
  // show color range selection panel
107
154
  showDropdown: boolean | number;
155
+ // show color scale chart
156
+ showColorChart: boolean;
108
157
  // color range selector config
109
158
  colorRangeConfig: {
110
159
  type: string;
111
160
  steps: number;
112
161
  reversed: boolean;
113
162
  custom: boolean;
163
+ customBreaks: boolean;
114
164
  };
115
165
  };
116
166
 
@@ -142,7 +192,7 @@ export type VisConfigNumber = VisConfig & {
142
192
  type: 'number';
143
193
  isRanged: false;
144
194
  defaultValue: number;
145
- range: [number, number];
195
+ range: SizeRange;
146
196
  step: number;
147
197
  };
148
198
 
@@ -160,8 +210,8 @@ export type VisConfigSelection = VisConfig & {
160
210
  export type VisConfigRange = VisConfig & {
161
211
  type: 'number';
162
212
  isRanged: boolean;
163
- range: [number, number];
164
- defaultValue: [number, number];
213
+ range: SizeRange;
214
+ defaultValue: SizeRange;
165
215
  step: number;
166
216
  };
167
217
 
@@ -179,6 +229,8 @@ export type LayerVisConfigSettings = {
179
229
  thickness: VisConfigNumber;
180
230
  strokeWidthRange: VisConfigRange;
181
231
  trailLength: VisConfigNumber;
232
+ fadeTrail: VisConfigBoolean;
233
+ billboard: VisConfigBoolean;
182
234
  radius: VisConfigNumber;
183
235
  fixedRadius: VisConfigBoolean;
184
236
  radiusRange: VisConfigRange;
@@ -213,6 +265,10 @@ export type LayerVisConfigSettings = {
213
265
  weight: VisConfigNumber;
214
266
  heatmapRadius: VisConfigNumber;
215
267
  darkBaseMapEnabled: VisConfigBoolean;
268
+ fixedHeight: VisConfigBoolean;
269
+ allowHover: VisConfigBoolean;
270
+ showNeighborOnHover: VisConfigBoolean;
271
+ showHighlightColor: VisConfigBoolean;
216
272
  };
217
273
 
218
274
  // TODO: Move this to individual layers
@@ -262,6 +318,7 @@ export type TextConfigSelect = {
262
318
  multiSelect: boolean;
263
319
  searchable: boolean;
264
320
  };
321
+
265
322
  export type TextConfigNumber = {
266
323
  type: 'number';
267
324
  range: number[];
@@ -271,6 +328,7 @@ export type TextConfigNumber = {
271
328
  label: string;
272
329
  showInput: boolean;
273
330
  };
331
+
274
332
  export type LayerTextConfig = {
275
333
  fontSize: TextConfigNumber;
276
334
  outlineWidth: TextConfigNumber;
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.0.0",
4
+ "version": "3.1.0-alpha.1",
5
5
  "description": "kepler.gl types used by kepler.gl components, actions and reducers",
6
6
  "license": "MIT",
7
7
  "types": "index.d.ts",
@@ -25,15 +25,16 @@
25
25
  "sourceMap": false,
26
26
  "instrument": false
27
27
  },
28
- "engines": {
29
- "node": ">=18.18.2"
30
- },
31
28
  "maintainers": [
32
29
  "Shan He <heshan0131@gmail.com>",
33
30
  "Giuseppe Macri <gmacri@uber.com>"
34
31
  ],
32
+ "engines": {
33
+ "node": ">=18"
34
+ },
35
35
  "volta": {
36
36
  "node": "18.18.2",
37
- "yarn": "1.22.17"
38
- }
37
+ "yarn": "4.4.0"
38
+ },
39
+ "packageManager": "yarn@4.4.0"
39
40
  }
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 type {MapViewState} from '@deck.gl/core/typed';
5
6
 
6
7
  export type MapState = {
7
8
  pitch: number;
@@ -31,21 +32,14 @@ export type MapState = {
31
32
 
32
33
  export type Bounds = [number, number, number, number];
33
34
 
34
- export type HistogramBin = {
35
- x0: number | undefined;
36
- x1: number | undefined;
37
- count: number;
38
- };
39
-
40
35
  export type RangeFieldDomain = {
41
- domain: [number, number];
36
+ domain: number[];
42
37
  step: number;
43
- histogram: HistogramBin[];
44
- enlargedHistogram: HistogramBin[];
38
+ bins?: Bins;
45
39
  };
46
40
 
47
41
  export type SelectFieldDomain = {
48
- domain: [true, false];
42
+ domain: boolean[];
49
43
  };
50
44
  export type MultiSelectFieldDomain = {
51
45
  domain: string[];
@@ -54,8 +48,7 @@ export type MultiSelectFieldDomain = {
54
48
  export type TimeRangeFieldDomain = {
55
49
  domain: [number, number];
56
50
  step: number;
57
- histogram: HistogramBin[];
58
- enlargedHistogram: HistogramBin[];
51
+ timeBins?: TimeBins;
59
52
  mappedValue: (Millisecond | null)[];
60
53
  // auto generated based on time domain
61
54
  defaultTimeFormat?: string | null;
@@ -70,10 +63,22 @@ export type FieldDomain =
70
63
  | SelectFieldDomain
71
64
  | MultiSelectFieldDomain;
72
65
 
66
+ export interface LineDatum {
67
+ x: number;
68
+ y: number;
69
+ delta: string;
70
+ pct: number | null;
71
+ }
72
+
73
73
  export type LineChart = {
74
74
  series: {x: number; y: number}[];
75
- yDomain: [number, number];
76
- xDomain: [number, number];
75
+ yDomain: number[] | undefined[];
76
+ xDomain: number[];
77
+
78
+ // Is this a valid part of LineChart?
79
+ aggregation: string;
80
+ interval: string;
81
+ yAxis: string;
77
82
  };
78
83
 
79
84
  type FilterViewType = 'side' | 'enlarged' | 'minified';
@@ -83,8 +88,6 @@ export type FilterBase<L extends LineChart> = {
83
88
  id: string;
84
89
  enabled: boolean;
85
90
 
86
- freeze: boolean;
87
-
88
91
  // time range filter specific
89
92
  fixedDomain: boolean;
90
93
  view: FilterViewType;
@@ -102,7 +105,9 @@ export type FilterBase<L extends LineChart> = {
102
105
 
103
106
  // plot
104
107
  yAxis: Field | null;
105
- plotType: string;
108
+ plotType: {
109
+ [key: string]: any;
110
+ };
106
111
  lineChart?: L;
107
112
  // gpu filter
108
113
  gpu: boolean;
@@ -120,6 +125,9 @@ export type RangeFilter = FilterBase<LineChart> &
120
125
  value: [number, number];
121
126
  fixedDomain: true;
122
127
  typeOptions: ['range'];
128
+ plotType: {
129
+ [key: string]: any;
130
+ };
123
131
  };
124
132
 
125
133
  export type SelectFilter = FilterBase<LineChart> &
@@ -136,17 +144,21 @@ export type MultiSelectFilter = FilterBase<LineChart> &
136
144
  value: string[];
137
145
  };
138
146
 
147
+ export type SyncTimelineMode = 0 | 1;
148
+
139
149
  export type TimeRangeFilter = FilterBase<LineChart> &
140
150
  TimeRangeFieldDomain & {
141
151
  type: 'timeRange';
142
152
  fieldType: 'timestamp';
143
- fixedDomain: true;
153
+ fixedDomain: boolean;
144
154
  value: [number, number];
145
- bins?: Object;
146
155
  plotType: {
147
156
  [key: string]: any;
148
157
  };
158
+ syncedWithLayerTimeline: boolean;
159
+ syncTimelineMode: SyncTimelineMode;
149
160
  animationWindow: string;
161
+ invertTrendColor: boolean;
150
162
  };
151
163
 
152
164
  export type PolygonFilter = FilterBase<LineChart> & {
@@ -164,6 +176,31 @@ export type Filter =
164
176
  | MultiSelectFilter
165
177
  | PolygonFilter;
166
178
 
179
+ export interface Bin {
180
+ count: number;
181
+ indexes: number[];
182
+ x0: number;
183
+ x1: number;
184
+ }
185
+
186
+ export interface Bins {
187
+ [dataId: string]: Bin[];
188
+ }
189
+
190
+ export interface TimeBins {
191
+ [dataId: string]: {
192
+ [interval: string]: Bin[];
193
+ };
194
+ }
195
+
196
+ export interface PlotType {
197
+ interval: ValueOf<Interval>;
198
+ type: ValueOf<PlotTypes>;
199
+ aggregation: ValueOf<AggregationTypes>;
200
+ defaultTimeFormat: string;
201
+ colorsByDataId?: {[dataId: string]: string};
202
+ }
203
+
167
204
  export type Feature = {
168
205
  id: string;
169
206
  properties: any;
@@ -206,12 +243,12 @@ export type SplitMap = {
206
243
  export type AnimationConfigTimeFormat = 'L' | 'L LT' | 'L LTS';
207
244
 
208
245
  export type AnimationConfig = {
209
- domain: number[] | null;
246
+ domain: [number, number] | null;
210
247
  currentTime: number | null;
211
248
  speed: number;
212
249
  duration?: number | null;
213
250
  isAnimating?: boolean;
214
- timeSteps?: null | number[];
251
+ timeSteps: number[] | null;
215
252
  // auto generated based on time domain
216
253
  defaultTimeFormat: AnimationTimeFormat | null;
217
254
  // custom ui input
@@ -310,7 +347,7 @@ export type BaseMapStyle = {
310
347
  label: string;
311
348
  url: string;
312
349
  icon: string;
313
- style?: Object;
350
+ style?: object;
314
351
  layerGroups: LayerGroup[];
315
352
  accessToken?: string;
316
353
  custom?: CustomStyleType;
@@ -363,14 +400,18 @@ export type MapControlItem = {
363
400
  disableClose?: boolean;
364
401
  activeMapIndex?: number;
365
402
  };
403
+ export type MapControlMapLegend = MapControlItem & {
404
+ disableEdit?: boolean;
405
+ };
366
406
  export type MapControls = {
367
407
  visibleLayers?: MapControlItem;
368
- mapLegend?: MapControlItem;
408
+ mapLegend?: MapControlMapLegend;
369
409
  toggle3d?: MapControlItem;
370
410
  splitMap?: MapControlItem;
371
411
  mapDraw?: MapControlItem;
372
412
  mapLocale?: MapControlItem;
373
413
  effect?: MapControlItem;
414
+ aiAssistant?: MapControlItem;
374
415
  };
375
416
 
376
417
  export type LoadFiles = {
@@ -442,6 +483,10 @@ export type Viewport = {
442
483
  maxZoom?: number;
443
484
  /** Maximum geographical bounds, pan/zoom operations are constrained within those bounds */
444
485
  maxBounds?: Bounds;
486
+ /** viewport transition duration use by geocoder panel **/
487
+ transitionDuration?: MapViewState['transitionDuration'];
488
+ /** viewport transition duration use by geocoder panel **/
489
+ transitionInterpolator?: MapViewState['transitionInterpolator'];
445
490
  };
446
491
 
447
492
  export type MapStyles = {
@@ -512,11 +557,11 @@ export type TypedTimeRangeFilter = FilterBaseOmitRedudant &
512
557
  fieldType: 'timestamp';
513
558
  fixedDomain: true;
514
559
  value: [number, number];
515
- bins?: Object;
516
560
  plotType: {
517
561
  [key: string]: any;
518
562
  };
519
563
  animationWindow: string;
564
+ invertTrendColor: boolean;
520
565
  };
521
566
 
522
567
  export type TypedPolygonFilter = FilterBaseOmitRedudant & {
package/schemas.d.ts CHANGED
@@ -1,16 +1,9 @@
1
1
  // SPDX-License-Identifier: MIT
2
2
  // Copyright contributors to the kepler.gl project
3
3
 
4
- import {RGBColor, Merge, RGBAColor, RequireFrom} from './types';
4
+ import {RGBColor, Merge, RequireFrom} from './types';
5
5
 
6
- import {
7
- Filter,
8
- TooltipInfo,
9
- InteractionConfig,
10
- AnimationConfig,
11
- SplitMap,
12
- Feature
13
- } from './reducers';
6
+ import {Filter, TooltipInfo, AnimationConfig, SplitMap, Feature} from './reducers';
14
7
 
15
8
  import {LayerTextLabel} from './layers';
16
9
 
@@ -30,6 +23,8 @@ export type SavedFilter = {
30
23
  } | null;
31
24
  speed: Filter['speed'];
32
25
  layerId: Filter['layerId'];
26
+ syncedWithLayerTimeline: Filter['syncedWithLayerTimeline'];
27
+ syncTimelineMode: Filter['syncTimelineMode'];
33
28
  };
34
29
  export type MinSavedFilter = RequireFrom<SavedFilter, 'dataId' | 'id' | 'name' | 'type' | 'value'>;
35
30
  export type ParsedFilter = SavedFilter | MinSavedFilter;
@@ -69,6 +64,7 @@ export type SavedLayer = {
69
64
  visConfig: Record<string, any>;
70
65
  hidden: boolean;
71
66
  textLabel: Merge<LayerTextLabel, {field: {name: string; type: string} | null}>;
67
+ columnMode: string;
72
68
  };
73
69
  visualChannels: SavedVisualChannels;
74
70
  };