@kepler.gl/types 3.3.0-alpha.13 → 3.3.0-alpha.15
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/charts.d.ts +86 -0
- package/index.d.ts +1 -0
- package/package.json +1 -1
- package/reducers.d.ts +7 -1
- package/schemas.d.ts +9 -1
package/charts.d.ts
ADDED
|
@@ -0,0 +1,86 @@
|
|
|
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
|
+
};
|
|
55
|
+
crossFilter?: ChartCrossFilter;
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
export type DatasetChartConfig = BaseChartConfig & {
|
|
59
|
+
xAxis?: ChartAxis;
|
|
60
|
+
yAxis?: ChartAxis;
|
|
61
|
+
groupBy?: ChartAxis;
|
|
62
|
+
value?: ChartAxis;
|
|
63
|
+
axis?: ChartAxis;
|
|
64
|
+
numGroups?: number;
|
|
65
|
+
groupOthers?: boolean;
|
|
66
|
+
/** How bar/series colors are assigned. */
|
|
67
|
+
colorBy?: 'none' | 'category' | string;
|
|
68
|
+
chartDisplay: Record<string, any>;
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
export type LayerChartConfig = BaseChartConfig & {
|
|
72
|
+
type: 'layerChart';
|
|
73
|
+
layerId: string;
|
|
74
|
+
layerChartType: string;
|
|
75
|
+
axis?: ChartAxis;
|
|
76
|
+
xAxis?: ChartAxis;
|
|
77
|
+
yAxis?: ChartAxis;
|
|
78
|
+
chartDisplay: {
|
|
79
|
+
idField?: string | null;
|
|
80
|
+
numEntries?: number;
|
|
81
|
+
interval?: string;
|
|
82
|
+
format?: string;
|
|
83
|
+
};
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
export type ChartConfig = DatasetChartConfig | LayerChartConfig;
|
package/index.d.ts
CHANGED
package/package.json
CHANGED
package/reducers.d.ts
CHANGED
|
@@ -461,6 +461,8 @@ export declare type ExportImage = {
|
|
|
461
461
|
ratio: EXPORT_IMG_RATIOS;
|
|
462
462
|
resolution: ExportResolutionOption;
|
|
463
463
|
legend: boolean;
|
|
464
|
+
/** When true, include the charts panel in the exported image. */
|
|
465
|
+
charts: boolean;
|
|
464
466
|
mapH: number;
|
|
465
467
|
mapW: number;
|
|
466
468
|
imageSize: {
|
|
@@ -475,6 +477,7 @@ export declare type ExportImage = {
|
|
|
475
477
|
error: Error | false;
|
|
476
478
|
center: boolean;
|
|
477
479
|
escapeXhtmlForWebpack?: boolean;
|
|
480
|
+
fileName: string;
|
|
478
481
|
};
|
|
479
482
|
|
|
480
483
|
export type ExportData = {
|
|
@@ -495,6 +498,7 @@ export type ExportMap = {
|
|
|
495
498
|
HTML: ExportHtml;
|
|
496
499
|
JSON: ExportJson;
|
|
497
500
|
format: 'HTML' | 'JSON';
|
|
501
|
+
fileName: string;
|
|
498
502
|
};
|
|
499
503
|
|
|
500
504
|
export type ExportVideo = {
|
|
@@ -539,6 +543,8 @@ export type MapControls = {
|
|
|
539
543
|
mapTheme?: MapControlItem;
|
|
540
544
|
effect?: MapControlItem;
|
|
541
545
|
annotation?: MapControlItem;
|
|
546
|
+
chart?: MapControlItem;
|
|
547
|
+
viewportJson?: MapControlItem;
|
|
542
548
|
sqlPanel?: MapControlItem;
|
|
543
549
|
aiAssistant?: MapControlItem;
|
|
544
550
|
[key: string]: MapControlItem | MapControlMapLegend | undefined;
|
|
@@ -585,7 +591,7 @@ export type UiState = {
|
|
|
585
591
|
loadFiles: LoadFiles;
|
|
586
592
|
// Locale of the UI
|
|
587
593
|
locale: Locale;
|
|
588
|
-
// Theme of the UI (`light` | `dark`)
|
|
594
|
+
// Theme of the UI (`light` | `dark` | `space`). First of `themes` is the default when set.
|
|
589
595
|
theme: UiTheme;
|
|
590
596
|
// view layers by list or dataset
|
|
591
597
|
layerPanelListView: PanelListView;
|
package/schemas.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ import {RGBColor, Merge, RequireFrom} from './types';
|
|
|
6
6
|
import {Filter, InteractionConfig, AnimationConfig, SplitMap, Feature} from './reducers';
|
|
7
7
|
|
|
8
8
|
import {LayerTextLabel} from './layers';
|
|
9
|
+
import {ChartConfig} from './charts';
|
|
9
10
|
|
|
10
11
|
export type SavedFilter = {
|
|
11
12
|
dataId: Filter['dataId'];
|
|
@@ -91,6 +92,8 @@ export type SavedEffect = ParsedEffect;
|
|
|
91
92
|
export type SavedAnimationConfig = {
|
|
92
93
|
currentTime: AnimationConfig['currentTime'];
|
|
93
94
|
speed: AnimationConfig['speed'];
|
|
95
|
+
timeFormat?: AnimationConfig['timeFormat'];
|
|
96
|
+
timezone?: AnimationConfig['timezone'];
|
|
94
97
|
};
|
|
95
98
|
|
|
96
99
|
export type SavedEditor = {
|
|
@@ -102,6 +105,7 @@ export type SavedVisState = {
|
|
|
102
105
|
filters: SavedFilter[];
|
|
103
106
|
layers: SavedLayer[];
|
|
104
107
|
effects: SavedEffect[];
|
|
108
|
+
charts?: ChartConfig[];
|
|
105
109
|
interactionConfig: SavedInteractionConfig;
|
|
106
110
|
layerBlending: string;
|
|
107
111
|
overlayBlending?: string;
|
|
@@ -116,6 +120,7 @@ export type MinSavedVisStateV1 = {
|
|
|
116
120
|
filters?: MinSavedFilter[];
|
|
117
121
|
layers?: MinSavedLayer[];
|
|
118
122
|
effects?: SavedEffect[];
|
|
123
|
+
charts?: ChartConfig[];
|
|
119
124
|
interactionConfig?: Partial<SavedInteractionConfig>;
|
|
120
125
|
layerBlending?: string;
|
|
121
126
|
overlayBlending?: string;
|
|
@@ -127,8 +132,8 @@ export type MinSavedVisStateV1 = {
|
|
|
127
132
|
export type ParsedVisState = {
|
|
128
133
|
layers?: ParsedLayer[];
|
|
129
134
|
effects?: ParsedEffect[];
|
|
135
|
+
charts?: ChartConfig[];
|
|
130
136
|
filters?: ParsedFilter[];
|
|
131
|
-
effects?: ParsedEffect[];
|
|
132
137
|
interactionConfig?: Partial<SavedInteractionConfig>;
|
|
133
138
|
layerBlending?: string;
|
|
134
139
|
overlayBlending?: string;
|
|
@@ -151,6 +156,9 @@ export type ParsedUiState = {
|
|
|
151
156
|
contentHeight?: number;
|
|
152
157
|
};
|
|
153
158
|
};
|
|
159
|
+
chart?: {
|
|
160
|
+
active?: boolean;
|
|
161
|
+
};
|
|
154
162
|
};
|
|
155
163
|
locale?: string;
|
|
156
164
|
theme?: string;
|