@kepler.gl/types 3.3.0-alpha.15 → 3.3.0-alpha.17

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
@@ -14,6 +14,8 @@ export type ExportFileOptions = {
14
14
  isPublic?: boolean;
15
15
  overwrite?: boolean;
16
16
  mapIdToOverwrite?: string | null;
17
+ /** Download name, without extension. Separate from the map title. */
18
+ fileName?: string;
17
19
  };
18
20
  export type OnErrorCallBack = (error: Error) => any;
19
21
  export type OnSuccessCallBack = (p: {
package/charts.d.ts CHANGED
@@ -51,6 +51,7 @@ export type BaseChartConfig = {
51
51
  pinned?: boolean;
52
52
  display: {
53
53
  isConfigActive?: boolean;
54
+ isJsonEditorActive?: boolean;
54
55
  };
55
56
  crossFilter?: ChartCrossFilter;
56
57
  };
package/layers.d.ts CHANGED
@@ -13,6 +13,8 @@ export type LayerBaseConfig = {
13
13
  isConfigActive: boolean;
14
14
  highlightColor: RGBColor | RGBAColor;
15
15
  hidden: boolean;
16
+ /** Omit from the map legend when false. Missing or true keeps the layer in the legend. */
17
+ isIncludedInLegend?: boolean;
16
18
 
17
19
  visConfig: LayerVisConfig;
18
20
  textLabel: LayerTextLabel[];
@@ -33,6 +35,9 @@ export type LayerBaseConfig = {
33
35
  heightField?: VisualChannelField;
34
36
  heightDomain?: VisualChannelDomain;
35
37
  heightScale?: string;
38
+ elevationOffsetField?: VisualChannelField;
39
+ elevationOffsetDomain?: VisualChannelDomain;
40
+ elevationOffsetScale?: string;
36
41
  };
37
42
 
38
43
  /**
@@ -102,6 +107,11 @@ export type LayerHeightConfig = {
102
107
  heightDomain: VisualChannelDomain;
103
108
  heightScale: VisualChannelScale;
104
109
  };
110
+ export type LayerElevationOffsetConfig = {
111
+ elevationOffsetField: VisualChannelField;
112
+ elevationOffsetDomain: VisualChannelDomain;
113
+ elevationOffsetScale: VisualChannelScale;
114
+ };
105
115
  export type LayerStrokeColorConfig = {
106
116
  strokeColorField: VisualChannelField;
107
117
  strokeColorDomain: VisualChannelDomain;
@@ -329,6 +339,7 @@ export type LayerVisConfigSettings = {
329
339
  radiusRange: VisConfigRange;
330
340
  clusterRadius: VisConfigNumber;
331
341
  clusterRadiusRange: VisConfigRange;
342
+ minClusterSize: VisConfigNumber;
332
343
  opacity: VisConfigNumber;
333
344
  coverage: VisConfigNumber;
334
345
  outline: VisConfigBoolean;
@@ -345,6 +356,8 @@ export type LayerVisConfigSettings = {
345
356
  angle: VisConfigNumber;
346
357
  worldUnitSize: VisConfigNumber;
347
358
  elevationScale: VisConfigNumber;
359
+ elevationOffset: VisConfigNumber;
360
+ elevationOffsetRange: VisConfigRange;
348
361
  enableElevationZoomFactor: VisConfigBoolean;
349
362
  elevationRange: VisConfigRange;
350
363
  heightRange: VisConfigRange;
@@ -359,6 +372,8 @@ export type LayerVisConfigSettings = {
359
372
  heatmapRadius: VisConfigNumber;
360
373
  darkBaseMapEnabled: VisConfigBoolean;
361
374
  fixedHeight: VisConfigBoolean;
375
+ invertHeight: VisConfigBoolean;
376
+ fixedElevation: VisConfigBoolean;
362
377
  allowHover: VisConfigBoolean;
363
378
  showNeighborOnHover: VisConfigBoolean;
364
379
  showHighlightColor: VisConfigBoolean;
@@ -456,18 +471,20 @@ export type LayerCallbacks = {
456
471
  ) => void;
457
472
  onRedrawNeeded?: (idx: number) => void;
458
473
  onFitBounds?: (idx: number, bounds: [number, number, number, number]) => void;
474
+ onTilesetLoadError?: (idx: number, kind: 'token' | 'generic' | null) => void;
459
475
  };
460
476
 
461
477
  export type BindedLayerCallbacks = {
462
478
  onLayerHover?: (value: any) => void;
463
479
  onSetLayerDomain?: (value: any) => void;
464
480
  onFilteredItemsChange?: (event: {id: string; count: number}) => void;
465
- onWMSFeatureInfo?: (
466
- featureInfo: Array<{name: string; value: string}> | string | null,
467
- coordinate?: [number, number]
468
- ) => void;
481
+ onWMSFeatureInfo?: (props: {
482
+ featureInfo: Array<{name: string; value: string}> | string | null;
483
+ coordinate?: [number, number] | null;
484
+ }) => void;
469
485
  onRedrawNeeded?: () => void;
470
486
  onFitBounds?: (bounds: [number, number, number, number]) => void;
487
+ onTilesetLoadError?: (kind: 'token' | 'generic' | null) => void;
471
488
  };
472
489
 
473
490
  export type VisualChannelAggregation = 'colorAggregation' | 'sizeAggregation';
@@ -503,6 +520,8 @@ export type VisualChannel = {
503
520
 
504
521
  // TODO: define fixed
505
522
  fixed?: any;
523
+ // visConfig key that reverses this channel's scale output (e.g. invertHeight)
524
+ invert?: string;
506
525
 
507
526
  supportedFieldTypes?: Array<SupportedFieldTypes>;
508
527
 
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.15",
4
+ "version": "3.3.0-alpha.17",
5
5
  "description": "kepler.gl types used by kepler.gl components, actions and reducers",
6
6
  "license": "MIT",
7
7
  "types": "index.d.ts",
@@ -35,7 +35,7 @@
35
35
  "node": ">=20"
36
36
  },
37
37
  "volta": {
38
- "node": "20.19.3",
38
+ "node": "24.21.0",
39
39
  "yarn": "4.4.0"
40
40
  },
41
41
  "packageManager": "yarn@4.4.0"
package/reducers.d.ts CHANGED
@@ -1,7 +1,8 @@
1
1
  // SPDX-License-Identifier: MIT
2
2
  // Copyright contributors to the kepler.gl project
3
3
 
4
- import {Field, Millisecond} from './types';
4
+ import {Field, Millisecond, RGBColor} from './types';
5
+ import {ColorMap, ColorRange, ColorUI} from './layers';
5
6
  import {MapSplitMode, MapViewMode} from '@kepler.gl/constants';
6
7
  type MapViewState = {
7
8
  latitude: number;
@@ -125,8 +126,33 @@ export interface LineDatum {
125
126
  pct: number | null;
126
127
  }
127
128
 
129
+ export type LineChartSeries = {
130
+ lines: LineDatum[][];
131
+ markers: LineDatum[];
132
+ /** Stroke color for each line segment. Segments from one group share a color. */
133
+ colors?: string[];
134
+ /** Series name for each line segment. */
135
+ names?: string[];
136
+ };
137
+
138
+ export type LineChartGroupBy = {
139
+ fieldName: string;
140
+ numGroups: number | 'ALL';
141
+ groupOthers: boolean;
142
+ colors: string[] | null;
143
+ colorMap?: ColorMap | null;
144
+ };
145
+
146
+ export type PlotGroupBy = {
147
+ fieldName?: string;
148
+ numGroups: number | 'ALL';
149
+ groupOthers: boolean;
150
+ colorRange?: ColorRange;
151
+ colorUI?: ColorUI;
152
+ };
153
+
128
154
  export type LineChart = {
129
- series: {x: number; y: number}[];
155
+ series: {x: number; y: number}[] | LineChartSeries;
130
156
  yDomain: number[] | undefined[];
131
157
  xDomain: number[];
132
158
 
@@ -135,6 +161,8 @@ export type LineChart = {
135
161
  interval: string;
136
162
  yAxis: string;
137
163
  bins?: Bins;
164
+ /** Cache key for timeline series grouping. Null when the plot is a single series. */
165
+ groupBy?: LineChartGroupBy | null;
138
166
  };
139
167
 
140
168
  type FilterViewType = 'side' | 'enlarged' | 'minified';
@@ -143,6 +171,11 @@ export type FilterBase<L extends LineChart> = {
143
171
  dataId: string[];
144
172
  id: string;
145
173
  enabled: boolean;
174
+ /**
175
+ * When true, rows that match the filter are hidden and the rest are kept.
176
+ * Undefined is treated as false so older saved maps stay unchanged.
177
+ */
178
+ inverted?: boolean;
146
179
 
147
180
  // time range filter specific
148
181
  fixedDomain: boolean;
@@ -269,6 +302,9 @@ export interface PlotType {
269
302
  aggregation: ValueOf<AggregationTypes>;
270
303
  defaultTimeFormat: string;
271
304
  colorsByDataId?: {[dataId: string]: string};
305
+ /** Categorical series split for the timeline line chart. */
306
+ groupBy?: PlotGroupBy | null;
307
+ yAxisAutoRange?: boolean;
272
308
  }
273
309
 
274
310
  export type Feature = {
@@ -384,6 +420,7 @@ export type TooltipInfo = BaseInteraction & {
384
420
  fieldsToShow: {
385
421
  [key: string]: TooltipField[];
386
422
  };
423
+ timezone?: string | null;
387
424
  compareMode: boolean;
388
425
  compareType: CompareType;
389
426
  };
@@ -393,6 +430,7 @@ export type Geocoder = BaseInteraction & {
393
430
  position: number[] | null;
394
431
  config: {
395
432
  limitSearch: boolean;
433
+ color: RGBColor;
396
434
  };
397
435
  };
398
436
  export type Brush = BaseInteraction & {
@@ -405,21 +443,66 @@ export type Coordinate = BaseInteraction & {
405
443
  id: 'coordinate';
406
444
  position: number[] | null;
407
445
  };
446
+ export type AnnotationInteraction = BaseInteraction & {
447
+ id: 'annotation';
448
+ };
449
+ export type LegendInfo = BaseInteraction & {
450
+ id: 'legend';
451
+ config: {
452
+ hideInvisibleLayers: boolean;
453
+ };
454
+ };
455
+ /** Zoom stops for a fade envelope. Opacity is 0 outside [appear, gone]. */
456
+ export type ZoomOpacityStops = {
457
+ /** Zoom where opacity leaves 0. */
458
+ appear: number;
459
+ /** Zoom where opacity reaches the layer's full opacity. */
460
+ full: number;
461
+ /** Zoom where opacity starts falling. */
462
+ fade: number;
463
+ /** Zoom where opacity returns to 0. */
464
+ gone: number;
465
+ };
466
+ /** Layers and reserved map targets that share one zoom envelope. */
467
+ export type ZoomOpacityController = {
468
+ id: string;
469
+ layerIds: string[];
470
+ stops: ZoomOpacityStops;
471
+ };
472
+ export type ZoomOpacityInteraction = BaseInteraction & {
473
+ id: 'zoomOpacity';
474
+ config: {
475
+ controllers: ZoomOpacityController[];
476
+ };
477
+ };
408
478
  export type InteractionConfig = {
409
479
  tooltip: TooltipInfo;
480
+ legend: LegendInfo;
410
481
  geocoder: Geocoder;
411
482
  brush: Brush;
412
483
  coordinate: Coordinate;
484
+ annotation: AnnotationInteraction;
485
+ zoomOpacity: ZoomOpacityInteraction;
413
486
  };
414
487
  export type MapInfo = {
415
- title: string;
416
- description: string;
488
+ title?: string;
489
+ description?: string;
417
490
  };
491
+ /** Options captured when a file load starts and forwarded to `addDataToMap`. */
492
+ export type FileLoadingOptions = {
493
+ autoCreateLayers?: boolean;
494
+ /** Parse the files, then wait for an explicit add instead of calling `addDataToMap`. */
495
+ deferAddToMap?: boolean;
496
+ };
497
+
418
498
  export type FileLoading = {
499
+ /** Identifies this load so a delayed finish from an older one can be ignored. */
500
+ loadId: number;
419
501
  filesToLoad: FileList | File[];
420
502
  companionFiles?: File[];
421
- onFinish: (payload: any) => any;
503
+ onFinish: (payload: any, options?: FileLoadingOptions) => any;
422
504
  fileCache: any[];
505
+ options?: FileLoadingOptions;
423
506
  };
424
507
  export type FileLoadingProgress = {
425
508
  [key: string]: {
@@ -463,6 +546,8 @@ export declare type ExportImage = {
463
546
  legend: boolean;
464
547
  /** When true, include the charts panel in the exported image. */
465
548
  charts: boolean;
549
+ /** When true, omit the basemap and preserve transparent pixels in the exported image. */
550
+ transparentBackground?: boolean;
466
551
  mapH: number;
467
552
  mapW: number;
468
553
  imageSize: {
@@ -499,6 +584,12 @@ export type ExportMap = {
499
584
  JSON: ExportJson;
500
585
  format: 'HTML' | 'JSON';
501
586
  fileName: string;
587
+ /** When false, dataset access tokens are omitted from exported HTML and JSON. */
588
+ includeLayerApiKeys: boolean;
589
+ /** Optional application name override for exported HTML and JSON. */
590
+ appName?: string;
591
+ /** Optional application website override for exported HTML and JSON. */
592
+ appWebsite?: string;
502
593
  };
503
594
 
504
595
  export type ExportVideo = {
@@ -545,6 +636,7 @@ export type MapControls = {
545
636
  annotation?: MapControlItem;
546
637
  chart?: MapControlItem;
547
638
  viewportJson?: MapControlItem;
639
+ mapInfo?: MapControlItem;
548
640
  sqlPanel?: MapControlItem;
549
641
  aiAssistant?: MapControlItem;
550
642
  [key: string]: MapControlItem | MapControlMapLegend | undefined;
@@ -574,6 +666,8 @@ export type UiState = {
574
666
  activeSidePanel: string | null;
575
667
  currentModal: string | null;
576
668
  datasetKeyToRemove: string | null;
669
+ /** Dataset selected by the dataset-menu Replace action. Cleared when the modal closes. */
670
+ datasetToReplaceId: string | null;
577
671
  visibleDropdown: string | null;
578
672
  // export image modal ui
579
673
  exportImage: ExportImage;
package/schemas.d.ts CHANGED
@@ -27,6 +27,8 @@ export type SavedFilter = {
27
27
  layerId: Filter['layerId'];
28
28
  syncedWithLayerTimeline: Filter['syncedWithLayerTimeline'];
29
29
  syncTimelineMode: Filter['syncTimelineMode'];
30
+ /** Hide rows that match the filter instead of keeping them. */
31
+ inverted?: boolean;
30
32
  };
31
33
  export type MinSavedFilter = RequireFrom<SavedFilter, 'dataId' | 'id' | 'name' | 'type' | 'value'>;
32
34
  export type ParsedFilter = SavedFilter | MinSavedFilter;
@@ -38,6 +40,7 @@ export type SavedInteractionConfig = {
38
40
  geocoder: {
39
41
  enabled: boolean;
40
42
  limitSearch?: boolean;
43
+ color?: RGBColor;
41
44
  };
42
45
  brush: InteractionConfig['brush']['config'] & {
43
46
  enabled: boolean;
@@ -45,6 +48,16 @@ export type SavedInteractionConfig = {
45
48
  coordinate: {
46
49
  enabled: boolean;
47
50
  };
51
+ annotation?: {
52
+ enabled: boolean;
53
+ };
54
+ legend?: {
55
+ enabled: boolean;
56
+ hideInvisibleLayers?: boolean;
57
+ };
58
+ zoomOpacity?: InteractionConfig['zoomOpacity']['config'] & {
59
+ enabled: boolean;
60
+ };
48
61
  };
49
62
 
50
63
  export type SavedScale = string;
@@ -67,6 +80,7 @@ export type SavedLayer = {
67
80
  isVisible: boolean;
68
81
  visConfig: Record<string, any>;
69
82
  hidden: boolean;
83
+ isIncludedInLegend?: boolean;
70
84
  textLabel: Merge<LayerTextLabel, {field: {name: string; type: string} | null}>;
71
85
  };
72
86
  visualChannels: SavedVisualChannels;
@@ -113,6 +127,8 @@ export type SavedVisState = {
113
127
  animationConfig: SavedAnimationConfig;
114
128
  editor?: SavedEditor;
115
129
  layerOrder?: any[];
130
+ groupBys?: any[];
131
+ joins?: any[];
116
132
  };
117
133
 
118
134
  // Min saved config can be passed to addDataToMap
@@ -140,6 +156,8 @@ export type ParsedVisState = {
140
156
  splitMaps?: SplitMap[];
141
157
  animationConfig?: Partial<SavedAnimationConfig>;
142
158
  layerOrder?: any[];
159
+ groupBys?: any[];
160
+ joins?: any[];
143
161
  };
144
162
 
145
163
  export type ParsedUiState = {
@@ -159,6 +177,10 @@ export type ParsedUiState = {
159
177
  chart?: {
160
178
  active?: boolean;
161
179
  };
180
+ mapInfo?: {
181
+ active?: boolean;
182
+ show?: boolean;
183
+ };
162
184
  };
163
185
  locale?: string;
164
186
  theme?: string;
@@ -274,9 +296,19 @@ export type SavedMap = {
274
296
  info: {
275
297
  app: string;
276
298
  created_at: string;
277
- title: string;
278
- description: string;
299
+ title?: string;
300
+ description?: string;
301
+ source?: string;
302
+ appName?: string;
303
+ appWebsite?: string;
279
304
  };
280
305
  };
281
306
 
282
- export type LoadedMap = {datasets?: ParsedDataset[] | null; config?: ParsedConfig | null};
307
+ export type LoadedMap = {
308
+ datasets?: ParsedDataset[] | null;
309
+ config?: ParsedConfig | null;
310
+ info?: {
311
+ title?: string;
312
+ description?: string;
313
+ };
314
+ };