@kepler.gl/types 3.1.0-alpha.1 → 3.1.0-alpha.2
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/datasets.d.ts +15 -0
- package/index.d.ts +1 -0
- package/layers.d.ts +43 -7
- package/package.json +2 -2
- package/reducers.d.ts +2 -0
- package/schemas.d.ts +1 -1
- package/types.d.ts +8 -0
package/datasets.d.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MIT
|
|
2
|
+
// Copyright contributors to the kepler.gl project
|
|
3
|
+
|
|
4
|
+
export type ZoomStops = number[][];
|
|
5
|
+
|
|
6
|
+
export type DomainStops = {
|
|
7
|
+
z: number[];
|
|
8
|
+
stops: ZoomStops;
|
|
9
|
+
interpolation: 'interpolate';
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export type ZoomStopsConfig = {
|
|
13
|
+
enabled?: boolean;
|
|
14
|
+
stops: ZoomStops | null;
|
|
15
|
+
};
|
package/index.d.ts
CHANGED
package/layers.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 {ColorRange} from '@kepler.gl/constants';
|
|
5
|
+
|
|
4
6
|
export type LayerBaseConfig = {
|
|
5
7
|
dataId: string | null;
|
|
6
8
|
label: string;
|
|
@@ -97,6 +99,17 @@ export type LayerWeightConfig = {
|
|
|
97
99
|
weightField: VisualChannelField;
|
|
98
100
|
};
|
|
99
101
|
|
|
102
|
+
export type IndexBy = {
|
|
103
|
+
format: string;
|
|
104
|
+
type: string;
|
|
105
|
+
mappedValue: Record<number, string>;
|
|
106
|
+
timeDomain: {
|
|
107
|
+
domain: [number, number];
|
|
108
|
+
timeSteps: number[];
|
|
109
|
+
duration?: number;
|
|
110
|
+
};
|
|
111
|
+
};
|
|
112
|
+
|
|
100
113
|
export type Field = {
|
|
101
114
|
name: string;
|
|
102
115
|
displayName: string;
|
|
@@ -109,6 +122,8 @@ export type Field = {
|
|
|
109
122
|
filterProps?: FilterProps;
|
|
110
123
|
metadata?: Record<string, any>;
|
|
111
124
|
displayFormat?: string;
|
|
125
|
+
isLoadingStats?: boolean;
|
|
126
|
+
indexBy?: IndexBy;
|
|
112
127
|
};
|
|
113
128
|
|
|
114
129
|
export type FieldPair = {
|
|
@@ -145,6 +160,15 @@ export type LayerTextLabel = {
|
|
|
145
160
|
backgroundColor: RGBAColor;
|
|
146
161
|
};
|
|
147
162
|
|
|
163
|
+
export type ColorRangeConfig = {
|
|
164
|
+
type: string;
|
|
165
|
+
steps: number;
|
|
166
|
+
reversed: boolean;
|
|
167
|
+
custom: boolean;
|
|
168
|
+
customBreaks: boolean;
|
|
169
|
+
colorBlindSafe: boolean;
|
|
170
|
+
};
|
|
171
|
+
|
|
148
172
|
export type ColorUI = {
|
|
149
173
|
// customPalette in edit
|
|
150
174
|
customPalette: ColorRange;
|
|
@@ -155,13 +179,7 @@ export type ColorUI = {
|
|
|
155
179
|
// show color scale chart
|
|
156
180
|
showColorChart: boolean;
|
|
157
181
|
// color range selector config
|
|
158
|
-
colorRangeConfig:
|
|
159
|
-
type: string;
|
|
160
|
-
steps: number;
|
|
161
|
-
reversed: boolean;
|
|
162
|
-
custom: boolean;
|
|
163
|
-
customBreaks: boolean;
|
|
164
|
-
};
|
|
182
|
+
colorRangeConfig: ColorRangeConfig;
|
|
165
183
|
};
|
|
166
184
|
|
|
167
185
|
export type VisConfig = {
|
|
@@ -335,3 +353,21 @@ export type LayerTextConfig = {
|
|
|
335
353
|
textAnchor: TextConfigSelect;
|
|
336
354
|
textAlignment: TextConfigSelect;
|
|
337
355
|
};
|
|
356
|
+
|
|
357
|
+
export type LayerCallbacks = {
|
|
358
|
+
onLayerHover?: (idx: number, value: any) => void;
|
|
359
|
+
onSetLayerDomain?: (idx: number, value: any) => void;
|
|
360
|
+
onFilteredItemsChange?: (
|
|
361
|
+
idx: number,
|
|
362
|
+
event: {
|
|
363
|
+
id: string;
|
|
364
|
+
count: number;
|
|
365
|
+
}
|
|
366
|
+
) => void;
|
|
367
|
+
};
|
|
368
|
+
|
|
369
|
+
export type BindedLayerCallbacks = {
|
|
370
|
+
onLayerHover?: (value: any) => void;
|
|
371
|
+
onSetLayerDomain?: (value: any) => void;
|
|
372
|
+
onFilteredItemsChange?: (event: {id: string; count: number}) => void;
|
|
373
|
+
};
|
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.1.0-alpha.
|
|
4
|
+
"version": "3.1.0-alpha.2",
|
|
5
5
|
"description": "kepler.gl types used by kepler.gl components, actions and reducers",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"types": "index.d.ts",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"url": "https://github.com/keplergl/kepler.gl.git"
|
|
19
19
|
},
|
|
20
20
|
"scripts": {
|
|
21
|
-
"
|
|
21
|
+
"prepublishOnly": " ",
|
|
22
22
|
"stab": " "
|
|
23
23
|
},
|
|
24
24
|
"nyc": {
|
package/reducers.d.ts
CHANGED
|
@@ -79,6 +79,7 @@ export type LineChart = {
|
|
|
79
79
|
aggregation: string;
|
|
80
80
|
interval: string;
|
|
81
81
|
yAxis: string;
|
|
82
|
+
bins?: Bins;
|
|
82
83
|
};
|
|
83
84
|
|
|
84
85
|
type FilterViewType = 'side' | 'enlarged' | 'minified';
|
|
@@ -269,6 +270,7 @@ export type Timeline = {
|
|
|
269
270
|
defaultTimeFormat?: null | string;
|
|
270
271
|
timeFormat?: null | string;
|
|
271
272
|
timezone?: null | string;
|
|
273
|
+
timeBins?: null | Record<string, any>;
|
|
272
274
|
animationWindow?: null | Filter['animationWindow'];
|
|
273
275
|
marks?: null | number[];
|
|
274
276
|
} & Record<string, any>;
|
package/schemas.d.ts
CHANGED
|
@@ -60,11 +60,11 @@ export type SavedLayer = {
|
|
|
60
60
|
columns: {
|
|
61
61
|
[key: string]: string;
|
|
62
62
|
};
|
|
63
|
+
columnMode: string;
|
|
63
64
|
isVisible: boolean;
|
|
64
65
|
visConfig: Record<string, any>;
|
|
65
66
|
hidden: boolean;
|
|
66
67
|
textLabel: Merge<LayerTextLabel, {field: {name: string; type: string} | null}>;
|
|
67
|
-
columnMode: string;
|
|
68
68
|
};
|
|
69
69
|
visualChannels: SavedVisualChannels;
|
|
70
70
|
};
|
package/types.d.ts
CHANGED
|
@@ -33,3 +33,11 @@ export type ProcessorResult = {
|
|
|
33
33
|
cols?: any[];
|
|
34
34
|
metadata?: any;
|
|
35
35
|
} | null;
|
|
36
|
+
|
|
37
|
+
export type Json = JsonScalar | JsonArray | JsonObject;
|
|
38
|
+
export type JsonObjectOrArray = JsonArray | JsonObject;
|
|
39
|
+
export type JsonScalar = string | number | boolean | null;
|
|
40
|
+
export type JsonArray = Json[];
|
|
41
|
+
export type JsonObject = {
|
|
42
|
+
[key: string]: Json | undefined;
|
|
43
|
+
};
|