@kepler.gl/types 3.1.0-alpha.1 → 3.1.0-alpha.3

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 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
@@ -8,3 +8,4 @@ export * from './schemas';
8
8
  export * from './types';
9
9
  export * from './components';
10
10
  export * from './effects';
11
+ export * from './datasets';
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 {HexColor} from './types';
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,36 @@ 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
+
172
+ export type ColorMap = [string[] | string | number | null, HexColor][];
173
+ // Key is HexColor but as key we can use only string
174
+ export type ColorLegends = {[key: HexColor]: string};
175
+
176
+ export type ColorRange = {
177
+ name?: string;
178
+ type?: string;
179
+ category?: string;
180
+ colors: HexColor[];
181
+ reversed?: boolean;
182
+ colorMap?: ColorMap;
183
+ colorLegends?: ColorLegends;
184
+ };
185
+
186
+ export type MiniColorRange = {
187
+ name: string;
188
+ type: string;
189
+ category: string;
190
+ colors: HexColor[];
191
+ };
192
+
148
193
  export type ColorUI = {
149
194
  // customPalette in edit
150
195
  customPalette: ColorRange;
@@ -155,13 +200,7 @@ export type ColorUI = {
155
200
  // show color scale chart
156
201
  showColorChart: boolean;
157
202
  // color range selector config
158
- colorRangeConfig: {
159
- type: string;
160
- steps: number;
161
- reversed: boolean;
162
- custom: boolean;
163
- customBreaks: boolean;
164
- };
203
+ colorRangeConfig: ColorRangeConfig;
165
204
  };
166
205
 
167
206
  export type VisConfig = {
@@ -335,3 +374,21 @@ export type LayerTextConfig = {
335
374
  textAnchor: TextConfigSelect;
336
375
  textAlignment: TextConfigSelect;
337
376
  };
377
+
378
+ export type LayerCallbacks = {
379
+ onLayerHover?: (idx: number, value: any) => void;
380
+ onSetLayerDomain?: (idx: number, value: any) => void;
381
+ onFilteredItemsChange?: (
382
+ idx: number,
383
+ event: {
384
+ id: string;
385
+ count: number;
386
+ }
387
+ ) => void;
388
+ };
389
+
390
+ export type BindedLayerCallbacks = {
391
+ onLayerHover?: (value: any) => void;
392
+ onSetLayerDomain?: (value: any) => void;
393
+ onFilteredItemsChange?: (event: {id: string; count: number}) => void;
394
+ };
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.1",
4
+ "version": "3.1.0-alpha.3",
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
- "prepublish": " ",
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
+ };