@kepler.gl/types 3.3.0-alpha.13 → 3.3.0-alpha.14

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 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
@@ -8,6 +8,7 @@ export * from './schemas';
8
8
  export * from './types';
9
9
  export * from './components';
10
10
  export * from './effects';
11
+ export * from './charts';
11
12
  export * from './annotations';
12
13
  export * from './datasets';
13
14
 
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.13",
4
+ "version": "3.3.0-alpha.14",
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
@@ -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: {
@@ -539,6 +541,8 @@ export type MapControls = {
539
541
  mapTheme?: MapControlItem;
540
542
  effect?: MapControlItem;
541
543
  annotation?: MapControlItem;
544
+ chart?: MapControlItem;
545
+ viewportJson?: MapControlItem;
542
546
  sqlPanel?: MapControlItem;
543
547
  aiAssistant?: MapControlItem;
544
548
  [key: string]: MapControlItem | MapControlMapLegend | undefined;
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;