@kepler.gl/types 3.3.0-alpha.16 → 3.3.0-alpha.18
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 +18 -0
- package/layers.d.ts +4 -0
- package/package.json +2 -2
- package/reducers.d.ts +25 -16
- package/schemas.d.ts +20 -3
- package/types.d.ts +4 -0
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: {
|
|
@@ -43,6 +45,20 @@ export type ProtoDatasetField = {
|
|
|
43
45
|
id?: string;
|
|
44
46
|
metadata?: Record<string, any>;
|
|
45
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
|
+
|
|
46
62
|
export type ProtoDataset = {
|
|
47
63
|
info: {
|
|
48
64
|
id?: string;
|
|
@@ -57,6 +73,8 @@ export type ProtoDataset = {
|
|
|
57
73
|
rows: any[][];
|
|
58
74
|
cols?: any[];
|
|
59
75
|
arrowTable?: arrow.Table;
|
|
76
|
+
/** GeoArrow chunks already converted to deck.gl binary features on workers. */
|
|
77
|
+
geoArrowBinaryData?: GeoArrowBinaryData;
|
|
60
78
|
/** Existing table in the configured DuckDB database; avoids re-importing its rows. */
|
|
61
79
|
duckdbTableName?: string;
|
|
62
80
|
};
|
package/layers.d.ts
CHANGED
|
@@ -339,6 +339,7 @@ export type LayerVisConfigSettings = {
|
|
|
339
339
|
radiusRange: VisConfigRange;
|
|
340
340
|
clusterRadius: VisConfigNumber;
|
|
341
341
|
clusterRadiusRange: VisConfigRange;
|
|
342
|
+
minClusterSize: VisConfigNumber;
|
|
342
343
|
opacity: VisConfigNumber;
|
|
343
344
|
coverage: VisConfigNumber;
|
|
344
345
|
outline: VisConfigBoolean;
|
|
@@ -371,6 +372,7 @@ export type LayerVisConfigSettings = {
|
|
|
371
372
|
heatmapRadius: VisConfigNumber;
|
|
372
373
|
darkBaseMapEnabled: VisConfigBoolean;
|
|
373
374
|
fixedHeight: VisConfigBoolean;
|
|
375
|
+
invertHeight: VisConfigBoolean;
|
|
374
376
|
fixedElevation: VisConfigBoolean;
|
|
375
377
|
allowHover: VisConfigBoolean;
|
|
376
378
|
showNeighborOnHover: VisConfigBoolean;
|
|
@@ -518,6 +520,8 @@ export type VisualChannel = {
|
|
|
518
520
|
|
|
519
521
|
// TODO: define fixed
|
|
520
522
|
fixed?: any;
|
|
523
|
+
// visConfig key that reverses this channel's scale output (e.g. invertHeight)
|
|
524
|
+
invert?: string;
|
|
521
525
|
|
|
522
526
|
supportedFieldTypes?: Array<SupportedFieldTypes>;
|
|
523
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.
|
|
4
|
+
"version": "3.3.0-alpha.18",
|
|
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,7 +1,7 @@
|
|
|
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
5
|
import {ColorMap, ColorRange, ColorUI} from './layers';
|
|
6
6
|
import {MapSplitMode, MapViewMode} from '@kepler.gl/constants';
|
|
7
7
|
type MapViewState = {
|
|
@@ -158,9 +158,9 @@ export type LineChart = {
|
|
|
158
158
|
|
|
159
159
|
// Is this a valid part of LineChart?
|
|
160
160
|
aggregation: string;
|
|
161
|
-
interval: string;
|
|
161
|
+
interval: string | number | null;
|
|
162
162
|
yAxis: string;
|
|
163
|
-
bins?: Bins;
|
|
163
|
+
bins?: Bins | Bin[];
|
|
164
164
|
/** Cache key for timeline series grouping. Null when the plot is a single series. */
|
|
165
165
|
groupBy?: LineChartGroupBy | null;
|
|
166
166
|
};
|
|
@@ -171,11 +171,17 @@ export type FilterBase<L extends LineChart> = {
|
|
|
171
171
|
dataId: string[];
|
|
172
172
|
id: string;
|
|
173
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;
|
|
174
179
|
|
|
175
180
|
// time range filter specific
|
|
176
181
|
fixedDomain: boolean;
|
|
177
182
|
view: FilterViewType;
|
|
178
183
|
isAnimating: boolean;
|
|
184
|
+
animationWindow?: string;
|
|
179
185
|
speed: number;
|
|
180
186
|
showTimeDisplay?: boolean;
|
|
181
187
|
|
|
@@ -293,6 +299,7 @@ export interface TimeBins {
|
|
|
293
299
|
|
|
294
300
|
export interface PlotType {
|
|
295
301
|
interval: ValueOf<Interval>;
|
|
302
|
+
numericInterval?: number;
|
|
296
303
|
type: ValueOf<PlotTypes>;
|
|
297
304
|
aggregation: ValueOf<AggregationTypes>;
|
|
298
305
|
defaultTimeFormat: string;
|
|
@@ -374,16 +381,9 @@ export type AnimationConfig = {
|
|
|
374
381
|
hideControl?: boolean;
|
|
375
382
|
};
|
|
376
383
|
|
|
377
|
-
export type FilterAnimationConfig = Pick<
|
|
378
|
-
|
|
379
|
-
| '
|
|
380
|
-
| 'value'
|
|
381
|
-
| 'animationWindow'
|
|
382
|
-
| 'speed'
|
|
383
|
-
| 'syncedWithLayerTimeline'
|
|
384
|
-
| 'syncTimelineMode'
|
|
385
|
-
| 'timezone'
|
|
386
|
-
>;
|
|
384
|
+
export type FilterAnimationConfig = Pick<Filter, 'dataId' | 'value' | 'speed'> &
|
|
385
|
+
Required<Pick<Filter, 'animationWindow'>> &
|
|
386
|
+
Partial<Pick<TimeRangeFilter, 'syncedWithLayerTimeline' | 'syncTimelineMode' | 'timezone'>>;
|
|
387
387
|
|
|
388
388
|
export type Timeline = {
|
|
389
389
|
domain: [number, number] | null;
|
|
@@ -415,6 +415,7 @@ export type TooltipInfo = BaseInteraction & {
|
|
|
415
415
|
fieldsToShow: {
|
|
416
416
|
[key: string]: TooltipField[];
|
|
417
417
|
};
|
|
418
|
+
timezone?: string | null;
|
|
418
419
|
compareMode: boolean;
|
|
419
420
|
compareType: CompareType;
|
|
420
421
|
};
|
|
@@ -424,6 +425,7 @@ export type Geocoder = BaseInteraction & {
|
|
|
424
425
|
position: number[] | null;
|
|
425
426
|
config: {
|
|
426
427
|
limitSearch: boolean;
|
|
428
|
+
color: RGBColor;
|
|
427
429
|
};
|
|
428
430
|
};
|
|
429
431
|
export type Brush = BaseInteraction & {
|
|
@@ -456,7 +458,7 @@ export type ZoomOpacityStops = {
|
|
|
456
458
|
/** Zoom where opacity returns to 0. */
|
|
457
459
|
gone: number;
|
|
458
460
|
};
|
|
459
|
-
/** Layers that share one zoom envelope. */
|
|
461
|
+
/** Layers and reserved map targets that share one zoom envelope. */
|
|
460
462
|
export type ZoomOpacityController = {
|
|
461
463
|
id: string;
|
|
462
464
|
layerIds: string[];
|
|
@@ -478,8 +480,8 @@ export type InteractionConfig = {
|
|
|
478
480
|
zoomOpacity: ZoomOpacityInteraction;
|
|
479
481
|
};
|
|
480
482
|
export type MapInfo = {
|
|
481
|
-
title
|
|
482
|
-
description
|
|
483
|
+
title?: string;
|
|
484
|
+
description?: string;
|
|
483
485
|
};
|
|
484
486
|
/** Options captured when a file load starts and forwarded to `addDataToMap`. */
|
|
485
487
|
export type FileLoadingOptions = {
|
|
@@ -539,6 +541,8 @@ export declare type ExportImage = {
|
|
|
539
541
|
legend: boolean;
|
|
540
542
|
/** When true, include the charts panel in the exported image. */
|
|
541
543
|
charts: boolean;
|
|
544
|
+
/** When true, omit the basemap and preserve transparent pixels in the exported image. */
|
|
545
|
+
transparentBackground?: boolean;
|
|
542
546
|
mapH: number;
|
|
543
547
|
mapW: number;
|
|
544
548
|
imageSize: {
|
|
@@ -577,6 +581,10 @@ export type ExportMap = {
|
|
|
577
581
|
fileName: string;
|
|
578
582
|
/** When false, dataset access tokens are omitted from exported HTML and JSON. */
|
|
579
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;
|
|
580
588
|
};
|
|
581
589
|
|
|
582
590
|
export type ExportVideo = {
|
|
@@ -623,6 +631,7 @@ export type MapControls = {
|
|
|
623
631
|
annotation?: MapControlItem;
|
|
624
632
|
chart?: MapControlItem;
|
|
625
633
|
viewportJson?: MapControlItem;
|
|
634
|
+
mapInfo?: MapControlItem;
|
|
626
635
|
sqlPanel?: MapControlItem;
|
|
627
636
|
aiAssistant?: MapControlItem;
|
|
628
637
|
[key: string]: MapControlItem | MapControlMapLegend | undefined;
|
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;
|
|
@@ -174,6 +177,10 @@ export type ParsedUiState = {
|
|
|
174
177
|
chart?: {
|
|
175
178
|
active?: boolean;
|
|
176
179
|
};
|
|
180
|
+
mapInfo?: {
|
|
181
|
+
active?: boolean;
|
|
182
|
+
show?: boolean;
|
|
183
|
+
};
|
|
177
184
|
};
|
|
178
185
|
locale?: string;
|
|
179
186
|
theme?: string;
|
|
@@ -289,9 +296,19 @@ export type SavedMap = {
|
|
|
289
296
|
info: {
|
|
290
297
|
app: string;
|
|
291
298
|
created_at: string;
|
|
292
|
-
title
|
|
293
|
-
description
|
|
299
|
+
title?: string;
|
|
300
|
+
description?: string;
|
|
301
|
+
source?: string;
|
|
302
|
+
appName?: string;
|
|
303
|
+
appWebsite?: string;
|
|
294
304
|
};
|
|
295
305
|
};
|
|
296
306
|
|
|
297
|
-
export type LoadedMap = {
|
|
307
|
+
export type LoadedMap = {
|
|
308
|
+
datasets?: ParsedDataset[] | null;
|
|
309
|
+
config?: ParsedConfig | null;
|
|
310
|
+
info?: {
|
|
311
|
+
title?: string;
|
|
312
|
+
description?: string;
|
|
313
|
+
};
|
|
314
|
+
};
|
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;
|