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

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/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;
@@ -345,6 +355,8 @@ export type LayerVisConfigSettings = {
345
355
  angle: VisConfigNumber;
346
356
  worldUnitSize: VisConfigNumber;
347
357
  elevationScale: VisConfigNumber;
358
+ elevationOffset: VisConfigNumber;
359
+ elevationOffsetRange: VisConfigRange;
348
360
  enableElevationZoomFactor: VisConfigBoolean;
349
361
  elevationRange: VisConfigRange;
350
362
  heightRange: VisConfigRange;
@@ -359,6 +371,7 @@ export type LayerVisConfigSettings = {
359
371
  heatmapRadius: VisConfigNumber;
360
372
  darkBaseMapEnabled: VisConfigBoolean;
361
373
  fixedHeight: VisConfigBoolean;
374
+ fixedElevation: VisConfigBoolean;
362
375
  allowHover: VisConfigBoolean;
363
376
  showNeighborOnHover: VisConfigBoolean;
364
377
  showHighlightColor: VisConfigBoolean;
@@ -456,18 +469,20 @@ export type LayerCallbacks = {
456
469
  ) => void;
457
470
  onRedrawNeeded?: (idx: number) => void;
458
471
  onFitBounds?: (idx: number, bounds: [number, number, number, number]) => void;
472
+ onTilesetLoadError?: (idx: number, kind: 'token' | 'generic' | null) => void;
459
473
  };
460
474
 
461
475
  export type BindedLayerCallbacks = {
462
476
  onLayerHover?: (value: any) => void;
463
477
  onSetLayerDomain?: (value: any) => void;
464
478
  onFilteredItemsChange?: (event: {id: string; count: number}) => void;
465
- onWMSFeatureInfo?: (
466
- featureInfo: Array<{name: string; value: string}> | string | null,
467
- coordinate?: [number, number]
468
- ) => void;
479
+ onWMSFeatureInfo?: (props: {
480
+ featureInfo: Array<{name: string; value: string}> | string | null;
481
+ coordinate?: [number, number] | null;
482
+ }) => void;
469
483
  onRedrawNeeded?: () => void;
470
484
  onFitBounds?: (bounds: [number, number, number, number]) => void;
485
+ onTilesetLoadError?: (kind: 'token' | 'generic' | null) => void;
471
486
  };
472
487
 
473
488
  export type VisualChannelAggregation = 'colorAggregation' | 'sizeAggregation';
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.16",
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 {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';
@@ -269,6 +297,9 @@ export interface PlotType {
269
297
  aggregation: ValueOf<AggregationTypes>;
270
298
  defaultTimeFormat: string;
271
299
  colorsByDataId?: {[dataId: string]: string};
300
+ /** Categorical series split for the timeline line chart. */
301
+ groupBy?: PlotGroupBy | null;
302
+ yAxisAutoRange?: boolean;
272
303
  }
273
304
 
274
305
  export type Feature = {
@@ -405,21 +436,66 @@ export type Coordinate = BaseInteraction & {
405
436
  id: 'coordinate';
406
437
  position: number[] | null;
407
438
  };
439
+ export type AnnotationInteraction = BaseInteraction & {
440
+ id: 'annotation';
441
+ };
442
+ export type LegendInfo = BaseInteraction & {
443
+ id: 'legend';
444
+ config: {
445
+ hideInvisibleLayers: boolean;
446
+ };
447
+ };
448
+ /** Zoom stops for a fade envelope. Opacity is 0 outside [appear, gone]. */
449
+ export type ZoomOpacityStops = {
450
+ /** Zoom where opacity leaves 0. */
451
+ appear: number;
452
+ /** Zoom where opacity reaches the layer's full opacity. */
453
+ full: number;
454
+ /** Zoom where opacity starts falling. */
455
+ fade: number;
456
+ /** Zoom where opacity returns to 0. */
457
+ gone: number;
458
+ };
459
+ /** Layers that share one zoom envelope. */
460
+ export type ZoomOpacityController = {
461
+ id: string;
462
+ layerIds: string[];
463
+ stops: ZoomOpacityStops;
464
+ };
465
+ export type ZoomOpacityInteraction = BaseInteraction & {
466
+ id: 'zoomOpacity';
467
+ config: {
468
+ controllers: ZoomOpacityController[];
469
+ };
470
+ };
408
471
  export type InteractionConfig = {
409
472
  tooltip: TooltipInfo;
473
+ legend: LegendInfo;
410
474
  geocoder: Geocoder;
411
475
  brush: Brush;
412
476
  coordinate: Coordinate;
477
+ annotation: AnnotationInteraction;
478
+ zoomOpacity: ZoomOpacityInteraction;
413
479
  };
414
480
  export type MapInfo = {
415
481
  title: string;
416
482
  description: string;
417
483
  };
484
+ /** Options captured when a file load starts and forwarded to `addDataToMap`. */
485
+ export type FileLoadingOptions = {
486
+ autoCreateLayers?: boolean;
487
+ /** Parse the files, then wait for an explicit add instead of calling `addDataToMap`. */
488
+ deferAddToMap?: boolean;
489
+ };
490
+
418
491
  export type FileLoading = {
492
+ /** Identifies this load so a delayed finish from an older one can be ignored. */
493
+ loadId: number;
419
494
  filesToLoad: FileList | File[];
420
495
  companionFiles?: File[];
421
- onFinish: (payload: any) => any;
496
+ onFinish: (payload: any, options?: FileLoadingOptions) => any;
422
497
  fileCache: any[];
498
+ options?: FileLoadingOptions;
423
499
  };
424
500
  export type FileLoadingProgress = {
425
501
  [key: string]: {
@@ -499,6 +575,8 @@ export type ExportMap = {
499
575
  JSON: ExportJson;
500
576
  format: 'HTML' | 'JSON';
501
577
  fileName: string;
578
+ /** When false, dataset access tokens are omitted from exported HTML and JSON. */
579
+ includeLayerApiKeys: boolean;
502
580
  };
503
581
 
504
582
  export type ExportVideo = {
@@ -574,6 +652,8 @@ export type UiState = {
574
652
  activeSidePanel: string | null;
575
653
  currentModal: string | null;
576
654
  datasetKeyToRemove: string | null;
655
+ /** Dataset selected by the dataset-menu Replace action. Cleared when the modal closes. */
656
+ datasetToReplaceId: string | null;
577
657
  visibleDropdown: string | null;
578
658
  // export image modal ui
579
659
  exportImage: ExportImage;
package/schemas.d.ts CHANGED
@@ -45,6 +45,16 @@ export type SavedInteractionConfig = {
45
45
  coordinate: {
46
46
  enabled: boolean;
47
47
  };
48
+ annotation?: {
49
+ enabled: boolean;
50
+ };
51
+ legend?: {
52
+ enabled: boolean;
53
+ hideInvisibleLayers?: boolean;
54
+ };
55
+ zoomOpacity?: InteractionConfig['zoomOpacity']['config'] & {
56
+ enabled: boolean;
57
+ };
48
58
  };
49
59
 
50
60
  export type SavedScale = string;
@@ -67,6 +77,7 @@ export type SavedLayer = {
67
77
  isVisible: boolean;
68
78
  visConfig: Record<string, any>;
69
79
  hidden: boolean;
80
+ isIncludedInLegend?: boolean;
70
81
  textLabel: Merge<LayerTextLabel, {field: {name: string; type: string} | null}>;
71
82
  };
72
83
  visualChannels: SavedVisualChannels;
@@ -113,6 +124,8 @@ export type SavedVisState = {
113
124
  animationConfig: SavedAnimationConfig;
114
125
  editor?: SavedEditor;
115
126
  layerOrder?: any[];
127
+ groupBys?: any[];
128
+ joins?: any[];
116
129
  };
117
130
 
118
131
  // Min saved config can be passed to addDataToMap
@@ -140,6 +153,8 @@ export type ParsedVisState = {
140
153
  splitMaps?: SplitMap[];
141
154
  animationConfig?: Partial<SavedAnimationConfig>;
142
155
  layerOrder?: any[];
156
+ groupBys?: any[];
157
+ joins?: any[];
143
158
  };
144
159
 
145
160
  export type ParsedUiState = {