@kepler.gl/types 3.3.0-alpha.17 → 3.3.0-alpha.19

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 CHANGED
@@ -45,6 +45,20 @@ export type ProtoDatasetField = {
45
45
  id?: string;
46
46
  metadata?: Record<string, any>;
47
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
+
48
62
  export type ProtoDataset = {
49
63
  info: {
50
64
  id?: string;
@@ -59,6 +73,8 @@ export type ProtoDataset = {
59
73
  rows: any[][];
60
74
  cols?: any[];
61
75
  arrowTable?: arrow.Table;
76
+ /** GeoArrow chunks already converted to deck.gl binary features on workers. */
77
+ geoArrowBinaryData?: GeoArrowBinaryData;
62
78
  /** Existing table in the configured DuckDB database; avoids re-importing its rows. */
63
79
  duckdbTableName?: string;
64
80
  };
package/annotations.d.ts CHANGED
@@ -52,6 +52,21 @@ export type CircleAnnotation = AnnotationWithArm & {
52
52
  radiusInMeters: number;
53
53
  };
54
54
 
55
- export type Annotation = TextAnnotation | PointAnnotation | ArrowAnnotation | CircleAnnotation;
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;
56
71
 
57
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/index.d.ts CHANGED
@@ -11,5 +11,6 @@ export * from './effects';
11
11
  export * from './charts';
12
12
  export * from './annotations';
13
13
  export * from './datasets';
14
+ export * from './camera';
14
15
 
15
16
  export * as StacTypes from './stac';
package/layers.d.ts CHANGED
@@ -26,6 +26,10 @@ export type LayerBaseConfig = {
26
26
  animation: {
27
27
  enabled: boolean;
28
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;
29
33
  };
30
34
 
31
35
  // for aggregate layer, aggregatedBins is returned for custom color scale
@@ -318,6 +322,15 @@ export type VisConfigColorRange = VisConfig & {
318
322
  defaultValue: ColorRange;
319
323
  };
320
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
+
321
334
  export type LayerVisConfigTypes =
322
335
  | VisConfigBoolean
323
336
  | VisConfigNumber
@@ -326,6 +339,7 @@ export type LayerVisConfigTypes =
326
339
  | VisConfigColorSelect
327
340
  | VisConfigInput
328
341
  | VisConfigSelect
342
+ | VisConfigObject
329
343
  | VisConfigObjectSelection;
330
344
 
331
345
  export type LayerVisConfigSettings = {
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.17",
4
+ "version": "3.3.0-alpha.19",
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
@@ -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
  };
@@ -181,6 +181,7 @@ export type FilterBase<L extends LineChart> = {
181
181
  fixedDomain: boolean;
182
182
  view: FilterViewType;
183
183
  isAnimating: boolean;
184
+ animationWindow?: string;
184
185
  speed: number;
185
186
  showTimeDisplay?: boolean;
186
187
 
@@ -298,6 +299,7 @@ export interface TimeBins {
298
299
 
299
300
  export interface PlotType {
300
301
  interval: ValueOf<Interval>;
302
+ numericInterval?: number;
301
303
  type: ValueOf<PlotTypes>;
302
304
  aggregation: ValueOf<AggregationTypes>;
303
305
  defaultTimeFormat: string;
@@ -379,16 +381,9 @@ export type AnimationConfig = {
379
381
  hideControl?: boolean;
380
382
  };
381
383
 
382
- export type FilterAnimationConfig = Pick<
383
- TimeRangeFilter,
384
- | 'dataId'
385
- | 'value'
386
- | 'animationWindow'
387
- | 'speed'
388
- | 'syncedWithLayerTimeline'
389
- | 'syncTimelineMode'
390
- | 'timezone'
391
- >;
384
+ export type FilterAnimationConfig = Pick<Filter, 'dataId' | 'value' | 'speed'> &
385
+ Required<Pick<Filter, 'animationWindow'>> &
386
+ Partial<Pick<TimeRangeFilter, 'syncedWithLayerTimeline' | 'syncTimelineMode' | 'timezone'>>;
392
387
 
393
388
  export type Timeline = {
394
389
  domain: [number, number] | null;
@@ -590,6 +585,10 @@ export type ExportMap = {
590
585
  appName?: string;
591
586
  /** Optional application website override for exported HTML and JSON. */
592
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;
593
592
  };
594
593
 
595
594
  export type ExportVideo = {
package/schemas.d.ts CHANGED
@@ -3,10 +3,18 @@
3
3
 
4
4
  import {RGBColor, Merge, RequireFrom} from './types';
5
5
 
6
- import {Filter, InteractionConfig, AnimationConfig, SplitMap, Feature} from './reducers';
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';
9
16
  import {ChartConfig} from './charts';
17
+ import {CameraBookmark, CameraTour} from './camera';
10
18
 
11
19
  export type SavedFilter = {
12
20
  dataId: Filter['dataId'];
@@ -116,6 +124,8 @@ export type SavedEditor = {
116
124
  };
117
125
 
118
126
  export type SavedVisState = {
127
+ cameraTour?: CameraTour;
128
+ cameraBookmarks?: CameraBookmark[];
119
129
  filters: SavedFilter[];
120
130
  layers: SavedLayer[];
121
131
  effects: SavedEffect[];
@@ -133,6 +143,8 @@ export type SavedVisState = {
133
143
 
134
144
  // Min saved config can be passed to addDataToMap
135
145
  export type MinSavedVisStateV1 = {
146
+ cameraTour?: CameraTour;
147
+ cameraBookmarks?: CameraBookmark[];
136
148
  filters?: MinSavedFilter[];
137
149
  layers?: MinSavedLayer[];
138
150
  effects?: SavedEffect[];
@@ -146,6 +158,8 @@ export type MinSavedVisStateV1 = {
146
158
  };
147
159
 
148
160
  export type ParsedVisState = {
161
+ cameraTour?: CameraTour | null;
162
+ cameraBookmarks?: CameraBookmark[];
149
163
  layers?: ParsedLayer[];
150
164
  effects?: ParsedEffect[];
151
165
  charts?: ChartConfig[];
@@ -181,6 +195,10 @@ export type ParsedUiState = {
181
195
  active?: boolean;
182
196
  show?: boolean;
183
197
  };
198
+ cameraBookmarks?: {
199
+ show?: boolean;
200
+ settings?: Partial<MapLegendControlSettings>;
201
+ };
184
202
  };
185
203
  locale?: string;
186
204
  theme?: string;
@@ -301,6 +319,8 @@ export type SavedMap = {
301
319
  source?: string;
302
320
  appName?: string;
303
321
  appWebsite?: string;
322
+ appIcon?: string;
323
+ appNameColor?: string;
304
324
  };
305
325
  };
306
326
 
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;