@kepler.gl/types 3.3.0-alpha.1 → 3.3.0-alpha.11

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
@@ -3,6 +3,7 @@
3
3
 
4
4
  import {SavedMap, ParsedConfig, SavedConfigV1, MinSavedConfigV1} from './schemas';
5
5
  import type {LayerVisConfig} from './layers';
6
+ import type {ViewportPadding} from './reducers';
6
7
 
7
8
  /** EXPORT_FILE_TO_CLOUD */
8
9
  export type MapData = {
@@ -66,6 +67,12 @@ export type ProtoDataset = {
66
67
 
67
68
  export type AddDataToMapOptions = {
68
69
  centerMap?: boolean;
70
+ /**
71
+ * Padding in pixels applied when `centerMap` is true.
72
+ * Use this so a few points are not hidden under the side panel or other UI.
73
+ * A number applies the same padding on all sides.
74
+ */
75
+ padding?: ViewportPadding;
69
76
  readOnly?: boolean;
70
77
  keepExistingConfig?: boolean;
71
78
  autoCreateLayers?: boolean;
package/annotations.d.ts CHANGED
@@ -1,7 +1,11 @@
1
1
  // SPDX-License-Identifier: MIT
2
2
  // Copyright contributors to the kepler.gl project
3
3
 
4
- import {AnnotationKind} from '@kepler.gl/constants';
4
+ import {
5
+ AnnotationKind,
6
+ AnnotationTextSide,
7
+ AnnotationTextVerticalPosition
8
+ } from '@kepler.gl/constants';
5
9
 
6
10
  export {AnnotationKind} from '@kepler.gl/constants';
7
11
  export {isAnnotationKind, isAnnotationWithArm} from '@kepler.gl/constants';
@@ -21,6 +25,8 @@ export type BaseAnnotation = {
21
25
  textWidth: number;
22
26
  textHeight: number;
23
27
  textVerticalAlign?: 'top' | 'middle' | 'bottom';
28
+ textSide?: AnnotationTextSide;
29
+ textVerticalPosition?: AnnotationTextVerticalPosition;
24
30
  };
25
31
 
26
32
  export type AnnotationWithArm = BaseAnnotation & {
package/components.d.ts CHANGED
@@ -26,6 +26,7 @@ export type ColMetaProps = {
26
26
  format?: string;
27
27
  columnStats?: any;
28
28
  displayFormat?: string;
29
+ isLoadingStats?: boolean;
29
30
  };
30
31
 
31
32
  export type ColMeta = {
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/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.1",
4
+ "version": "3.3.0-alpha.11",
5
5
  "description": "kepler.gl types used by kepler.gl components, actions and reducers",
6
6
  "license": "MIT",
7
7
  "types": "index.d.ts",
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, MapViewMode} from '@kepler.gl/constants';
5
6
  type MapViewState = {
6
7
  latitude: number;
7
8
  longitude: number;
@@ -28,6 +29,8 @@ export type MapState = {
28
29
  maxBounds?: Bounds;
29
30
  initialState?: any;
30
31
  scale?: number;
32
+ /** Layer rendering parameters forwarded from visState for use during layer construction in globe mode. */
33
+ layerParameters?: Record<string, string | boolean>;
31
34
 
32
35
  // the following 4 properties assist with split viewports that can optionally have (un)synced viewports and zooms
33
36
  /** Is the application split into 2 maps? */
@@ -38,10 +41,52 @@ export type MapState = {
38
41
  isZoomLocked: boolean;
39
42
  /** An array of either 0 or 2 Viewport objects (index 0 for left map; index 1 for right map) */
40
43
  splitMapViewports: Viewport[];
44
+ mapViewMode?: MapViewMode;
45
+ globe?: {
46
+ enabled: boolean;
47
+ config: {
48
+ atmosphere: boolean;
49
+ hugeHalo: boolean;
50
+ hugeHaloRadius: number;
51
+ hugeHaloOpacity: number;
52
+ azimuth: boolean;
53
+ azimuthAngle: number;
54
+ terminator: boolean;
55
+ terminatorOpacity: number;
56
+ basemap: boolean;
57
+ labels: boolean;
58
+ labelsColor: [number, number, number];
59
+ adminLines: boolean;
60
+ adminLinesColor: [number, number, number];
61
+ water: boolean;
62
+ waterColor: [number, number, number];
63
+ surfaceColor: [number, number, number];
64
+ surface: boolean;
65
+ backgroundColor: [number, number, number];
66
+ stars: boolean;
67
+ };
68
+ };
69
+ /** The current split map mode (single, dual, swipe) */
70
+ mapSplitMode: MapSplitMode;
71
+ /** Swipe compare divider position as a percentage (0-100) */
72
+ swipeComparePercentage: number;
41
73
  };
42
74
 
43
75
  export type Bounds = [number, number, number, number];
44
76
 
77
+ /**
78
+ * Padding in pixels used when fitting the map viewport to bounds.
79
+ * A number applies the same padding on all sides.
80
+ */
81
+ export type ViewportPadding =
82
+ | number
83
+ | {
84
+ top?: number;
85
+ bottom?: number;
86
+ left?: number;
87
+ right?: number;
88
+ };
89
+
45
90
  export type RangeFieldDomain = {
46
91
  domain: number[];
47
92
  step: number;
@@ -123,8 +168,14 @@ export type FilterBase<L extends LineChart> = {
123
168
  // gpu filter
124
169
  gpu: boolean;
125
170
  gpuChannel?: number[];
171
+ gpuEndChannel?: number[];
126
172
  fieldType?: string;
127
173
 
174
+ // Optional end timestamp for duration-based time filters (parallel to name/fieldIdx)
175
+ endName?: (string | null | undefined)[];
176
+ endFieldIdx?: (number | null | undefined)[];
177
+ endMappedValue?: ((number | null)[] | null | undefined)[];
178
+
128
179
  // polygon
129
180
  layerId?: string[];
130
181
  };
@@ -170,6 +221,14 @@ export type TimeRangeFilter = FilterBase<LineChart> &
170
221
  syncTimelineMode: SyncTimelineMode;
171
222
  animationWindow: string;
172
223
  invertTrendColor: boolean;
224
+ /**
225
+ * When set, a feature is visible while the playback window overlaps
226
+ * [startField, endField] rather than requiring a single timestamp in range.
227
+ */
228
+ endName?: (string | null | undefined)[];
229
+ endFieldIdx?: (number | null | undefined)[];
230
+ endMappedValue?: ((number | null)[] | null | undefined)[];
231
+ gpuEndChannel?: number[];
173
232
  };
174
233
 
175
234
  export type PolygonFilter = FilterBase<LineChart> & {
@@ -250,6 +309,20 @@ export type SplitMap = {
250
309
  layers: SplitMapLayers;
251
310
  };
252
311
 
312
+ export type LayerOrderGroup = {
313
+ id: string;
314
+ label: string;
315
+ isVisible: boolean;
316
+ layerOrder: LayerOrder;
317
+ isIncludedInLegend: boolean;
318
+ };
319
+
320
+ export type LayerOrderEntry = string | LayerOrderGroup;
321
+ export type LayerOrder = LayerOrderEntry[];
322
+ export type FlatLayerOrder = string[];
323
+ export type LayerOrderHierarchyEntry = ['layer', any] | ['layerGroup', LayerOrderGroup];
324
+ export type LayerOrderHierarchy = LayerOrderHierarchyEntry[];
325
+
253
326
  /** See "Locale aware formats" at https://momentjs.com/docs/#/parsing/string-format/ */
254
327
  export type AnimationConfigTimeFormat = 'L' | 'L LT' | 'L LTS';
255
328
 
@@ -429,6 +502,9 @@ export type ExportVideo = {
429
502
  fileName: string;
430
503
  resolution: string;
431
504
  durationMs: number;
505
+ swipeStartPct: number;
506
+ swipeEndPct: number;
507
+ swipeEasing: 'linear' | 'ease-in-out';
432
508
  };
433
509
 
434
510
  export type MapControlItem = {
@@ -459,9 +535,12 @@ export type MapControls = {
459
535
  splitMap?: MapControlItem;
460
536
  mapDraw?: MapControlItem;
461
537
  mapLocale?: MapControlItem;
538
+ mapTheme?: MapControlItem;
462
539
  effect?: MapControlItem;
463
540
  annotation?: MapControlItem;
541
+ sqlPanel?: MapControlItem;
464
542
  aiAssistant?: MapControlItem;
543
+ [key: string]: MapControlItem | MapControlMapLegend | undefined;
465
544
  };
466
545
 
467
546
  export type LoadFiles = {
@@ -479,6 +558,8 @@ export type Notifications = {
479
558
 
480
559
  export type Locale = string;
481
560
 
561
+ export type UiTheme = string;
562
+
482
563
  export type PanelListView = string;
483
564
 
484
565
  export type UiState = {
@@ -503,6 +584,8 @@ export type UiState = {
503
584
  loadFiles: LoadFiles;
504
585
  // Locale of the UI
505
586
  locale: Locale;
587
+ // Theme of the UI (`light` | `dark`), used when enableThemeToggle is on
588
+ theme: UiTheme;
506
589
  // view layers by list or dataset
507
590
  layerPanelListView: PanelListView;
508
591
  // view filters by list or dataset
package/schemas.d.ts CHANGED
@@ -11,6 +11,7 @@ export type SavedFilter = {
11
11
  dataId: Filter['dataId'];
12
12
  id: Filter['id'];
13
13
  name: Filter['name'];
14
+ endName?: Filter['endName'];
14
15
  type: Filter['type'];
15
16
  value: Filter['value'];
16
17
  // deprecated
@@ -107,6 +108,7 @@ export type SavedVisState = {
107
108
  splitMaps: SplitMap[];
108
109
  animationConfig: SavedAnimationConfig;
109
110
  editor?: SavedEditor;
111
+ layerOrder?: any[];
110
112
  };
111
113
 
112
114
  // Min saved config can be passed to addDataToMap
@@ -132,6 +134,7 @@ export type ParsedVisState = {
132
134
  overlayBlending?: string;
133
135
  splitMaps?: SplitMap[];
134
136
  animationConfig?: Partial<SavedAnimationConfig>;
137
+ layerOrder?: any[];
135
138
  };
136
139
 
137
140
  export type ParsedUiState = {
@@ -150,6 +153,7 @@ export type ParsedUiState = {
150
153
  };
151
154
  };
152
155
  locale?: string;
156
+ theme?: string;
153
157
  };
154
158
 
155
159
  export type SavedMapState = {