@kepler.gl/constants 3.3.0-alpha.2 → 3.3.0-alpha.20

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.
Files changed (47) hide show
  1. package/dist/annotation.d.ts +23 -1
  2. package/dist/cjs/annotation.js +89 -0
  3. package/dist/cjs/color-palettes.js +461 -0
  4. package/dist/cjs/colors-by-theme.js +519 -0
  5. package/dist/cjs/dataset.js +209 -0
  6. package/dist/cjs/default-settings.js +1812 -0
  7. package/dist/cjs/gpu-parameters.js +125 -0
  8. package/dist/cjs/index.js +149 -0
  9. package/dist/cjs/keyevent.js +26 -0
  10. package/dist/cjs/layers.js +670 -0
  11. package/dist/{plot.js → cjs/plot.js} +1 -1
  12. package/dist/cjs/time.js +194 -0
  13. package/dist/cjs/tooltip.js +221 -0
  14. package/dist/cjs/user-feedbacks.js +15 -0
  15. package/dist/cjs/user-guides.js +19 -0
  16. package/dist/dataset.d.ts +161 -5
  17. package/dist/default-settings.d.ts +139 -14
  18. package/dist/esm/annotation.js +79 -0
  19. package/dist/esm/color-palettes.js +453 -0
  20. package/dist/esm/colors-by-theme.js +513 -0
  21. package/dist/esm/dataset.js +204 -0
  22. package/dist/esm/default-settings.js +1806 -0
  23. package/dist/esm/gpu-parameters.js +119 -0
  24. package/dist/esm/index.js +18 -0
  25. package/dist/esm/keyevent.js +19 -0
  26. package/dist/esm/layers.js +663 -0
  27. package/dist/esm/plot.js +9 -0
  28. package/dist/esm/time.js +190 -0
  29. package/dist/esm/tooltip.js +215 -0
  30. package/dist/esm/user-feedbacks.js +9 -0
  31. package/dist/esm/user-guides.js +13 -0
  32. package/dist/layers.d.ts +8 -0
  33. package/package.json +21 -14
  34. package/dist/annotation.js +0 -45
  35. package/dist/color-palettes.js +0 -462
  36. package/dist/colors-by-theme.js +0 -519
  37. package/dist/dataset.js +0 -82
  38. package/dist/default-settings.js +0 -1651
  39. package/dist/gpu-parameters.js +0 -125
  40. package/dist/index.js +0 -149
  41. package/dist/keyevent.js +0 -26
  42. package/dist/layers.js +0 -605
  43. package/dist/time.js +0 -194
  44. package/dist/tooltip.js +0 -221
  45. package/dist/user-feedbacks.js +0 -15
  46. package/dist/user-guides.js +0 -19
  47. 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
- name: string;
65
- title: string;
66
- boundingBox: number[] | null;
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` and `THEME.dark`. Default theme is `THEME.dark`
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
- export declare const EXPORT_DATA_TYPE_OPTIONS: {
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
- aiAssistant: "aiAssistant";
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 TRIP_LAYER_SCENEGRAPH_MODELS: {
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=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyJBbm5vdGF0aW9uS2luZCIsImlzQW5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