@kepler.gl/types 3.3.0-alpha.2 → 3.3.0-alpha.20
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 +27 -0
- package/annotations.d.ts +25 -3
- package/camera.d.ts +28 -0
- package/charts.d.ts +87 -0
- package/components.d.ts +1 -0
- package/index.d.ts +2 -0
- package/layers.d.ts +55 -4
- package/package.json +2 -2
- package/reducers.d.ts +180 -19
- package/schemas.d.ts +68 -5
- package/types.d.ts +4 -0
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 = {
|
|
@@ -13,6 +14,8 @@ export type ExportFileOptions = {
|
|
|
13
14
|
isPublic?: boolean;
|
|
14
15
|
overwrite?: boolean;
|
|
15
16
|
mapIdToOverwrite?: string | null;
|
|
17
|
+
/** Download name, without extension. Separate from the map title. */
|
|
18
|
+
fileName?: string;
|
|
16
19
|
};
|
|
17
20
|
export type OnErrorCallBack = (error: Error) => any;
|
|
18
21
|
export type OnSuccessCallBack = (p: {
|
|
@@ -42,6 +45,20 @@ export type ProtoDatasetField = {
|
|
|
42
45
|
id?: string;
|
|
43
46
|
metadata?: Record<string, any>;
|
|
44
47
|
};
|
|
48
|
+
|
|
49
|
+
export type GeoArrowBinaryData = Record<
|
|
50
|
+
number,
|
|
51
|
+
Record<
|
|
52
|
+
number,
|
|
53
|
+
{
|
|
54
|
+
binaryGeometries: any[];
|
|
55
|
+
bounds: [number, number, number, number];
|
|
56
|
+
featureTypes: {point: boolean; line: boolean; polygon: boolean};
|
|
57
|
+
meanCenters?: Array<number[] | null>;
|
|
58
|
+
}
|
|
59
|
+
>
|
|
60
|
+
>;
|
|
61
|
+
|
|
45
62
|
export type ProtoDataset = {
|
|
46
63
|
info: {
|
|
47
64
|
id?: string;
|
|
@@ -56,6 +73,10 @@ export type ProtoDataset = {
|
|
|
56
73
|
rows: any[][];
|
|
57
74
|
cols?: any[];
|
|
58
75
|
arrowTable?: arrow.Table;
|
|
76
|
+
/** GeoArrow chunks already converted to deck.gl binary features on workers. */
|
|
77
|
+
geoArrowBinaryData?: GeoArrowBinaryData;
|
|
78
|
+
/** Existing table in the configured DuckDB database; avoids re-importing its rows. */
|
|
79
|
+
duckdbTableName?: string;
|
|
59
80
|
};
|
|
60
81
|
|
|
61
82
|
// table-injected metadata
|
|
@@ -66,6 +87,12 @@ export type ProtoDataset = {
|
|
|
66
87
|
|
|
67
88
|
export type AddDataToMapOptions = {
|
|
68
89
|
centerMap?: boolean;
|
|
90
|
+
/**
|
|
91
|
+
* Padding in pixels applied when `centerMap` is true.
|
|
92
|
+
* Use this so a few points are not hidden under the side panel or other UI.
|
|
93
|
+
* A number applies the same padding on all sides.
|
|
94
|
+
*/
|
|
95
|
+
padding?: ViewportPadding;
|
|
69
96
|
readOnly?: boolean;
|
|
70
97
|
keepExistingConfig?: boolean;
|
|
71
98
|
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 {
|
|
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';
|
|
@@ -12,7 +16,8 @@ export type BaseAnnotation = {
|
|
|
12
16
|
isVisible: boolean;
|
|
13
17
|
autoSize: boolean;
|
|
14
18
|
autoSizeY: boolean;
|
|
15
|
-
|
|
19
|
+
/** [lng, lat] or [lng, lat, altitudeMeters]. Missing altitude is treated as 0. */
|
|
20
|
+
anchorPoint: [number, number] | [number, number, number];
|
|
16
21
|
label: string;
|
|
17
22
|
editorState?: Record<string, any>;
|
|
18
23
|
mapIndex?: number;
|
|
@@ -21,6 +26,8 @@ export type BaseAnnotation = {
|
|
|
21
26
|
textWidth: number;
|
|
22
27
|
textHeight: number;
|
|
23
28
|
textVerticalAlign?: 'top' | 'middle' | 'bottom';
|
|
29
|
+
textSide?: AnnotationTextSide;
|
|
30
|
+
textVerticalPosition?: AnnotationTextVerticalPosition;
|
|
24
31
|
};
|
|
25
32
|
|
|
26
33
|
export type AnnotationWithArm = BaseAnnotation & {
|
|
@@ -45,6 +52,21 @@ export type CircleAnnotation = AnnotationWithArm & {
|
|
|
45
52
|
radiusInMeters: number;
|
|
46
53
|
};
|
|
47
54
|
|
|
48
|
-
export type
|
|
55
|
+
export type RulerAnnotation = BaseAnnotation & {
|
|
56
|
+
kind: AnnotationKind.RULER;
|
|
57
|
+
/** Second [lng, lat] or [lng, lat, altitudeMeters] endpoint. */
|
|
58
|
+
endPoint: [number, number] | [number, number, number];
|
|
59
|
+
/** Whether the user-authored rich text is rendered at the ruler midpoint. */
|
|
60
|
+
showCustomText: boolean;
|
|
61
|
+
/** Whether the computed geodesic length is rendered at the ruler midpoint. */
|
|
62
|
+
showDistance: boolean;
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
export type Annotation =
|
|
66
|
+
| TextAnnotation
|
|
67
|
+
| PointAnnotation
|
|
68
|
+
| ArrowAnnotation
|
|
69
|
+
| CircleAnnotation
|
|
70
|
+
| RulerAnnotation;
|
|
49
71
|
|
|
50
72
|
export type AnnotationPropsPartial = Partial<Annotation>;
|
package/camera.d.ts
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MIT
|
|
2
|
+
// Copyright contributors to the kepler.gl project
|
|
3
|
+
|
|
4
|
+
/** A saved Mercator view, independent of viewport size and animation state. */
|
|
5
|
+
export type CameraSnapshot = {
|
|
6
|
+
longitude: number;
|
|
7
|
+
latitude: number;
|
|
8
|
+
zoom: number;
|
|
9
|
+
bearing: number;
|
|
10
|
+
pitch: number;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export type CameraBookmark = {
|
|
14
|
+
id: string;
|
|
15
|
+
name: string;
|
|
16
|
+
camera: CameraSnapshot;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
/** Stops own their camera snapshots; there is no live bookmark reference. */
|
|
20
|
+
export type CameraTourStop = CameraBookmark & {
|
|
21
|
+
holdDurationMs: number;
|
|
22
|
+
/** Travel to the next stop; ignored for the final stop. */
|
|
23
|
+
travelDurationMs: number;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export type CameraTour = {
|
|
27
|
+
stops: CameraTourStop[];
|
|
28
|
+
};
|
package/charts.d.ts
ADDED
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MIT
|
|
2
|
+
// Copyright contributors to the kepler.gl project
|
|
3
|
+
|
|
4
|
+
export type ChartAggregation =
|
|
5
|
+
| 'count'
|
|
6
|
+
| 'sum'
|
|
7
|
+
| 'average'
|
|
8
|
+
| 'maximum'
|
|
9
|
+
| 'minimum'
|
|
10
|
+
| 'median'
|
|
11
|
+
| 'stdev'
|
|
12
|
+
| 'variance'
|
|
13
|
+
| 'p05'
|
|
14
|
+
| 'p25'
|
|
15
|
+
| 'p50'
|
|
16
|
+
| 'p75'
|
|
17
|
+
| 'p95'
|
|
18
|
+
| 'mode'
|
|
19
|
+
| 'countUnique';
|
|
20
|
+
|
|
21
|
+
export type ChartAxisField = {
|
|
22
|
+
name: string;
|
|
23
|
+
type: string;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export type ChartAxis = {
|
|
27
|
+
field: ChartAxisField | null;
|
|
28
|
+
aggregation: ChartAggregation | string | null;
|
|
29
|
+
title?: string | null;
|
|
30
|
+
/** Time binning period for timestamp/date axes: hour | day | week | month | year */
|
|
31
|
+
interval?: string | null;
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export type ChartCrossFilter = {
|
|
35
|
+
enabled: boolean;
|
|
36
|
+
filterId: string;
|
|
37
|
+
fieldNames: Record<string, string>;
|
|
38
|
+
value: Record<string, string | number>;
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
export type BaseChartConfig = {
|
|
42
|
+
id: string;
|
|
43
|
+
title: string;
|
|
44
|
+
type: string;
|
|
45
|
+
dataId: string | null;
|
|
46
|
+
applyFilters: boolean;
|
|
47
|
+
/**
|
|
48
|
+
* When true, the chart stays visible on the map even if the charts panel
|
|
49
|
+
* control is inactive (similar to a pinned legend). Persisted in saved maps.
|
|
50
|
+
*/
|
|
51
|
+
pinned?: boolean;
|
|
52
|
+
display: {
|
|
53
|
+
isConfigActive?: boolean;
|
|
54
|
+
isJsonEditorActive?: boolean;
|
|
55
|
+
};
|
|
56
|
+
crossFilter?: ChartCrossFilter;
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
export type DatasetChartConfig = BaseChartConfig & {
|
|
60
|
+
xAxis?: ChartAxis;
|
|
61
|
+
yAxis?: ChartAxis;
|
|
62
|
+
groupBy?: ChartAxis;
|
|
63
|
+
value?: ChartAxis;
|
|
64
|
+
axis?: ChartAxis;
|
|
65
|
+
numGroups?: number;
|
|
66
|
+
groupOthers?: boolean;
|
|
67
|
+
/** How bar/series colors are assigned. */
|
|
68
|
+
colorBy?: 'none' | 'category' | string;
|
|
69
|
+
chartDisplay: Record<string, any>;
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
export type LayerChartConfig = BaseChartConfig & {
|
|
73
|
+
type: 'layerChart';
|
|
74
|
+
layerId: string;
|
|
75
|
+
layerChartType: string;
|
|
76
|
+
axis?: ChartAxis;
|
|
77
|
+
xAxis?: ChartAxis;
|
|
78
|
+
yAxis?: ChartAxis;
|
|
79
|
+
chartDisplay: {
|
|
80
|
+
idField?: string | null;
|
|
81
|
+
numEntries?: number;
|
|
82
|
+
interval?: string;
|
|
83
|
+
format?: string;
|
|
84
|
+
};
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
export type ChartConfig = DatasetChartConfig | LayerChartConfig;
|
package/components.d.ts
CHANGED
package/index.d.ts
CHANGED
|
@@ -8,7 +8,9 @@ export * from './schemas';
|
|
|
8
8
|
export * from './types';
|
|
9
9
|
export * from './components';
|
|
10
10
|
export * from './effects';
|
|
11
|
+
export * from './charts';
|
|
11
12
|
export * from './annotations';
|
|
12
13
|
export * from './datasets';
|
|
14
|
+
export * from './camera';
|
|
13
15
|
|
|
14
16
|
export * as StacTypes from './stac';
|
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[];
|
|
@@ -24,6 +26,10 @@ export type LayerBaseConfig = {
|
|
|
24
26
|
animation: {
|
|
25
27
|
enabled: boolean;
|
|
26
28
|
domain?: [number, number] | null;
|
|
29
|
+
/** Discrete instants the layer can render, for layers without continuous time. */
|
|
30
|
+
timeSteps?: number[] | null;
|
|
31
|
+
startTime?: number | null;
|
|
32
|
+
duration?: number | null;
|
|
27
33
|
};
|
|
28
34
|
|
|
29
35
|
// for aggregate layer, aggregatedBins is returned for custom color scale
|
|
@@ -33,6 +39,9 @@ export type LayerBaseConfig = {
|
|
|
33
39
|
heightField?: VisualChannelField;
|
|
34
40
|
heightDomain?: VisualChannelDomain;
|
|
35
41
|
heightScale?: string;
|
|
42
|
+
elevationOffsetField?: VisualChannelField;
|
|
43
|
+
elevationOffsetDomain?: VisualChannelDomain;
|
|
44
|
+
elevationOffsetScale?: string;
|
|
36
45
|
};
|
|
37
46
|
|
|
38
47
|
/**
|
|
@@ -62,11 +71,23 @@ export type EnhancedFieldPair = {
|
|
|
62
71
|
pair: FieldPair['pair'];
|
|
63
72
|
};
|
|
64
73
|
|
|
74
|
+
export type ColumnGroup = {
|
|
75
|
+
key: string;
|
|
76
|
+
label: string;
|
|
77
|
+
/** Column keys shown when this group is active (mutually exclusive with other groups). */
|
|
78
|
+
columns: string[];
|
|
79
|
+
};
|
|
80
|
+
|
|
65
81
|
export type SupportedColumnMode = {
|
|
66
82
|
key: string;
|
|
67
83
|
label: string;
|
|
68
84
|
requiredColumns: string[];
|
|
69
85
|
optionalColumns?: string[];
|
|
86
|
+
/**
|
|
87
|
+
* Optional mutually exclusive column sets rendered as tabs
|
|
88
|
+
* (e.g. Lat/Lng vs GeoJSON position source).
|
|
89
|
+
*/
|
|
90
|
+
columnGroups?: ColumnGroup[];
|
|
70
91
|
hasHelp?: boolean;
|
|
71
92
|
verifyField?: (field: Field) => boolean;
|
|
72
93
|
};
|
|
@@ -90,6 +111,11 @@ export type LayerHeightConfig = {
|
|
|
90
111
|
heightDomain: VisualChannelDomain;
|
|
91
112
|
heightScale: VisualChannelScale;
|
|
92
113
|
};
|
|
114
|
+
export type LayerElevationOffsetConfig = {
|
|
115
|
+
elevationOffsetField: VisualChannelField;
|
|
116
|
+
elevationOffsetDomain: VisualChannelDomain;
|
|
117
|
+
elevationOffsetScale: VisualChannelScale;
|
|
118
|
+
};
|
|
93
119
|
export type LayerStrokeColorConfig = {
|
|
94
120
|
strokeColorField: VisualChannelField;
|
|
95
121
|
strokeColorDomain: VisualChannelDomain;
|
|
@@ -107,6 +133,8 @@ export type LayerRadiusConfig = {
|
|
|
107
133
|
};
|
|
108
134
|
export type LayerWeightConfig = {
|
|
109
135
|
weightField: VisualChannelField;
|
|
136
|
+
weightDomain?: VisualChannelDomain;
|
|
137
|
+
weightScale?: VisualChannelScale;
|
|
110
138
|
};
|
|
111
139
|
|
|
112
140
|
export type IndexBy = {
|
|
@@ -169,6 +197,8 @@ export type LayerTextLabel = {
|
|
|
169
197
|
outlineWidth: number;
|
|
170
198
|
outlineColor: RGBAColor;
|
|
171
199
|
backgroundColor: RGBAColor | null;
|
|
200
|
+
/** Hide labels that overlap other labels of the same field (GPU collision filter). */
|
|
201
|
+
collisionEnabled?: boolean;
|
|
172
202
|
};
|
|
173
203
|
|
|
174
204
|
export type ColorRangeConfig = {
|
|
@@ -236,6 +266,8 @@ export type VisConfig = {
|
|
|
236
266
|
) => boolean;
|
|
237
267
|
|
|
238
268
|
allowCustomValue?: boolean;
|
|
269
|
+
/** Checkbox label shown when allowCustomValue is true. Defaults to "custom input". */
|
|
270
|
+
customInputLabel?: string;
|
|
239
271
|
};
|
|
240
272
|
|
|
241
273
|
export type VisConfigNumber = VisConfig & {
|
|
@@ -290,6 +322,15 @@ export type VisConfigColorRange = VisConfig & {
|
|
|
290
322
|
defaultValue: ColorRange;
|
|
291
323
|
};
|
|
292
324
|
|
|
325
|
+
/**
|
|
326
|
+
* A plain JSON value whose keys are not known until runtime. The layer renders
|
|
327
|
+
* its own UI for it; the value is saved and restored with the rest of visConfig.
|
|
328
|
+
*/
|
|
329
|
+
export type VisConfigObject = VisConfig & {
|
|
330
|
+
type: 'object';
|
|
331
|
+
defaultValue: Record<string, any>;
|
|
332
|
+
};
|
|
333
|
+
|
|
293
334
|
export type LayerVisConfigTypes =
|
|
294
335
|
| VisConfigBoolean
|
|
295
336
|
| VisConfigNumber
|
|
@@ -298,6 +339,7 @@ export type LayerVisConfigTypes =
|
|
|
298
339
|
| VisConfigColorSelect
|
|
299
340
|
| VisConfigInput
|
|
300
341
|
| VisConfigSelect
|
|
342
|
+
| VisConfigObject
|
|
301
343
|
| VisConfigObjectSelection;
|
|
302
344
|
|
|
303
345
|
export type LayerVisConfigSettings = {
|
|
@@ -311,6 +353,7 @@ export type LayerVisConfigSettings = {
|
|
|
311
353
|
radiusRange: VisConfigRange;
|
|
312
354
|
clusterRadius: VisConfigNumber;
|
|
313
355
|
clusterRadiusRange: VisConfigRange;
|
|
356
|
+
minClusterSize: VisConfigNumber;
|
|
314
357
|
opacity: VisConfigNumber;
|
|
315
358
|
coverage: VisConfigNumber;
|
|
316
359
|
outline: VisConfigBoolean;
|
|
@@ -327,6 +370,8 @@ export type LayerVisConfigSettings = {
|
|
|
327
370
|
angle: VisConfigNumber;
|
|
328
371
|
worldUnitSize: VisConfigNumber;
|
|
329
372
|
elevationScale: VisConfigNumber;
|
|
373
|
+
elevationOffset: VisConfigNumber;
|
|
374
|
+
elevationOffsetRange: VisConfigRange;
|
|
330
375
|
enableElevationZoomFactor: VisConfigBoolean;
|
|
331
376
|
elevationRange: VisConfigRange;
|
|
332
377
|
heightRange: VisConfigRange;
|
|
@@ -341,6 +386,8 @@ export type LayerVisConfigSettings = {
|
|
|
341
386
|
heatmapRadius: VisConfigNumber;
|
|
342
387
|
darkBaseMapEnabled: VisConfigBoolean;
|
|
343
388
|
fixedHeight: VisConfigBoolean;
|
|
389
|
+
invertHeight: VisConfigBoolean;
|
|
390
|
+
fixedElevation: VisConfigBoolean;
|
|
344
391
|
allowHover: VisConfigBoolean;
|
|
345
392
|
showNeighborOnHover: VisConfigBoolean;
|
|
346
393
|
showHighlightColor: VisConfigBoolean;
|
|
@@ -438,18 +485,20 @@ export type LayerCallbacks = {
|
|
|
438
485
|
) => void;
|
|
439
486
|
onRedrawNeeded?: (idx: number) => void;
|
|
440
487
|
onFitBounds?: (idx: number, bounds: [number, number, number, number]) => void;
|
|
488
|
+
onTilesetLoadError?: (idx: number, kind: 'token' | 'generic' | null) => void;
|
|
441
489
|
};
|
|
442
490
|
|
|
443
491
|
export type BindedLayerCallbacks = {
|
|
444
492
|
onLayerHover?: (value: any) => void;
|
|
445
493
|
onSetLayerDomain?: (value: any) => void;
|
|
446
494
|
onFilteredItemsChange?: (event: {id: string; count: number}) => void;
|
|
447
|
-
onWMSFeatureInfo?: (
|
|
448
|
-
featureInfo: Array<{name: string; value: string}> | string | null
|
|
449
|
-
coordinate?: [number, number]
|
|
450
|
-
) => void;
|
|
495
|
+
onWMSFeatureInfo?: (props: {
|
|
496
|
+
featureInfo: Array<{name: string; value: string}> | string | null;
|
|
497
|
+
coordinate?: [number, number] | null;
|
|
498
|
+
}) => void;
|
|
451
499
|
onRedrawNeeded?: () => void;
|
|
452
500
|
onFitBounds?: (bounds: [number, number, number, number]) => void;
|
|
501
|
+
onTilesetLoadError?: (kind: 'token' | 'generic' | null) => void;
|
|
453
502
|
};
|
|
454
503
|
|
|
455
504
|
export type VisualChannelAggregation = 'colorAggregation' | 'sizeAggregation';
|
|
@@ -485,6 +534,8 @@ export type VisualChannel = {
|
|
|
485
534
|
|
|
486
535
|
// TODO: define fixed
|
|
487
536
|
fixed?: any;
|
|
537
|
+
// visConfig key that reverses this channel's scale output (e.g. invertHeight)
|
|
538
|
+
invert?: string;
|
|
488
539
|
|
|
489
540
|
supportedFieldTypes?: Array<SupportedFieldTypes>;
|
|
490
541
|
|
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.
|
|
4
|
+
"version": "3.3.0-alpha.20",
|
|
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": "
|
|
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,8 +1,9 @@
|
|
|
1
1
|
// SPDX-License-Identifier: MIT
|
|
2
2
|
// Copyright contributors to the kepler.gl project
|
|
3
3
|
|
|
4
|
-
import {Field, Millisecond} from './types';
|
|
5
|
-
import {
|
|
4
|
+
import {Field, Millisecond, RGBColor} from './types';
|
|
5
|
+
import {ColorMap, ColorRange, ColorUI} from './layers';
|
|
6
|
+
import {MapSplitMode, MapViewMode} from '@kepler.gl/constants';
|
|
6
7
|
type MapViewState = {
|
|
7
8
|
latitude: number;
|
|
8
9
|
longitude: number;
|
|
@@ -29,6 +30,8 @@ export type MapState = {
|
|
|
29
30
|
maxBounds?: Bounds;
|
|
30
31
|
initialState?: any;
|
|
31
32
|
scale?: number;
|
|
33
|
+
/** Layer rendering parameters forwarded from visState for use during layer construction in globe mode. */
|
|
34
|
+
layerParameters?: Record<string, string | boolean>;
|
|
32
35
|
|
|
33
36
|
// the following 4 properties assist with split viewports that can optionally have (un)synced viewports and zooms
|
|
34
37
|
/** Is the application split into 2 maps? */
|
|
@@ -39,6 +42,31 @@ export type MapState = {
|
|
|
39
42
|
isZoomLocked: boolean;
|
|
40
43
|
/** An array of either 0 or 2 Viewport objects (index 0 for left map; index 1 for right map) */
|
|
41
44
|
splitMapViewports: Viewport[];
|
|
45
|
+
mapViewMode?: MapViewMode;
|
|
46
|
+
globe?: {
|
|
47
|
+
enabled: boolean;
|
|
48
|
+
config: {
|
|
49
|
+
atmosphere: boolean;
|
|
50
|
+
hugeHalo: boolean;
|
|
51
|
+
hugeHaloRadius: number;
|
|
52
|
+
hugeHaloOpacity: number;
|
|
53
|
+
azimuth: boolean;
|
|
54
|
+
azimuthAngle: number;
|
|
55
|
+
terminator: boolean;
|
|
56
|
+
terminatorOpacity: number;
|
|
57
|
+
basemap: boolean;
|
|
58
|
+
labels: boolean;
|
|
59
|
+
labelsColor: [number, number, number];
|
|
60
|
+
adminLines: boolean;
|
|
61
|
+
adminLinesColor: [number, number, number];
|
|
62
|
+
water: boolean;
|
|
63
|
+
waterColor: [number, number, number];
|
|
64
|
+
surfaceColor: [number, number, number];
|
|
65
|
+
surface: boolean;
|
|
66
|
+
backgroundColor: [number, number, number];
|
|
67
|
+
stars: boolean;
|
|
68
|
+
};
|
|
69
|
+
};
|
|
42
70
|
/** The current split map mode (single, dual, swipe) */
|
|
43
71
|
mapSplitMode: MapSplitMode;
|
|
44
72
|
/** Swipe compare divider position as a percentage (0-100) */
|
|
@@ -47,6 +75,19 @@ export type MapState = {
|
|
|
47
75
|
|
|
48
76
|
export type Bounds = [number, number, number, number];
|
|
49
77
|
|
|
78
|
+
/**
|
|
79
|
+
* Padding in pixels used when fitting the map viewport to bounds.
|
|
80
|
+
* A number applies the same padding on all sides.
|
|
81
|
+
*/
|
|
82
|
+
export type ViewportPadding =
|
|
83
|
+
| number
|
|
84
|
+
| {
|
|
85
|
+
top?: number;
|
|
86
|
+
bottom?: number;
|
|
87
|
+
left?: number;
|
|
88
|
+
right?: number;
|
|
89
|
+
};
|
|
90
|
+
|
|
50
91
|
export type RangeFieldDomain = {
|
|
51
92
|
domain: number[];
|
|
52
93
|
step: number;
|
|
@@ -85,16 +126,43 @@ export interface LineDatum {
|
|
|
85
126
|
pct: number | null;
|
|
86
127
|
}
|
|
87
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
|
+
|
|
88
154
|
export type LineChart = {
|
|
89
|
-
series: {x: number; y: number}[];
|
|
155
|
+
series: {x: number; y: number}[] | LineChartSeries;
|
|
90
156
|
yDomain: number[] | undefined[];
|
|
91
157
|
xDomain: number[];
|
|
92
158
|
|
|
93
159
|
// Is this a valid part of LineChart?
|
|
94
160
|
aggregation: string;
|
|
95
|
-
interval: string;
|
|
161
|
+
interval: string | number | null;
|
|
96
162
|
yAxis: string;
|
|
97
|
-
bins?: Bins;
|
|
163
|
+
bins?: Bins | Bin[];
|
|
164
|
+
/** Cache key for timeline series grouping. Null when the plot is a single series. */
|
|
165
|
+
groupBy?: LineChartGroupBy | null;
|
|
98
166
|
};
|
|
99
167
|
|
|
100
168
|
type FilterViewType = 'side' | 'enlarged' | 'minified';
|
|
@@ -103,11 +171,17 @@ export type FilterBase<L extends LineChart> = {
|
|
|
103
171
|
dataId: string[];
|
|
104
172
|
id: string;
|
|
105
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;
|
|
106
179
|
|
|
107
180
|
// time range filter specific
|
|
108
181
|
fixedDomain: boolean;
|
|
109
182
|
view: FilterViewType;
|
|
110
183
|
isAnimating: boolean;
|
|
184
|
+
animationWindow?: string;
|
|
111
185
|
speed: number;
|
|
112
186
|
showTimeDisplay?: boolean;
|
|
113
187
|
|
|
@@ -128,8 +202,14 @@ export type FilterBase<L extends LineChart> = {
|
|
|
128
202
|
// gpu filter
|
|
129
203
|
gpu: boolean;
|
|
130
204
|
gpuChannel?: number[];
|
|
205
|
+
gpuEndChannel?: number[];
|
|
131
206
|
fieldType?: string;
|
|
132
207
|
|
|
208
|
+
// Optional end timestamp for duration-based time filters (parallel to name/fieldIdx)
|
|
209
|
+
endName?: (string | null | undefined)[];
|
|
210
|
+
endFieldIdx?: (number | null | undefined)[];
|
|
211
|
+
endMappedValue?: ((number | null)[] | null | undefined)[];
|
|
212
|
+
|
|
133
213
|
// polygon
|
|
134
214
|
layerId?: string[];
|
|
135
215
|
};
|
|
@@ -175,6 +255,14 @@ export type TimeRangeFilter = FilterBase<LineChart> &
|
|
|
175
255
|
syncTimelineMode: SyncTimelineMode;
|
|
176
256
|
animationWindow: string;
|
|
177
257
|
invertTrendColor: boolean;
|
|
258
|
+
/**
|
|
259
|
+
* When set, a feature is visible while the playback window overlaps
|
|
260
|
+
* [startField, endField] rather than requiring a single timestamp in range.
|
|
261
|
+
*/
|
|
262
|
+
endName?: (string | null | undefined)[];
|
|
263
|
+
endFieldIdx?: (number | null | undefined)[];
|
|
264
|
+
endMappedValue?: ((number | null)[] | null | undefined)[];
|
|
265
|
+
gpuEndChannel?: number[];
|
|
178
266
|
};
|
|
179
267
|
|
|
180
268
|
export type PolygonFilter = FilterBase<LineChart> & {
|
|
@@ -211,10 +299,14 @@ export interface TimeBins {
|
|
|
211
299
|
|
|
212
300
|
export interface PlotType {
|
|
213
301
|
interval: ValueOf<Interval>;
|
|
302
|
+
numericInterval?: number;
|
|
214
303
|
type: ValueOf<PlotTypes>;
|
|
215
304
|
aggregation: ValueOf<AggregationTypes>;
|
|
216
305
|
defaultTimeFormat: string;
|
|
217
306
|
colorsByDataId?: {[dataId: string]: string};
|
|
307
|
+
/** Categorical series split for the timeline line chart. */
|
|
308
|
+
groupBy?: PlotGroupBy | null;
|
|
309
|
+
yAxisAutoRange?: boolean;
|
|
218
310
|
}
|
|
219
311
|
|
|
220
312
|
export type Feature = {
|
|
@@ -289,16 +381,9 @@ export type AnimationConfig = {
|
|
|
289
381
|
hideControl?: boolean;
|
|
290
382
|
};
|
|
291
383
|
|
|
292
|
-
export type FilterAnimationConfig = Pick<
|
|
293
|
-
|
|
294
|
-
| '
|
|
295
|
-
| 'value'
|
|
296
|
-
| 'animationWindow'
|
|
297
|
-
| 'speed'
|
|
298
|
-
| 'syncedWithLayerTimeline'
|
|
299
|
-
| 'syncTimelineMode'
|
|
300
|
-
| 'timezone'
|
|
301
|
-
>;
|
|
384
|
+
export type FilterAnimationConfig = Pick<Filter, 'dataId' | 'value' | 'speed'> &
|
|
385
|
+
Required<Pick<Filter, 'animationWindow'>> &
|
|
386
|
+
Partial<Pick<TimeRangeFilter, 'syncedWithLayerTimeline' | 'syncTimelineMode' | 'timezone'>>;
|
|
302
387
|
|
|
303
388
|
export type Timeline = {
|
|
304
389
|
domain: [number, number] | null;
|
|
@@ -330,6 +415,7 @@ export type TooltipInfo = BaseInteraction & {
|
|
|
330
415
|
fieldsToShow: {
|
|
331
416
|
[key: string]: TooltipField[];
|
|
332
417
|
};
|
|
418
|
+
timezone?: string | null;
|
|
333
419
|
compareMode: boolean;
|
|
334
420
|
compareType: CompareType;
|
|
335
421
|
};
|
|
@@ -339,6 +425,7 @@ export type Geocoder = BaseInteraction & {
|
|
|
339
425
|
position: number[] | null;
|
|
340
426
|
config: {
|
|
341
427
|
limitSearch: boolean;
|
|
428
|
+
color: RGBColor;
|
|
342
429
|
};
|
|
343
430
|
};
|
|
344
431
|
export type Brush = BaseInteraction & {
|
|
@@ -351,20 +438,66 @@ export type Coordinate = BaseInteraction & {
|
|
|
351
438
|
id: 'coordinate';
|
|
352
439
|
position: number[] | null;
|
|
353
440
|
};
|
|
441
|
+
export type AnnotationInteraction = BaseInteraction & {
|
|
442
|
+
id: 'annotation';
|
|
443
|
+
};
|
|
444
|
+
export type LegendInfo = BaseInteraction & {
|
|
445
|
+
id: 'legend';
|
|
446
|
+
config: {
|
|
447
|
+
hideInvisibleLayers: boolean;
|
|
448
|
+
};
|
|
449
|
+
};
|
|
450
|
+
/** Zoom stops for a fade envelope. Opacity is 0 outside [appear, gone]. */
|
|
451
|
+
export type ZoomOpacityStops = {
|
|
452
|
+
/** Zoom where opacity leaves 0. */
|
|
453
|
+
appear: number;
|
|
454
|
+
/** Zoom where opacity reaches the layer's full opacity. */
|
|
455
|
+
full: number;
|
|
456
|
+
/** Zoom where opacity starts falling. */
|
|
457
|
+
fade: number;
|
|
458
|
+
/** Zoom where opacity returns to 0. */
|
|
459
|
+
gone: number;
|
|
460
|
+
};
|
|
461
|
+
/** Layers and reserved map targets that share one zoom envelope. */
|
|
462
|
+
export type ZoomOpacityController = {
|
|
463
|
+
id: string;
|
|
464
|
+
layerIds: string[];
|
|
465
|
+
stops: ZoomOpacityStops;
|
|
466
|
+
};
|
|
467
|
+
export type ZoomOpacityInteraction = BaseInteraction & {
|
|
468
|
+
id: 'zoomOpacity';
|
|
469
|
+
config: {
|
|
470
|
+
controllers: ZoomOpacityController[];
|
|
471
|
+
};
|
|
472
|
+
};
|
|
354
473
|
export type InteractionConfig = {
|
|
355
474
|
tooltip: TooltipInfo;
|
|
475
|
+
legend: LegendInfo;
|
|
356
476
|
geocoder: Geocoder;
|
|
357
477
|
brush: Brush;
|
|
358
478
|
coordinate: Coordinate;
|
|
479
|
+
annotation: AnnotationInteraction;
|
|
480
|
+
zoomOpacity: ZoomOpacityInteraction;
|
|
359
481
|
};
|
|
360
482
|
export type MapInfo = {
|
|
361
|
-
title
|
|
362
|
-
description
|
|
483
|
+
title?: string;
|
|
484
|
+
description?: string;
|
|
485
|
+
};
|
|
486
|
+
/** Options captured when a file load starts and forwarded to `addDataToMap`. */
|
|
487
|
+
export type FileLoadingOptions = {
|
|
488
|
+
autoCreateLayers?: boolean;
|
|
489
|
+
/** Parse the files, then wait for an explicit add instead of calling `addDataToMap`. */
|
|
490
|
+
deferAddToMap?: boolean;
|
|
363
491
|
};
|
|
492
|
+
|
|
364
493
|
export type FileLoading = {
|
|
365
|
-
|
|
366
|
-
|
|
494
|
+
/** Identifies this load so a delayed finish from an older one can be ignored. */
|
|
495
|
+
loadId: number;
|
|
496
|
+
filesToLoad: FileList | File[];
|
|
497
|
+
companionFiles?: File[];
|
|
498
|
+
onFinish: (payload: any, options?: FileLoadingOptions) => any;
|
|
367
499
|
fileCache: any[];
|
|
500
|
+
options?: FileLoadingOptions;
|
|
368
501
|
};
|
|
369
502
|
export type FileLoadingProgress = {
|
|
370
503
|
[key: string]: {
|
|
@@ -406,6 +539,10 @@ export declare type ExportImage = {
|
|
|
406
539
|
ratio: EXPORT_IMG_RATIOS;
|
|
407
540
|
resolution: ExportResolutionOption;
|
|
408
541
|
legend: boolean;
|
|
542
|
+
/** When true, include the charts panel in the exported image. */
|
|
543
|
+
charts: boolean;
|
|
544
|
+
/** When true, omit the basemap and preserve transparent pixels in the exported image. */
|
|
545
|
+
transparentBackground?: boolean;
|
|
409
546
|
mapH: number;
|
|
410
547
|
mapW: number;
|
|
411
548
|
imageSize: {
|
|
@@ -420,6 +557,7 @@ export declare type ExportImage = {
|
|
|
420
557
|
error: Error | false;
|
|
421
558
|
center: boolean;
|
|
422
559
|
escapeXhtmlForWebpack?: boolean;
|
|
560
|
+
fileName: string;
|
|
423
561
|
};
|
|
424
562
|
|
|
425
563
|
export type ExportData = {
|
|
@@ -440,6 +578,17 @@ export type ExportMap = {
|
|
|
440
578
|
HTML: ExportHtml;
|
|
441
579
|
JSON: ExportJson;
|
|
442
580
|
format: 'HTML' | 'JSON';
|
|
581
|
+
fileName: string;
|
|
582
|
+
/** When false, dataset access tokens are omitted from exported HTML and JSON. */
|
|
583
|
+
includeLayerApiKeys: boolean;
|
|
584
|
+
/** Optional application name override for exported HTML and JSON. */
|
|
585
|
+
appName?: string;
|
|
586
|
+
/** Optional application website override for exported HTML and JSON. */
|
|
587
|
+
appWebsite?: string;
|
|
588
|
+
/** Optional application icon URL override for exported HTML and JSON. */
|
|
589
|
+
appIcon?: string;
|
|
590
|
+
/** Optional application name color override for exported HTML and JSON. */
|
|
591
|
+
appNameColor?: string;
|
|
443
592
|
};
|
|
444
593
|
|
|
445
594
|
export type ExportVideo = {
|
|
@@ -481,9 +630,15 @@ export type MapControls = {
|
|
|
481
630
|
splitMap?: MapControlItem;
|
|
482
631
|
mapDraw?: MapControlItem;
|
|
483
632
|
mapLocale?: MapControlItem;
|
|
633
|
+
mapTheme?: MapControlItem;
|
|
484
634
|
effect?: MapControlItem;
|
|
485
635
|
annotation?: MapControlItem;
|
|
636
|
+
chart?: MapControlItem;
|
|
637
|
+
viewportJson?: MapControlItem;
|
|
638
|
+
mapInfo?: MapControlItem;
|
|
639
|
+
sqlPanel?: MapControlItem;
|
|
486
640
|
aiAssistant?: MapControlItem;
|
|
641
|
+
[key: string]: MapControlItem | MapControlMapLegend | undefined;
|
|
487
642
|
};
|
|
488
643
|
|
|
489
644
|
export type LoadFiles = {
|
|
@@ -501,6 +656,8 @@ export type Notifications = {
|
|
|
501
656
|
|
|
502
657
|
export type Locale = string;
|
|
503
658
|
|
|
659
|
+
export type UiTheme = string;
|
|
660
|
+
|
|
504
661
|
export type PanelListView = string;
|
|
505
662
|
|
|
506
663
|
export type UiState = {
|
|
@@ -508,6 +665,8 @@ export type UiState = {
|
|
|
508
665
|
activeSidePanel: string | null;
|
|
509
666
|
currentModal: string | null;
|
|
510
667
|
datasetKeyToRemove: string | null;
|
|
668
|
+
/** Dataset selected by the dataset-menu Replace action. Cleared when the modal closes. */
|
|
669
|
+
datasetToReplaceId: string | null;
|
|
511
670
|
visibleDropdown: string | null;
|
|
512
671
|
// export image modal ui
|
|
513
672
|
exportImage: ExportImage;
|
|
@@ -525,6 +684,8 @@ export type UiState = {
|
|
|
525
684
|
loadFiles: LoadFiles;
|
|
526
685
|
// Locale of the UI
|
|
527
686
|
locale: Locale;
|
|
687
|
+
// Theme of the UI (`light` | `dark` | `space`). First of `themes` is the default when set.
|
|
688
|
+
theme: UiTheme;
|
|
528
689
|
// view layers by list or dataset
|
|
529
690
|
layerPanelListView: PanelListView;
|
|
530
691
|
// view filters by list or dataset
|
package/schemas.d.ts
CHANGED
|
@@ -3,14 +3,24 @@
|
|
|
3
3
|
|
|
4
4
|
import {RGBColor, Merge, RequireFrom} from './types';
|
|
5
5
|
|
|
6
|
-
import {
|
|
6
|
+
import {
|
|
7
|
+
Filter,
|
|
8
|
+
InteractionConfig,
|
|
9
|
+
AnimationConfig,
|
|
10
|
+
SplitMap,
|
|
11
|
+
Feature,
|
|
12
|
+
MapLegendControlSettings
|
|
13
|
+
} from './reducers';
|
|
7
14
|
|
|
8
15
|
import {LayerTextLabel} from './layers';
|
|
16
|
+
import {ChartConfig} from './charts';
|
|
17
|
+
import {CameraBookmark, CameraTour} from './camera';
|
|
9
18
|
|
|
10
19
|
export type SavedFilter = {
|
|
11
20
|
dataId: Filter['dataId'];
|
|
12
21
|
id: Filter['id'];
|
|
13
22
|
name: Filter['name'];
|
|
23
|
+
endName?: Filter['endName'];
|
|
14
24
|
type: Filter['type'];
|
|
15
25
|
value: Filter['value'];
|
|
16
26
|
// deprecated
|
|
@@ -25,6 +35,8 @@ export type SavedFilter = {
|
|
|
25
35
|
layerId: Filter['layerId'];
|
|
26
36
|
syncedWithLayerTimeline: Filter['syncedWithLayerTimeline'];
|
|
27
37
|
syncTimelineMode: Filter['syncTimelineMode'];
|
|
38
|
+
/** Hide rows that match the filter instead of keeping them. */
|
|
39
|
+
inverted?: boolean;
|
|
28
40
|
};
|
|
29
41
|
export type MinSavedFilter = RequireFrom<SavedFilter, 'dataId' | 'id' | 'name' | 'type' | 'value'>;
|
|
30
42
|
export type ParsedFilter = SavedFilter | MinSavedFilter;
|
|
@@ -36,6 +48,7 @@ export type SavedInteractionConfig = {
|
|
|
36
48
|
geocoder: {
|
|
37
49
|
enabled: boolean;
|
|
38
50
|
limitSearch?: boolean;
|
|
51
|
+
color?: RGBColor;
|
|
39
52
|
};
|
|
40
53
|
brush: InteractionConfig['brush']['config'] & {
|
|
41
54
|
enabled: boolean;
|
|
@@ -43,6 +56,16 @@ export type SavedInteractionConfig = {
|
|
|
43
56
|
coordinate: {
|
|
44
57
|
enabled: boolean;
|
|
45
58
|
};
|
|
59
|
+
annotation?: {
|
|
60
|
+
enabled: boolean;
|
|
61
|
+
};
|
|
62
|
+
legend?: {
|
|
63
|
+
enabled: boolean;
|
|
64
|
+
hideInvisibleLayers?: boolean;
|
|
65
|
+
};
|
|
66
|
+
zoomOpacity?: InteractionConfig['zoomOpacity']['config'] & {
|
|
67
|
+
enabled: boolean;
|
|
68
|
+
};
|
|
46
69
|
};
|
|
47
70
|
|
|
48
71
|
export type SavedScale = string;
|
|
@@ -58,6 +81,7 @@ export type SavedLayer = {
|
|
|
58
81
|
label: string;
|
|
59
82
|
color: RGBColor;
|
|
60
83
|
highlightColor?: RGBColor;
|
|
84
|
+
uniqueIdField?: string | null;
|
|
61
85
|
columns: {
|
|
62
86
|
[key: string]: string;
|
|
63
87
|
};
|
|
@@ -65,6 +89,7 @@ export type SavedLayer = {
|
|
|
65
89
|
isVisible: boolean;
|
|
66
90
|
visConfig: Record<string, any>;
|
|
67
91
|
hidden: boolean;
|
|
92
|
+
isIncludedInLegend?: boolean;
|
|
68
93
|
textLabel: Merge<LayerTextLabel, {field: {name: string; type: string} | null}>;
|
|
69
94
|
};
|
|
70
95
|
visualChannels: SavedVisualChannels;
|
|
@@ -90,6 +115,8 @@ export type SavedEffect = ParsedEffect;
|
|
|
90
115
|
export type SavedAnimationConfig = {
|
|
91
116
|
currentTime: AnimationConfig['currentTime'];
|
|
92
117
|
speed: AnimationConfig['speed'];
|
|
118
|
+
timeFormat?: AnimationConfig['timeFormat'];
|
|
119
|
+
timezone?: AnimationConfig['timezone'];
|
|
93
120
|
};
|
|
94
121
|
|
|
95
122
|
export type SavedEditor = {
|
|
@@ -98,9 +125,12 @@ export type SavedEditor = {
|
|
|
98
125
|
};
|
|
99
126
|
|
|
100
127
|
export type SavedVisState = {
|
|
128
|
+
cameraTour?: CameraTour;
|
|
129
|
+
cameraBookmarks?: CameraBookmark[];
|
|
101
130
|
filters: SavedFilter[];
|
|
102
131
|
layers: SavedLayer[];
|
|
103
132
|
effects: SavedEffect[];
|
|
133
|
+
charts?: ChartConfig[];
|
|
104
134
|
interactionConfig: SavedInteractionConfig;
|
|
105
135
|
layerBlending: string;
|
|
106
136
|
overlayBlending?: string;
|
|
@@ -108,13 +138,18 @@ export type SavedVisState = {
|
|
|
108
138
|
animationConfig: SavedAnimationConfig;
|
|
109
139
|
editor?: SavedEditor;
|
|
110
140
|
layerOrder?: any[];
|
|
141
|
+
groupBys?: any[];
|
|
142
|
+
joins?: any[];
|
|
111
143
|
};
|
|
112
144
|
|
|
113
145
|
// Min saved config can be passed to addDataToMap
|
|
114
146
|
export type MinSavedVisStateV1 = {
|
|
147
|
+
cameraTour?: CameraTour;
|
|
148
|
+
cameraBookmarks?: CameraBookmark[];
|
|
115
149
|
filters?: MinSavedFilter[];
|
|
116
150
|
layers?: MinSavedLayer[];
|
|
117
151
|
effects?: SavedEffect[];
|
|
152
|
+
charts?: ChartConfig[];
|
|
118
153
|
interactionConfig?: Partial<SavedInteractionConfig>;
|
|
119
154
|
layerBlending?: string;
|
|
120
155
|
overlayBlending?: string;
|
|
@@ -124,16 +159,20 @@ export type MinSavedVisStateV1 = {
|
|
|
124
159
|
};
|
|
125
160
|
|
|
126
161
|
export type ParsedVisState = {
|
|
162
|
+
cameraTour?: CameraTour | null;
|
|
163
|
+
cameraBookmarks?: CameraBookmark[];
|
|
127
164
|
layers?: ParsedLayer[];
|
|
128
165
|
effects?: ParsedEffect[];
|
|
166
|
+
charts?: ChartConfig[];
|
|
129
167
|
filters?: ParsedFilter[];
|
|
130
|
-
effects?: ParsedEffect[];
|
|
131
168
|
interactionConfig?: Partial<SavedInteractionConfig>;
|
|
132
169
|
layerBlending?: string;
|
|
133
170
|
overlayBlending?: string;
|
|
134
171
|
splitMaps?: SplitMap[];
|
|
135
172
|
animationConfig?: Partial<SavedAnimationConfig>;
|
|
136
173
|
layerOrder?: any[];
|
|
174
|
+
groupBys?: any[];
|
|
175
|
+
joins?: any[];
|
|
137
176
|
};
|
|
138
177
|
|
|
139
178
|
export type ParsedUiState = {
|
|
@@ -150,8 +189,20 @@ export type ParsedUiState = {
|
|
|
150
189
|
contentHeight?: number;
|
|
151
190
|
};
|
|
152
191
|
};
|
|
192
|
+
chart?: {
|
|
193
|
+
active?: boolean;
|
|
194
|
+
};
|
|
195
|
+
mapInfo?: {
|
|
196
|
+
active?: boolean;
|
|
197
|
+
show?: boolean;
|
|
198
|
+
};
|
|
199
|
+
cameraBookmarks?: {
|
|
200
|
+
show?: boolean;
|
|
201
|
+
settings?: Partial<MapLegendControlSettings>;
|
|
202
|
+
};
|
|
153
203
|
};
|
|
154
204
|
locale?: string;
|
|
205
|
+
theme?: string;
|
|
155
206
|
};
|
|
156
207
|
|
|
157
208
|
export type SavedMapState = {
|
|
@@ -264,9 +315,21 @@ export type SavedMap = {
|
|
|
264
315
|
info: {
|
|
265
316
|
app: string;
|
|
266
317
|
created_at: string;
|
|
267
|
-
title
|
|
268
|
-
description
|
|
318
|
+
title?: string;
|
|
319
|
+
description?: string;
|
|
320
|
+
source?: string;
|
|
321
|
+
appName?: string;
|
|
322
|
+
appWebsite?: string;
|
|
323
|
+
appIcon?: string;
|
|
324
|
+
appNameColor?: string;
|
|
269
325
|
};
|
|
270
326
|
};
|
|
271
327
|
|
|
272
|
-
export type LoadedMap = {
|
|
328
|
+
export type LoadedMap = {
|
|
329
|
+
datasets?: ParsedDataset[] | null;
|
|
330
|
+
config?: ParsedConfig | null;
|
|
331
|
+
info?: {
|
|
332
|
+
title?: string;
|
|
333
|
+
description?: string;
|
|
334
|
+
};
|
|
335
|
+
};
|
package/types.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
// SPDX-License-Identifier: MIT
|
|
2
2
|
// Copyright contributors to the kepler.gl project
|
|
3
3
|
|
|
4
|
+
import type {GeoArrowBinaryData} from './actions';
|
|
5
|
+
|
|
4
6
|
export type RGBColor = [number, number, number];
|
|
5
7
|
export type RGBAColor = [number, number, number, number];
|
|
6
8
|
export type HexColor = string; // this is the best typescript can do at the moment
|
|
@@ -52,6 +54,8 @@ export type ProcessorResult = {
|
|
|
52
54
|
rows: any[][];
|
|
53
55
|
cols?: any[];
|
|
54
56
|
metadata?: any;
|
|
57
|
+
/** GeoArrow chunks already converted to deck.gl binary features on workers. */
|
|
58
|
+
geoArrowBinaryData?: GeoArrowBinaryData;
|
|
55
59
|
/** Optional schema for arrow tables with metadata preserved. */
|
|
56
60
|
// TODO: Should we use a loaded arrow.Table in cols instead of an array of arrow.Vectors? Why was an array of arrow.Vectors chosen?
|
|
57
61
|
arrowSchema?: any;
|