@kepler.gl/constants 3.3.0-alpha.2 → 3.3.0-alpha.21
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/dist/annotation.d.ts +23 -1
- package/dist/cjs/annotation.js +89 -0
- package/dist/cjs/annotation.js.map +1 -0
- package/dist/cjs/color-palettes.js +461 -0
- package/dist/cjs/color-palettes.js.map +1 -0
- package/dist/cjs/colors-by-theme.js +519 -0
- package/dist/cjs/colors-by-theme.js.map +1 -0
- package/dist/cjs/dataset.js +209 -0
- package/dist/cjs/dataset.js.map +1 -0
- package/dist/cjs/default-settings.js +1813 -0
- package/dist/cjs/default-settings.js.map +1 -0
- package/dist/cjs/gpu-parameters.js +125 -0
- package/dist/cjs/gpu-parameters.js.map +1 -0
- package/dist/cjs/index.js +149 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/keyevent.js +26 -0
- package/dist/cjs/keyevent.js.map +1 -0
- package/dist/cjs/layers.js +671 -0
- package/dist/cjs/layers.js.map +1 -0
- package/dist/cjs/plot.js +16 -0
- package/dist/cjs/plot.js.map +1 -0
- package/dist/cjs/time.js +194 -0
- package/dist/cjs/time.js.map +1 -0
- package/dist/cjs/tooltip.js +221 -0
- package/dist/cjs/tooltip.js.map +1 -0
- package/dist/cjs/user-feedbacks.js +15 -0
- package/dist/cjs/user-feedbacks.js.map +1 -0
- package/dist/cjs/user-guides.js +19 -0
- package/dist/cjs/user-guides.js.map +1 -0
- package/dist/dataset.d.ts +161 -5
- package/dist/default-settings.d.ts +139 -14
- package/dist/esm/annotation.js +79 -0
- package/dist/esm/annotation.js.map +1 -0
- package/dist/esm/color-palettes.js +453 -0
- package/dist/esm/color-palettes.js.map +1 -0
- package/dist/esm/colors-by-theme.js +513 -0
- package/dist/esm/colors-by-theme.js.map +1 -0
- package/dist/esm/dataset.js +204 -0
- package/dist/esm/dataset.js.map +1 -0
- package/dist/esm/default-settings.js +1807 -0
- package/dist/esm/default-settings.js.map +1 -0
- package/dist/esm/gpu-parameters.js +119 -0
- package/dist/esm/gpu-parameters.js.map +1 -0
- package/dist/esm/index.js +18 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/keyevent.js +19 -0
- package/dist/esm/keyevent.js.map +1 -0
- package/dist/esm/layers.js +664 -0
- package/dist/esm/layers.js.map +1 -0
- package/dist/esm/plot.js +9 -0
- package/dist/esm/plot.js.map +1 -0
- package/dist/esm/time.js +190 -0
- package/dist/esm/time.js.map +1 -0
- package/dist/esm/tooltip.js +215 -0
- package/dist/esm/tooltip.js.map +1 -0
- package/dist/esm/user-feedbacks.js +9 -0
- package/dist/esm/user-feedbacks.js.map +1 -0
- package/dist/esm/user-guides.js +13 -0
- package/dist/esm/user-guides.js.map +1 -0
- package/dist/layers.d.ts +9 -0
- package/package.json +21 -14
- package/dist/annotation.js +0 -45
- package/dist/color-palettes.js +0 -462
- package/dist/colors-by-theme.js +0 -519
- package/dist/dataset.js +0 -82
- package/dist/default-settings.js +0 -1651
- package/dist/gpu-parameters.js +0 -125
- package/dist/index.js +0 -149
- package/dist/keyevent.js +0 -26
- package/dist/layers.js +0 -605
- package/dist/plot.js +0 -16
- package/dist/time.js +0 -194
- package/dist/tooltip.js +0 -221
- package/dist/user-feedbacks.js +0 -15
- package/dist/user-guides.js +0 -19
- package/umd/keplergl.min.js +0 -58
package/dist/dataset.d.ts
CHANGED
|
@@ -1,11 +1,64 @@
|
|
|
1
1
|
export declare enum DatasetType {
|
|
2
2
|
LOCAL = "local",
|
|
3
|
+
EXTERNALLY_HOSTED = "externally-hosted",
|
|
3
4
|
VECTOR_TILE = "vector-tile",
|
|
4
5
|
RASTER_TILE = "raster-tile",
|
|
5
6
|
WMS_TILE = "wms-tile",
|
|
6
7
|
TILE_3D = "tile-3d",
|
|
7
|
-
BITMAP = "bitmap"
|
|
8
|
+
BITMAP = "bitmap",
|
|
9
|
+
ZARR = "zarr"
|
|
8
10
|
}
|
|
11
|
+
export declare const REMOTE_FILE_FORMATS: readonly ["auto", "csv", "geojson", "json", "arrow", "parquet", "geojsonl", "ndjson", "kml", "gpx", "tcx", "shp", "xlsx", "fgb"];
|
|
12
|
+
export type RemoteFileFormat = (typeof REMOTE_FILE_FORMATS)[number];
|
|
13
|
+
export declare const REMOTE_FILE_MIME_TYPES: Record<Exclude<RemoteFileFormat, 'auto'>, string>;
|
|
14
|
+
export declare const REMOTE_FILE_EXTENSIONS: Record<Exclude<RemoteFileFormat, 'auto'>, string>;
|
|
15
|
+
export declare const MIME_TO_REMOTE_FILE_EXTENSION: Record<string, string>;
|
|
16
|
+
export declare const DATASET_REFRESH_INTERVAL_OPTIONS: {
|
|
17
|
+
value: number;
|
|
18
|
+
labelId: string;
|
|
19
|
+
}[];
|
|
20
|
+
/** Select value for a user-entered interval that is not one of the presets. */
|
|
21
|
+
export declare const DATASET_REFRESH_CUSTOM_VALUE = "custom";
|
|
22
|
+
/** Default custom poll interval when switching from Off to Custom. */
|
|
23
|
+
export declare const DATASET_REFRESH_DEFAULT_CUSTOM_MS = 30000;
|
|
24
|
+
export declare const DATASET_REFRESH_MIN_INTERVAL_MS = 100;
|
|
25
|
+
export declare function isPresetDatasetRefreshInterval(ms: number): boolean;
|
|
26
|
+
export type ExternalDatasetRefreshStatus = 'idle' | 'loading' | 'error';
|
|
27
|
+
export type ExternalDatasetMetadata = {
|
|
28
|
+
/** Remote URL of the dataset file. */
|
|
29
|
+
source: string;
|
|
30
|
+
/** Optional format hint for extensionless URLs (SAS keys, etc). */
|
|
31
|
+
format?: Exclude<RemoteFileFormat, 'auto'> | string;
|
|
32
|
+
/** Last known size of the hosted resource, in bytes. */
|
|
33
|
+
size?: number;
|
|
34
|
+
/** Poll interval in ms. Omitted or 0 means manual refresh only. */
|
|
35
|
+
refreshIntervalMs?: number;
|
|
36
|
+
};
|
|
37
|
+
/** Runtime copy of {@link ExternalDatasetMetadata} with `format` renamed to avoid colliding with DATASET_FORMATS. */
|
|
38
|
+
export type ExternalDatasetRuntimeMetadata = {
|
|
39
|
+
source: string;
|
|
40
|
+
sourceFormat?: Exclude<RemoteFileFormat, 'auto'> | string;
|
|
41
|
+
size?: number;
|
|
42
|
+
refreshIntervalMs?: number;
|
|
43
|
+
etag?: string;
|
|
44
|
+
lastModified?: string;
|
|
45
|
+
lastFetchedAt?: number;
|
|
46
|
+
refreshStatus?: ExternalDatasetRefreshStatus;
|
|
47
|
+
refreshError?: string;
|
|
48
|
+
/** Download progress 0–100 while `refreshStatus` is `loading`. */
|
|
49
|
+
refreshProgress?: number;
|
|
50
|
+
};
|
|
51
|
+
export declare function getDatasetRefreshIntervalMs(metadata?: {
|
|
52
|
+
refreshIntervalMs?: unknown;
|
|
53
|
+
}): number;
|
|
54
|
+
/** Parse a seconds field into ms, or null if the input is not a positive number. */
|
|
55
|
+
export declare function parseCustomRefreshIntervalMs(secondsText: string): number | null;
|
|
56
|
+
/** Display string for the custom seconds input (keeps tenths for sub-second values). */
|
|
57
|
+
export declare function formatCustomRefreshSeconds(ms: number): string;
|
|
58
|
+
export declare function getRemoteSourceFormat(metadata?: {
|
|
59
|
+
sourceFormat?: unknown;
|
|
60
|
+
format?: unknown;
|
|
61
|
+
}): string | undefined;
|
|
9
62
|
export declare enum RemoteTileFormat {
|
|
10
63
|
MVT = "mvt",
|
|
11
64
|
PMTILES = "pmtiles",
|
|
@@ -54,17 +107,120 @@ export type RasterTileMetadataSourceType = {
|
|
|
54
107
|
* Raster tileset metadata.
|
|
55
108
|
*/
|
|
56
109
|
export type RasterTileDatasetMetadata = (RasterTileLocalMetadata | RasterTileRemoteMetadata) & RasterTileMetadataSourceType;
|
|
110
|
+
export type WMSServiceLayer = {
|
|
111
|
+
name: string;
|
|
112
|
+
title: string;
|
|
113
|
+
boundingBox: number[] | null;
|
|
114
|
+
queryable?: boolean;
|
|
115
|
+
legendUrl?: string | null;
|
|
116
|
+
};
|
|
57
117
|
export type WMSDatasetMetadata = {
|
|
58
118
|
type: typeof REMOTE_TILE;
|
|
59
119
|
remoteTileFormat: RemoteTileFormat.WMS;
|
|
60
120
|
tilesetDataUrl: string;
|
|
61
121
|
tilesetMetadataUrl: string;
|
|
62
122
|
version: string;
|
|
63
|
-
layers:
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
123
|
+
layers: WMSServiceLayer[];
|
|
124
|
+
label?: string;
|
|
125
|
+
attribution?: string;
|
|
126
|
+
};
|
|
127
|
+
/** A non-spatial dimension of a Zarr variable, e.g. `time`, `band`, `depth`. */
|
|
128
|
+
export type ZarrDimensionInfo = {
|
|
129
|
+
name: string;
|
|
130
|
+
size: number;
|
|
131
|
+
/**
|
|
132
|
+
* Coordinate values for the dimension, when the store exposes a matching
|
|
133
|
+
* coordinate array. Time coordinates are decoded to epoch milliseconds.
|
|
134
|
+
*/
|
|
135
|
+
values?: (number | string | boolean)[];
|
|
136
|
+
/** Preserve coordinate semantics instead of guessing from its name or dtype. */
|
|
137
|
+
kind?: 'time' | 'duration' | 'number' | 'category';
|
|
138
|
+
units?: string;
|
|
139
|
+
calendar?: string;
|
|
140
|
+
standardName?: string;
|
|
141
|
+
/** Original offsets for decoded CF time coordinates. */
|
|
142
|
+
rawValues?: (number | string | boolean)[];
|
|
143
|
+
};
|
|
144
|
+
/** Empty/missing keeps the original automatic layer time axis. */
|
|
145
|
+
export type ZarrAxisConfig = {
|
|
146
|
+
kind?: 'auto' | 'off';
|
|
147
|
+
} | {
|
|
148
|
+
kind: 'dimension';
|
|
149
|
+
dimension: string;
|
|
150
|
+
} | {
|
|
151
|
+
kind: 'forecast';
|
|
152
|
+
referenceTime: string;
|
|
153
|
+
leadTime: string;
|
|
154
|
+
};
|
|
155
|
+
export type ZarrVariableInfo = {
|
|
156
|
+
/** Path of the variable within the Zarr group. Empty for a root-level array. */
|
|
157
|
+
path: string;
|
|
158
|
+
/**
|
|
159
|
+
* Node to open for rendering, when it differs from `path`. A pyramid keeps
|
|
160
|
+
* its levels under a shared parent, so the renderer is handed that parent
|
|
161
|
+
* while each variable keeps its own identity.
|
|
162
|
+
*/
|
|
163
|
+
nodePath?: string;
|
|
164
|
+
/** Name of the array itself, i.e. the last path segment. */
|
|
165
|
+
name: string;
|
|
166
|
+
/**
|
|
167
|
+
* Label to show in variable pickers. Equal to `name`, qualified with enough
|
|
168
|
+
* leading path segments to stay unique when sibling groups hold arrays of the
|
|
169
|
+
* same name, e.g. `FUTUR/evap_total` and `HISTO/evap_total`.
|
|
170
|
+
*/
|
|
171
|
+
displayName: string;
|
|
172
|
+
/**
|
|
173
|
+
* GeoZarr-convention attributes describing the spatial grid. Taken from the
|
|
174
|
+
* store when it declares them, otherwise derived from CF/GDAL metadata.
|
|
175
|
+
*/
|
|
176
|
+
geoAttrs?: Record<string, unknown>;
|
|
177
|
+
/** Parsed grid and pyramid settings for this variable, independent of the active variable. */
|
|
178
|
+
spatialMetadata?: Pick<ZarrDatasetMetadata, 'crs' | 'axes' | 'xAxisIndex' | 'yAxisIndex' | 'levels' | 'webMercatorPyramid'>;
|
|
179
|
+
/** Shape of the finest resolution level. */
|
|
180
|
+
shape: number[];
|
|
181
|
+
/** Chunk shape of the finest resolution level. */
|
|
182
|
+
chunks: number[];
|
|
183
|
+
dtype: string;
|
|
184
|
+
/** Non-spatial dimensions, in array order. */
|
|
185
|
+
nonSpatialDims: ZarrDimensionInfo[];
|
|
186
|
+
/** The non-spatial dimension recognized as time, when present. */
|
|
187
|
+
timeDimension?: ZarrDimensionInfo;
|
|
188
|
+
/** Value range advertised by the array attrs, used as the default rescale. */
|
|
189
|
+
dataRange?: [number, number];
|
|
190
|
+
/** Fill value advertised by the array attrs or zarr metadata. */
|
|
191
|
+
nodataValue?: number;
|
|
192
|
+
};
|
|
193
|
+
export type ZarrDatasetMetadata = {
|
|
194
|
+
/** Root URL of the Zarr store. */
|
|
195
|
+
url: string;
|
|
196
|
+
/** Path of the selected variable within the store. */
|
|
197
|
+
variable?: string;
|
|
198
|
+
crs?: {
|
|
199
|
+
code?: string;
|
|
200
|
+
wkt2?: string;
|
|
201
|
+
};
|
|
202
|
+
/** Axis names of the selected variable, e.g. `['time', 'y', 'x']`. */
|
|
203
|
+
axes: string[];
|
|
204
|
+
xAxisIndex: number;
|
|
205
|
+
yAxisIndex: number;
|
|
206
|
+
/** Resolution levels, finest first. */
|
|
207
|
+
levels: {
|
|
208
|
+
path: string;
|
|
209
|
+
shape: number[];
|
|
210
|
+
chunks: number[];
|
|
67
211
|
}[];
|
|
212
|
+
/**
|
|
213
|
+
* Set when every level is reprojected to EPSG:3857 and spans the whole world,
|
|
214
|
+
* which is what `ndpyramid`'s `pyramid_reproject` writes. The level to draw
|
|
215
|
+
* then follows the map zoom rather than the data's own resolution.
|
|
216
|
+
*/
|
|
217
|
+
webMercatorPyramid?: boolean;
|
|
218
|
+
/** Every renderable variable in the store, for the variable picker. */
|
|
219
|
+
variables: ZarrVariableInfo[];
|
|
220
|
+
nonSpatialDims: ZarrDimensionInfo[];
|
|
221
|
+
timeDimension?: ZarrDimensionInfo;
|
|
222
|
+
dataRange?: [number, number];
|
|
223
|
+
nodataValue?: number;
|
|
68
224
|
label?: string;
|
|
69
225
|
attribution?: string;
|
|
70
226
|
};
|
|
@@ -109,7 +109,8 @@ export declare const DIMENSIONS: {
|
|
|
109
109
|
};
|
|
110
110
|
/**
|
|
111
111
|
* Theme name that can be passed to `KeplerGl` `prop.theme`.
|
|
112
|
-
* Available themes are `THEME.light
|
|
112
|
+
* Available themes are `THEME.light`, `THEME.dark`, and `THEME.space`.
|
|
113
|
+
* Default theme is `THEME.dark`
|
|
113
114
|
* @constant
|
|
114
115
|
* @type {object}
|
|
115
116
|
* @public
|
|
@@ -121,6 +122,7 @@ export declare const DIMENSIONS: {
|
|
|
121
122
|
export declare const THEME: {
|
|
122
123
|
light: "light";
|
|
123
124
|
dark: "dark";
|
|
125
|
+
space: "space";
|
|
124
126
|
base: "base";
|
|
125
127
|
};
|
|
126
128
|
export declare const SIDEBAR_PANELS: {
|
|
@@ -223,6 +225,7 @@ export type SCALE_TYPES_DEF = {
|
|
|
223
225
|
ordinal: 'ordinal';
|
|
224
226
|
quantile: 'quantile';
|
|
225
227
|
quantize: 'quantize';
|
|
228
|
+
jenks: 'jenks';
|
|
226
229
|
linear: 'linear';
|
|
227
230
|
sqrt: 'sqrt';
|
|
228
231
|
log: 'log';
|
|
@@ -242,6 +245,7 @@ export declare const SCALE_FUNC: {
|
|
|
242
245
|
linear: typeof scaleLinear;
|
|
243
246
|
quantize: typeof scaleQuantize;
|
|
244
247
|
quantile: typeof scaleQuantile;
|
|
248
|
+
jenks: typeof scaleThreshold;
|
|
245
249
|
ordinal: typeof scaleOrdinal;
|
|
246
250
|
sqrt: typeof scaleSqrt;
|
|
247
251
|
log: typeof scaleLog;
|
|
@@ -277,9 +281,14 @@ export declare const TABLE_OPTION: {
|
|
|
277
281
|
UNPIN: "UNPIN";
|
|
278
282
|
COPY: "COPY";
|
|
279
283
|
FORMAT_COLUMN: "FORMAT_COLUMN";
|
|
284
|
+
HIDE: "HIDE";
|
|
285
|
+
RENAME: "RENAME";
|
|
286
|
+
CHANGE_TYPE: "CHANGE_TYPE";
|
|
287
|
+
DELETE: "DELETE";
|
|
288
|
+
CREATE_FILTER: "CREATE_FILTER";
|
|
280
289
|
};
|
|
281
290
|
export type TableOption = {
|
|
282
|
-
value: 'SORT_ASC' | 'SORT_DES' | 'UNSORT' | 'PIN' | 'UNPIN' | 'COPY' | 'FORMAT_COLUMN';
|
|
291
|
+
value: 'SORT_ASC' | 'SORT_DES' | 'UNSORT' | 'PIN' | 'UNPIN' | 'COPY' | 'FORMAT_COLUMN' | 'HIDE' | 'RENAME' | 'CHANGE_TYPE' | 'DELETE' | 'CREATE_FILTER';
|
|
283
292
|
display: string;
|
|
284
293
|
icon: string;
|
|
285
294
|
condition?: (props: any) => boolean;
|
|
@@ -364,7 +373,7 @@ export declare const AGGREGATION_TYPE_OPTIONS: {
|
|
|
364
373
|
label: string;
|
|
365
374
|
}[];
|
|
366
375
|
export declare const linearFieldScaleFunctions: {
|
|
367
|
-
color: ("custom" | "quantile" | "quantize")[];
|
|
376
|
+
color: ("custom" | "quantile" | "quantize" | "jenks")[];
|
|
368
377
|
radius: "sqrt"[];
|
|
369
378
|
size: ("linear" | "sqrt" | "log")[];
|
|
370
379
|
angle: "linear"[];
|
|
@@ -407,7 +416,7 @@ export declare const notSupportAggrOpts: {
|
|
|
407
416
|
*/
|
|
408
417
|
export declare const DEFAULT_AGGREGATION: {
|
|
409
418
|
colorAggr: {
|
|
410
|
-
count: ("custom" | "quantile" | "quantize")[];
|
|
419
|
+
count: ("custom" | "quantile" | "quantize" | "jenks")[];
|
|
411
420
|
};
|
|
412
421
|
sizeAggr: {
|
|
413
422
|
count: ("linear" | "sqrt" | "log")[];
|
|
@@ -447,7 +456,7 @@ export declare const FIELD_OPTS: {
|
|
|
447
456
|
sum: ("linear" | "sqrt" | "log")[];
|
|
448
457
|
variance: ("linear" | "sqrt" | "log")[];
|
|
449
458
|
};
|
|
450
|
-
color: ("custom" | "quantile" | "quantize")[];
|
|
459
|
+
color: ("custom" | "quantile" | "quantize" | "jenks")[];
|
|
451
460
|
radius: "sqrt"[];
|
|
452
461
|
size: ("linear" | "sqrt" | "log")[];
|
|
453
462
|
angle: "linear"[];
|
|
@@ -462,7 +471,7 @@ export declare const FIELD_OPTS: {
|
|
|
462
471
|
scale: {
|
|
463
472
|
colorAggr: {};
|
|
464
473
|
sizeAggr: {};
|
|
465
|
-
color: ("custom" | "quantile" | "quantize")[];
|
|
474
|
+
color: ("custom" | "quantile" | "quantize" | "jenks")[];
|
|
466
475
|
radius: "sqrt"[];
|
|
467
476
|
size: ("linear" | "sqrt" | "log")[];
|
|
468
477
|
angle: "linear"[];
|
|
@@ -485,7 +494,7 @@ export declare const FIELD_OPTS: {
|
|
|
485
494
|
sum: ("linear" | "sqrt" | "log")[];
|
|
486
495
|
variance: ("linear" | "sqrt" | "log")[];
|
|
487
496
|
};
|
|
488
|
-
color: ("custom" | "quantile" | "quantize" | "customOrdinal")[];
|
|
497
|
+
color: ("custom" | "quantile" | "quantize" | "jenks" | "customOrdinal")[];
|
|
489
498
|
radius: "sqrt"[];
|
|
490
499
|
size: ("linear" | "sqrt" | "log")[];
|
|
491
500
|
angle: "linear"[];
|
|
@@ -601,6 +610,8 @@ export declare const DEFAULT_LAYER_COLOR_PALETTE = "Global Warming";
|
|
|
601
610
|
export declare const DEFAULT_LAYER_COLOR_PALETTE_STEPS = 6;
|
|
602
611
|
export declare const DEFAULT_TOOLTIP_FIELDS: any[];
|
|
603
612
|
export declare const NO_VALUE_COLOR: RGBAColor;
|
|
613
|
+
/** Visible gray used when a color field has no value and missing features should stay on the map. */
|
|
614
|
+
export declare const MISSING_VALUE_COLOR: RGBAColor;
|
|
604
615
|
export declare const DEFAULT_PICKING_RADIUS = 3;
|
|
605
616
|
export declare const OVERLAY_BLENDINGS: {
|
|
606
617
|
normal: {
|
|
@@ -682,12 +693,42 @@ export declare const Resolution1920x1440Option: ImageResolutionOption;
|
|
|
682
693
|
export declare const EXPORT_IMG_RESOLUTION_OPTIONS: ReadonlyArray<ImageResolutionOption>;
|
|
683
694
|
export declare const EXPORT_DATA_TYPE: {
|
|
684
695
|
CSV: "CSV";
|
|
685
|
-
|
|
686
|
-
|
|
696
|
+
GEOJSON: "GEOJSON";
|
|
697
|
+
GEOPARQUET: "GEOPARQUET";
|
|
698
|
+
SHAPEFILE: "SHAPEFILE";
|
|
699
|
+
GEOPACKAGE: "GEOPACKAGE";
|
|
700
|
+
KML: "KML";
|
|
701
|
+
KMZ: "KMZ";
|
|
702
|
+
};
|
|
703
|
+
export declare const EXPORT_DATA_TYPE_OPTIONS: ({
|
|
687
704
|
id: "CSV";
|
|
688
705
|
label: string;
|
|
689
706
|
available: boolean;
|
|
690
|
-
}
|
|
707
|
+
} | {
|
|
708
|
+
id: "GEOJSON";
|
|
709
|
+
label: string;
|
|
710
|
+
available: boolean;
|
|
711
|
+
} | {
|
|
712
|
+
id: "GEOPARQUET";
|
|
713
|
+
label: string;
|
|
714
|
+
available: boolean;
|
|
715
|
+
} | {
|
|
716
|
+
id: "SHAPEFILE";
|
|
717
|
+
label: string;
|
|
718
|
+
available: boolean;
|
|
719
|
+
} | {
|
|
720
|
+
id: "GEOPACKAGE";
|
|
721
|
+
label: string;
|
|
722
|
+
available: boolean;
|
|
723
|
+
} | {
|
|
724
|
+
id: "KML";
|
|
725
|
+
label: string;
|
|
726
|
+
available: boolean;
|
|
727
|
+
} | {
|
|
728
|
+
id: "KMZ";
|
|
729
|
+
label: string;
|
|
730
|
+
available: boolean;
|
|
731
|
+
})[];
|
|
691
732
|
export declare const EXPORT_MAP_FORMATS: {
|
|
692
733
|
HTML: "HTML";
|
|
693
734
|
JSON: "JSON";
|
|
@@ -764,8 +805,12 @@ export declare const EDITOR_LAYER_PICKING_RADIUS = 6;
|
|
|
764
805
|
export declare const EDITOR_MODES: {
|
|
765
806
|
DRAW_POLYGON: string;
|
|
766
807
|
DRAW_RECTANGLE: string;
|
|
808
|
+
DRAW_CIRCLE: string;
|
|
809
|
+
DRAW_LINESTRING: string;
|
|
810
|
+
DRAW_POINT: string;
|
|
767
811
|
EDIT: string;
|
|
768
812
|
};
|
|
813
|
+
export declare const EDITOR_DRAW_MODES: string[];
|
|
769
814
|
export declare const PLOT_TYPES: {
|
|
770
815
|
histogram: "histogram";
|
|
771
816
|
lineChart: "lineChart";
|
|
@@ -804,10 +849,82 @@ export declare const MAP_CONTROLS: {
|
|
|
804
849
|
splitMap: "splitMap";
|
|
805
850
|
mapDraw: "mapDraw";
|
|
806
851
|
mapLocale: "mapLocale";
|
|
852
|
+
mapTheme: "mapTheme";
|
|
807
853
|
effect: "effect";
|
|
808
854
|
annotation: "annotation";
|
|
809
|
-
|
|
810
|
-
|
|
855
|
+
chart: "chart";
|
|
856
|
+
viewportJson: "viewportJson";
|
|
857
|
+
mapInfo: "mapInfo";
|
|
858
|
+
};
|
|
859
|
+
export declare enum MapViewMode {
|
|
860
|
+
MODE_2D = "MODE_2D",
|
|
861
|
+
MODE_3D = "MODE_3D",
|
|
862
|
+
MODE_GLOBE = "MODE_GLOBE"
|
|
863
|
+
}
|
|
864
|
+
/**
|
|
865
|
+
* Minimum zoom level allowed in globe mode. Negative values let the user zoom
|
|
866
|
+
* out further than the web-mercator default of 0, so the whole globe can be
|
|
867
|
+
* pulled back to appear smaller on screen.
|
|
868
|
+
*/
|
|
869
|
+
export declare const GLOBE_MIN_ZOOM = 2;
|
|
870
|
+
/**
|
|
871
|
+
* Maximum zoom in globe mode.
|
|
872
|
+
*
|
|
873
|
+
* The previous "empty rectangles" at high zoom were caused by the vector basemap
|
|
874
|
+
* layer declaring `maxZoom: 23` while the raw tile endpoints only have data to
|
|
875
|
+
* z16 (mapbox-streets-v8) / z14 (CARTO) — deck then requested non-existent tiles
|
|
876
|
+
* that 404. That is fixed in `getGlobeBaseLayers` by setting `maxZoom` to each
|
|
877
|
+
* source's true data max so deck overzooms instead.
|
|
878
|
+
*
|
|
879
|
+
* The remaining practical ceiling is float32 precision: deck's globe places
|
|
880
|
+
* geometry in common space on a sphere of radius 256 with no fp64/relative-to-
|
|
881
|
+
* center trick, so beyond ~visual-zoom 16 (roughly this mapState zoom minus
|
|
882
|
+
* `zoomAdjust(lat)` ≈ 1.65 at the equator) geometry starts to jitter/drift.
|
|
883
|
+
*/
|
|
884
|
+
export declare const GLOBE_MAX_ZOOM = 16;
|
|
885
|
+
/**
|
|
886
|
+
* Maximum absolute center latitude allowed in globe mode. Constrains the camera
|
|
887
|
+
* target to a band around the equator so the view can't be centered on the
|
|
888
|
+
* poles (deck.gl's default clamps to ~85°, which lets the camera stare straight
|
|
889
|
+
* down at a pole). Applies symmetrically to the northern and southern hemisphere.
|
|
890
|
+
*/
|
|
891
|
+
export declare const GLOBE_MAX_LATITUDE = 75;
|
|
892
|
+
export type GlobeConfig = {
|
|
893
|
+
atmosphere: boolean;
|
|
894
|
+
/**
|
|
895
|
+
* When true, draw a large sun-independent uniform glow in addition to the
|
|
896
|
+
* realistic scattering sky halo.
|
|
897
|
+
*/
|
|
898
|
+
hugeHalo: boolean;
|
|
899
|
+
/**
|
|
900
|
+
* Multiplier for huge-halo shell thickness. `1` is the baseline (~14% beyond
|
|
901
|
+
* the globe); the configured default is 3.5.
|
|
902
|
+
*/
|
|
903
|
+
hugeHaloRadius: number;
|
|
904
|
+
/** Opacity of the huge-halo glow (0–1). Default: 0.2. */
|
|
905
|
+
hugeHaloOpacity: number;
|
|
906
|
+
azimuth: boolean;
|
|
907
|
+
azimuthAngle: number;
|
|
908
|
+
terminator: boolean;
|
|
909
|
+
terminatorOpacity: number;
|
|
910
|
+
basemap: boolean;
|
|
911
|
+
labels: boolean;
|
|
912
|
+
labelsColor: [number, number, number];
|
|
913
|
+
adminLines: boolean;
|
|
914
|
+
adminLinesColor: [number, number, number];
|
|
915
|
+
water: boolean;
|
|
916
|
+
waterColor: [number, number, number];
|
|
917
|
+
surfaceColor: [number, number, number];
|
|
918
|
+
surface: boolean;
|
|
919
|
+
backgroundColor: [number, number, number];
|
|
920
|
+
stars: boolean;
|
|
921
|
+
};
|
|
922
|
+
export type Globe = {
|
|
923
|
+
enabled: boolean;
|
|
924
|
+
config: GlobeConfig;
|
|
925
|
+
};
|
|
926
|
+
export declare const DEFAULT_GLOBE_CONFIG: GlobeConfig;
|
|
927
|
+
export declare const GLOBE_SUPPORTED_LAYERS: Record<string, boolean>;
|
|
811
928
|
export declare enum MapSplitMode {
|
|
812
929
|
SINGLE_MAP = "SINGLE_MAP",
|
|
813
930
|
DUAL_MAP = "DUAL_MAP",
|
|
@@ -882,12 +999,20 @@ export declare const getLoaderOptions: () => {
|
|
|
882
999
|
};
|
|
883
1000
|
};
|
|
884
1001
|
export declare const CUSTOM_SCENEGRAPH_MODEL_ID = "custom";
|
|
885
|
-
export declare const
|
|
1002
|
+
export declare const DEFAULT_SCENEGRAPH_MODEL_ID = "default-model";
|
|
1003
|
+
export declare const LEGACY_DEFAULT_SCENEGRAPH_URL = "https://raw.githubusercontent.com/KhronosGroup/glTF-Sample-Models/master/2.0/Duck/glTF-Binary/Duck.glb";
|
|
1004
|
+
export type ScenegraphModel = {
|
|
886
1005
|
id: string;
|
|
887
1006
|
label: string;
|
|
888
1007
|
icon: any;
|
|
889
1008
|
url: string | null;
|
|
1009
|
+
/** [roll, pitch, yaw] added to the layer angle sliders */
|
|
890
1010
|
angles: [number, number, number];
|
|
891
1011
|
scale: number;
|
|
892
|
-
}
|
|
1012
|
+
};
|
|
1013
|
+
/** Duck used by the point 3D layer. Yaw lives on the model so angle Z can default to 0. */
|
|
1014
|
+
export declare const DEFAULT_SCENEGRAPH_MODEL: ScenegraphModel;
|
|
1015
|
+
export declare const TRIP_LAYER_SCENEGRAPH_MODELS: ScenegraphModel[];
|
|
1016
|
+
/** Same gallery as trips, plus Ducky and a custom URL. */
|
|
1017
|
+
export declare const SCENEGRAPH_LAYER_MODELS: ScenegraphModel[];
|
|
893
1018
|
export {};
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MIT
|
|
2
|
+
// Copyright contributors to the kepler.gl project
|
|
3
|
+
|
|
4
|
+
export var AnnotationKind = /*#__PURE__*/function (AnnotationKind) {
|
|
5
|
+
AnnotationKind["TEXT"] = "TEXT";
|
|
6
|
+
AnnotationKind["ARROW"] = "ARROW";
|
|
7
|
+
AnnotationKind["POINT"] = "POINT";
|
|
8
|
+
AnnotationKind["CIRCLE"] = "CIRCLE";
|
|
9
|
+
AnnotationKind["RULER"] = "RULER";
|
|
10
|
+
return AnnotationKind;
|
|
11
|
+
}({});
|
|
12
|
+
export function isAnnotationKind(kind) {
|
|
13
|
+
return Object.values(AnnotationKind).includes(kind);
|
|
14
|
+
}
|
|
15
|
+
export function isAnnotationWithArm(anno) {
|
|
16
|
+
return isFinite(anno.armLength);
|
|
17
|
+
}
|
|
18
|
+
export var INITIAL_ANNOTATION_KIND = AnnotationKind.POINT;
|
|
19
|
+
export var INITIAL_ANNOTATION_ANGLE = -45;
|
|
20
|
+
export var INITIAL_ANNOTATION_ARM_LENGTH = 50;
|
|
21
|
+
export var INITIAL_ANNOTATION_TEXT_WIDTH = 0;
|
|
22
|
+
export var INITIAL_ANNOTATION_TEXT_HEIGHT = 0;
|
|
23
|
+
export var INITIAL_ANNOTATION_LINE_WIDTH = 2;
|
|
24
|
+
export var INITIAL_ANNOTATION_LINE_COLOR = '#FFFFFF';
|
|
25
|
+
export var INITIAL_ANNOTATION_RULER_LENGTH_METERS = 1000;
|
|
26
|
+
export var INITIAL_ANNOTATION_TEXT_SIDE = 'right';
|
|
27
|
+
export var INITIAL_ANNOTATION_TEXT_VERTICAL_POSITION = 'above';
|
|
28
|
+
export var ANNOTATION_KINDS = [{
|
|
29
|
+
id: AnnotationKind.TEXT,
|
|
30
|
+
label: 'Text'
|
|
31
|
+
}, {
|
|
32
|
+
id: AnnotationKind.POINT,
|
|
33
|
+
label: 'Point'
|
|
34
|
+
}, {
|
|
35
|
+
id: AnnotationKind.ARROW,
|
|
36
|
+
label: 'Arrow'
|
|
37
|
+
}, {
|
|
38
|
+
id: AnnotationKind.CIRCLE,
|
|
39
|
+
label: 'Circle'
|
|
40
|
+
}, {
|
|
41
|
+
id: AnnotationKind.RULER,
|
|
42
|
+
label: 'Ruler'
|
|
43
|
+
}];
|
|
44
|
+
export var ANNOTATION_LINE_WIDTH_OPTIONS = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
|
|
45
|
+
export var ANNOTATION_TEXT_SIDES = [{
|
|
46
|
+
id: 'right',
|
|
47
|
+
label: 'Right'
|
|
48
|
+
}, {
|
|
49
|
+
id: 'left',
|
|
50
|
+
label: 'Left'
|
|
51
|
+
}];
|
|
52
|
+
export var ANNOTATION_TEXT_VERTICAL_POSITIONS = [{
|
|
53
|
+
id: 'above',
|
|
54
|
+
label: 'Above'
|
|
55
|
+
}, {
|
|
56
|
+
id: 'below',
|
|
57
|
+
label: 'Below'
|
|
58
|
+
}];
|
|
59
|
+
|
|
60
|
+
/** Canonical arm angle for a text-side + vertical-position pair (screen y-down). */
|
|
61
|
+
export var ANNOTATION_ANGLE_BY_PLACEMENT = {
|
|
62
|
+
'right-above': INITIAL_ANNOTATION_ANGLE,
|
|
63
|
+
'left-above': -135,
|
|
64
|
+
'right-below': 45,
|
|
65
|
+
'left-below': 135
|
|
66
|
+
};
|
|
67
|
+
export function isLeftOriented(angle) {
|
|
68
|
+
return angle > 90 || angle < -90;
|
|
69
|
+
}
|
|
70
|
+
export function isBelowOriented(angle) {
|
|
71
|
+
return angle > 0 && angle < 180;
|
|
72
|
+
}
|
|
73
|
+
export function textPlacementFromAngle(angle) {
|
|
74
|
+
return {
|
|
75
|
+
side: isLeftOriented(angle) ? 'left' : 'right',
|
|
76
|
+
vertical: isBelowOriented(angle) ? 'below' : 'above'
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
//# sourceMappingURL=annotation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"annotation.js","names":["AnnotationKind","isAnnotationKind","kind","Object","values","includes","isAnnotationWithArm","anno","isFinite","armLength","INITIAL_ANNOTATION_KIND","POINT","INITIAL_ANNOTATION_ANGLE","INITIAL_ANNOTATION_ARM_LENGTH","INITIAL_ANNOTATION_TEXT_WIDTH","INITIAL_ANNOTATION_TEXT_HEIGHT","INITIAL_ANNOTATION_LINE_WIDTH","INITIAL_ANNOTATION_LINE_COLOR","INITIAL_ANNOTATION_RULER_LENGTH_METERS","INITIAL_ANNOTATION_TEXT_SIDE","INITIAL_ANNOTATION_TEXT_VERTICAL_POSITION","ANNOTATION_KINDS","id","TEXT","label","ARROW","CIRCLE","RULER","ANNOTATION_LINE_WIDTH_OPTIONS","ANNOTATION_TEXT_SIDES","ANNOTATION_TEXT_VERTICAL_POSITIONS","ANNOTATION_ANGLE_BY_PLACEMENT","isLeftOriented","angle","isBelowOriented","textPlacementFromAngle","side","vertical"],"sources":["../../src/annotation.ts"],"sourcesContent":["// SPDX-License-Identifier: MIT\n// Copyright contributors to the kepler.gl project\n\nexport enum AnnotationKind {\n TEXT = 'TEXT',\n ARROW = 'ARROW',\n POINT = 'POINT',\n CIRCLE = 'CIRCLE',\n RULER = 'RULER'\n}\n\nexport function isAnnotationKind(kind: string): kind is AnnotationKind {\n return Object.values(AnnotationKind).includes(kind as AnnotationKind);\n}\n\nexport function isAnnotationWithArm<T extends object>(\n anno: T\n): anno is T & {armLength: number; angle: number} {\n return isFinite((anno as any).armLength);\n}\n\nexport const INITIAL_ANNOTATION_KIND = AnnotationKind.POINT;\nexport const INITIAL_ANNOTATION_ANGLE = -45;\nexport const INITIAL_ANNOTATION_ARM_LENGTH = 50;\nexport const INITIAL_ANNOTATION_TEXT_WIDTH = 0;\nexport const INITIAL_ANNOTATION_TEXT_HEIGHT = 0;\nexport const INITIAL_ANNOTATION_LINE_WIDTH = 2;\nexport const INITIAL_ANNOTATION_LINE_COLOR = '#FFFFFF';\nexport const INITIAL_ANNOTATION_RULER_LENGTH_METERS = 1000;\n\nexport type AnnotationTextSide = 'left' | 'right';\nexport type AnnotationTextVerticalPosition = 'above' | 'below';\n\nexport const INITIAL_ANNOTATION_TEXT_SIDE: AnnotationTextSide = 'right';\nexport const INITIAL_ANNOTATION_TEXT_VERTICAL_POSITION: AnnotationTextVerticalPosition = 'above';\n\nexport const ANNOTATION_KINDS = [\n {id: AnnotationKind.TEXT, label: 'Text'},\n {id: AnnotationKind.POINT, label: 'Point'},\n {id: AnnotationKind.ARROW, label: 'Arrow'},\n {id: AnnotationKind.CIRCLE, label: 'Circle'},\n {id: AnnotationKind.RULER, label: 'Ruler'}\n];\n\nexport const ANNOTATION_LINE_WIDTH_OPTIONS = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];\n\nexport const ANNOTATION_TEXT_SIDES: Array<{id: AnnotationTextSide; label: string}> = [\n {id: 'right', label: 'Right'},\n {id: 'left', label: 'Left'}\n];\n\nexport const ANNOTATION_TEXT_VERTICAL_POSITIONS: Array<{\n id: AnnotationTextVerticalPosition;\n label: string;\n}> = [\n {id: 'above', label: 'Above'},\n {id: 'below', label: 'Below'}\n];\n\n/** Canonical arm angle for a text-side + vertical-position pair (screen y-down). */\nexport const ANNOTATION_ANGLE_BY_PLACEMENT: Record<\n `${AnnotationTextSide}-${AnnotationTextVerticalPosition}`,\n number\n> = {\n 'right-above': INITIAL_ANNOTATION_ANGLE,\n 'left-above': -135,\n 'right-below': 45,\n 'left-below': 135\n};\n\nexport function isLeftOriented(angle: number): boolean {\n return angle > 90 || angle < -90;\n}\n\nexport function isBelowOriented(angle: number): boolean {\n return angle > 0 && angle < 180;\n}\n\nexport function textPlacementFromAngle(angle: number): {\n side: AnnotationTextSide;\n vertical: AnnotationTextVerticalPosition;\n} {\n return {\n side: isLeftOriented(angle) ? 'left' : 'right',\n vertical: isBelowOriented(angle) ? 'below' : 'above'\n };\n}\n"],"mappings":"AAAA;AACA;;AAEA,WAAYA,cAAc,0BAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAA,OAAdA,cAAc;AAAA;AAQ1B,OAAO,SAASC,gBAAgBA,CAACC,IAAY,EAA0B;EACrE,OAAOC,MAAM,CAACC,MAAM,CAACJ,cAAc,CAAC,CAACK,QAAQ,CAACH,IAAsB,CAAC;AACvE;AAEA,OAAO,SAASI,mBAAmBA,CACjCC,IAAO,EACyC;EAChD,OAAOC,QAAQ,CAAED,IAAI,CAASE,SAAS,CAAC;AAC1C;AAEA,OAAO,IAAMC,uBAAuB,GAAGV,cAAc,CAACW,KAAK;AAC3D,OAAO,IAAMC,wBAAwB,GAAG,CAAC,EAAE;AAC3C,OAAO,IAAMC,6BAA6B,GAAG,EAAE;AAC/C,OAAO,IAAMC,6BAA6B,GAAG,CAAC;AAC9C,OAAO,IAAMC,8BAA8B,GAAG,CAAC;AAC/C,OAAO,IAAMC,6BAA6B,GAAG,CAAC;AAC9C,OAAO,IAAMC,6BAA6B,GAAG,SAAS;AACtD,OAAO,IAAMC,sCAAsC,GAAG,IAAI;AAK1D,OAAO,IAAMC,4BAAgD,GAAG,OAAO;AACvE,OAAO,IAAMC,yCAAyE,GAAG,OAAO;AAEhG,OAAO,IAAMC,gBAAgB,GAAG,CAC9B;EAACC,EAAE,EAAEtB,cAAc,CAACuB,IAAI;EAAEC,KAAK,EAAE;AAAM,CAAC,EACxC;EAACF,EAAE,EAAEtB,cAAc,CAACW,KAAK;EAAEa,KAAK,EAAE;AAAO,CAAC,EAC1C;EAACF,EAAE,EAAEtB,cAAc,CAACyB,KAAK;EAAED,KAAK,EAAE;AAAO,CAAC,EAC1C;EAACF,EAAE,EAAEtB,cAAc,CAAC0B,MAAM;EAAEF,KAAK,EAAE;AAAQ,CAAC,EAC5C;EAACF,EAAE,EAAEtB,cAAc,CAAC2B,KAAK;EAAEH,KAAK,EAAE;AAAO,CAAC,CAC3C;AAED,OAAO,IAAMI,6BAA6B,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;AAE5E,OAAO,IAAMC,qBAAqE,GAAG,CACnF;EAACP,EAAE,EAAE,OAAO;EAAEE,KAAK,EAAE;AAAO,CAAC,EAC7B;EAACF,EAAE,EAAE,MAAM;EAAEE,KAAK,EAAE;AAAM,CAAC,CAC5B;AAED,OAAO,IAAMM,kCAGX,GAAG,CACH;EAACR,EAAE,EAAE,OAAO;EAAEE,KAAK,EAAE;AAAO,CAAC,EAC7B;EAACF,EAAE,EAAE,OAAO;EAAEE,KAAK,EAAE;AAAO,CAAC,CAC9B;;AAED;AACA,OAAO,IAAMO,6BAGZ,GAAG;EACF,aAAa,EAAEnB,wBAAwB;EACvC,YAAY,EAAE,CAAC,GAAG;EAClB,aAAa,EAAE,EAAE;EACjB,YAAY,EAAE;AAChB,CAAC;AAED,OAAO,SAASoB,cAAcA,CAACC,KAAa,EAAW;EACrD,OAAOA,KAAK,GAAG,EAAE,IAAIA,KAAK,GAAG,CAAC,EAAE;AAClC;AAEA,OAAO,SAASC,eAAeA,CAACD,KAAa,EAAW;EACtD,OAAOA,KAAK,GAAG,CAAC,IAAIA,KAAK,GAAG,GAAG;AACjC;AAEA,OAAO,SAASE,sBAAsBA,CAACF,KAAa,EAGlD;EACA,OAAO;IACLG,IAAI,EAAEJ,cAAc,CAACC,KAAK,CAAC,GAAG,MAAM,GAAG,OAAO;IAC9CI,QAAQ,EAAEH,eAAe,CAACD,KAAK,CAAC,GAAG,OAAO,GAAG;EAC/C,CAAC;AACH","ignoreList":[]}
|