@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
|
@@ -0,0 +1,1807 @@
|
|
|
1
|
+
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
2
|
+
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
3
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
4
|
+
var _SCALE_FUNC, _FIELD_TYPE_DISPLAY, _FIELD_OPTS;
|
|
5
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
6
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
7
|
+
// SPDX-License-Identifier: MIT
|
|
8
|
+
// Copyright contributors to the kepler.gl project
|
|
9
|
+
|
|
10
|
+
import keyMirror from 'keymirror';
|
|
11
|
+
import { scaleLinear, scaleLog, scaleOrdinal, scalePoint, scaleQuantile, scaleQuantize, scaleSqrt, scaleThreshold } from 'd3-scale';
|
|
12
|
+
import { TOOLTIP_FORMAT_TYPES } from './tooltip';
|
|
13
|
+
export var ACTION_PREFIX = '@@kepler.gl/';
|
|
14
|
+
export var KEPLER_UNFOLDED_BUCKET = 'https://studio-public-data.foursquare.com/statics/keplergl';
|
|
15
|
+
export var BASEMAP_ICON_PREFIX = "geodude";
|
|
16
|
+
export var DEFAULT_MAPBOX_API_URL = 'https://api.mapbox.com';
|
|
17
|
+
export var TRANSITION_DURATION = 0;
|
|
18
|
+
|
|
19
|
+
// Modal Ids
|
|
20
|
+
/**
|
|
21
|
+
* Modal id: data table
|
|
22
|
+
* @constant
|
|
23
|
+
* @type {string}
|
|
24
|
+
* @public
|
|
25
|
+
*/
|
|
26
|
+
export var DATA_TABLE_ID = 'dataTable';
|
|
27
|
+
/**
|
|
28
|
+
* Modal id: delete dataset confirm dialog
|
|
29
|
+
* @constant
|
|
30
|
+
* @type {string}
|
|
31
|
+
* @public
|
|
32
|
+
*/
|
|
33
|
+
export var DELETE_DATA_ID = 'deleteData';
|
|
34
|
+
/**
|
|
35
|
+
* Modal id: add data modal
|
|
36
|
+
* @constant
|
|
37
|
+
* @type {string}
|
|
38
|
+
* @public
|
|
39
|
+
*/
|
|
40
|
+
export var ADD_DATA_ID = 'addData';
|
|
41
|
+
/**
|
|
42
|
+
* Modal id: export image modal
|
|
43
|
+
* @constant
|
|
44
|
+
* @type {string}
|
|
45
|
+
* @public
|
|
46
|
+
*/
|
|
47
|
+
export var EXPORT_IMAGE_ID = 'exportImage';
|
|
48
|
+
/**
|
|
49
|
+
* Modal id: export data modal
|
|
50
|
+
* @constant
|
|
51
|
+
* @type {string}
|
|
52
|
+
* @public
|
|
53
|
+
*/
|
|
54
|
+
export var EXPORT_DATA_ID = 'exportData';
|
|
55
|
+
/**
|
|
56
|
+
* Modal id: add custom map style modal
|
|
57
|
+
* @constant
|
|
58
|
+
* @type {string}
|
|
59
|
+
* @public
|
|
60
|
+
*/
|
|
61
|
+
export var ADD_MAP_STYLE_ID = 'addMapStyle';
|
|
62
|
+
/**
|
|
63
|
+
* Modal id: export map modal
|
|
64
|
+
* @constant
|
|
65
|
+
* @type {string}
|
|
66
|
+
* @public
|
|
67
|
+
*/
|
|
68
|
+
export var EXPORT_MAP_ID = 'exportMap';
|
|
69
|
+
/**
|
|
70
|
+
* Modal id: export video modal
|
|
71
|
+
* @constant
|
|
72
|
+
* @type {string}
|
|
73
|
+
* @public
|
|
74
|
+
*/
|
|
75
|
+
export var EXPORT_VIDEO_ID = 'exportVideo';
|
|
76
|
+
/**
|
|
77
|
+
* Modal id: save map modal
|
|
78
|
+
* @constant
|
|
79
|
+
* @type {string}
|
|
80
|
+
* @public
|
|
81
|
+
*/
|
|
82
|
+
export var SAVE_MAP_ID = 'saveMap';
|
|
83
|
+
/**
|
|
84
|
+
* Modal id: confirm to overwrite saved map
|
|
85
|
+
* @constant
|
|
86
|
+
* @type {string}
|
|
87
|
+
* @public
|
|
88
|
+
*/
|
|
89
|
+
export var OVERWRITE_MAP_ID = 'overwriteMap';
|
|
90
|
+
/**
|
|
91
|
+
* Modal id: share map url modal
|
|
92
|
+
* @constant
|
|
93
|
+
* @type {string}
|
|
94
|
+
* @public
|
|
95
|
+
*/
|
|
96
|
+
export var SHARE_MAP_ID = 'shareMap';
|
|
97
|
+
export var KEPLER_GL_NAME = 'kepler.gl';
|
|
98
|
+
|
|
99
|
+
// __PACKAGE_VERSION__ is automatically injected by Babel/Esbuild during the build process
|
|
100
|
+
// Since we are injecting this during the build process with babel
|
|
101
|
+
// while developing VERSION is not defined, we capture the exception and return
|
|
102
|
+
// an empty string which will allow us to retrieve the latest umd version
|
|
103
|
+
export var KEPLER_GL_VERSION = "3.3.0-alpha.21";
|
|
104
|
+
export var KEPLER_GL_WEBSITE = 'http://kepler.gl/';
|
|
105
|
+
export var DIMENSIONS = {
|
|
106
|
+
sidePanel: {
|
|
107
|
+
width: 300,
|
|
108
|
+
margin: {
|
|
109
|
+
top: 12,
|
|
110
|
+
left: 12,
|
|
111
|
+
bottom: 12,
|
|
112
|
+
right: 20
|
|
113
|
+
},
|
|
114
|
+
headerHeight: 96
|
|
115
|
+
},
|
|
116
|
+
mapControl: {
|
|
117
|
+
width: 184,
|
|
118
|
+
padding: 12,
|
|
119
|
+
mapLegend: {
|
|
120
|
+
pinned: {
|
|
121
|
+
bottom: 22,
|
|
122
|
+
right: 12
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* Theme name that can be passed to `KeplerGl` `prop.theme`.
|
|
130
|
+
* Available themes are `THEME.light`, `THEME.dark`, and `THEME.space`.
|
|
131
|
+
* Default theme is `THEME.dark`
|
|
132
|
+
* @constant
|
|
133
|
+
* @type {object}
|
|
134
|
+
* @public
|
|
135
|
+
* @example
|
|
136
|
+
* ```js
|
|
137
|
+
* const Map = () => <KeplerGl theme={THEME.light} id="map"/>
|
|
138
|
+
* ```
|
|
139
|
+
*/
|
|
140
|
+
export var THEME = keyMirror({
|
|
141
|
+
light: null,
|
|
142
|
+
dark: null,
|
|
143
|
+
space: null,
|
|
144
|
+
base: null
|
|
145
|
+
});
|
|
146
|
+
export var SIDEBAR_PANELS = [{
|
|
147
|
+
id: 'layer',
|
|
148
|
+
label: 'sidebar.panels.layer',
|
|
149
|
+
onClick: null
|
|
150
|
+
}, {
|
|
151
|
+
id: 'filter',
|
|
152
|
+
label: 'sidebar.panels.filter',
|
|
153
|
+
onClick: null
|
|
154
|
+
}, {
|
|
155
|
+
id: 'interaction',
|
|
156
|
+
label: 'sidebar.panels.interaction',
|
|
157
|
+
onClick: null
|
|
158
|
+
}, {
|
|
159
|
+
id: 'map',
|
|
160
|
+
label: 'sidebar.panels.basemap',
|
|
161
|
+
onClick: null
|
|
162
|
+
}];
|
|
163
|
+
export var PANEL_VIEW_TOGGLES = keyMirror({
|
|
164
|
+
list: null,
|
|
165
|
+
byDataset: null
|
|
166
|
+
});
|
|
167
|
+
|
|
168
|
+
// backward compatibility
|
|
169
|
+
export var PANELS = SIDEBAR_PANELS;
|
|
170
|
+
|
|
171
|
+
// MAP STYLES
|
|
172
|
+
|
|
173
|
+
export var DEFAULT_BLDG_COLOR = '#D1CEC7';
|
|
174
|
+
export var DEFAULT_BACKGROUND_COLOR = '#000000';
|
|
175
|
+
|
|
176
|
+
// assists in identifying basemap background layers when auto-determining the backgroundColor
|
|
177
|
+
export var BASE_MAP_BACKGROUND_LAYER_IDS = ['background', 'bg', 'land', 'water'];
|
|
178
|
+
export var BACKGROUND_LAYER_GROUP_SLUG = 'Background';
|
|
179
|
+
export var THREE_D_BUILDING_LAYER_GROUP_SLUG = '3d building';
|
|
180
|
+
export var BACKGROUND_LAYER_GROUP = {
|
|
181
|
+
slug: BACKGROUND_LAYER_GROUP_SLUG,
|
|
182
|
+
filter: function filter() {
|
|
183
|
+
return false;
|
|
184
|
+
},
|
|
185
|
+
defaultVisibility: false,
|
|
186
|
+
isVisibilityToggleAvailable: false,
|
|
187
|
+
isMoveToTopAvailable: false,
|
|
188
|
+
isColorPickerAvailable: true
|
|
189
|
+
};
|
|
190
|
+
export var DEFAULT_LAYER_GROUPS = [{
|
|
191
|
+
slug: 'label',
|
|
192
|
+
filter: function filter(_ref) {
|
|
193
|
+
var id = _ref.id,
|
|
194
|
+
type = _ref.type;
|
|
195
|
+
return id.match(/(?=(label|place-|poi-))/) || (type === null || type === void 0 ? void 0 : type.match(/(?=(symbol))/));
|
|
196
|
+
},
|
|
197
|
+
defaultVisibility: true,
|
|
198
|
+
isVisibilityToggleAvailable: true,
|
|
199
|
+
isMoveToTopAvailable: true,
|
|
200
|
+
isColorPickerAvailable: false
|
|
201
|
+
}, {
|
|
202
|
+
slug: 'road',
|
|
203
|
+
filter: function filter(_ref2) {
|
|
204
|
+
var id = _ref2.id;
|
|
205
|
+
return id.match(/(?=(road|railway|tunnel|street|bridge))(?!.*label)/);
|
|
206
|
+
},
|
|
207
|
+
defaultVisibility: true,
|
|
208
|
+
isVisibilityToggleAvailable: true,
|
|
209
|
+
isMoveToTopAvailable: true,
|
|
210
|
+
isColorPickerAvailable: false
|
|
211
|
+
}, {
|
|
212
|
+
slug: 'border',
|
|
213
|
+
filter: function filter(_ref3) {
|
|
214
|
+
var id = _ref3.id;
|
|
215
|
+
return id.match(/border|boundaries|boundary/);
|
|
216
|
+
},
|
|
217
|
+
defaultVisibility: false,
|
|
218
|
+
isVisibilityToggleAvailable: true,
|
|
219
|
+
isMoveToTopAvailable: true,
|
|
220
|
+
isColorPickerAvailable: false
|
|
221
|
+
}, {
|
|
222
|
+
slug: 'building',
|
|
223
|
+
filter: function filter(_ref4) {
|
|
224
|
+
var id = _ref4.id;
|
|
225
|
+
return id.match(/building/);
|
|
226
|
+
},
|
|
227
|
+
defaultVisibility: true,
|
|
228
|
+
isVisibilityToggleAvailable: true,
|
|
229
|
+
isMoveToTopAvailable: true,
|
|
230
|
+
isColorPickerAvailable: false
|
|
231
|
+
}, {
|
|
232
|
+
slug: 'water',
|
|
233
|
+
filter: function filter(_ref5) {
|
|
234
|
+
var id = _ref5.id;
|
|
235
|
+
return id.match(/(?=(water|stream|ferry))/);
|
|
236
|
+
},
|
|
237
|
+
defaultVisibility: true,
|
|
238
|
+
isVisibilityToggleAvailable: true,
|
|
239
|
+
isMoveToTopAvailable: true,
|
|
240
|
+
isColorPickerAvailable: false
|
|
241
|
+
}, {
|
|
242
|
+
slug: 'land',
|
|
243
|
+
filter: function filter(_ref6) {
|
|
244
|
+
var id = _ref6.id;
|
|
245
|
+
return id.match(/(?=(parks|landcover|industrial|sand|hillshade))/);
|
|
246
|
+
},
|
|
247
|
+
defaultVisibility: true,
|
|
248
|
+
isVisibilityToggleAvailable: true,
|
|
249
|
+
isMoveToTopAvailable: true,
|
|
250
|
+
isColorPickerAvailable: false
|
|
251
|
+
}, {
|
|
252
|
+
slug: THREE_D_BUILDING_LAYER_GROUP_SLUG,
|
|
253
|
+
filter: function filter() {
|
|
254
|
+
return false;
|
|
255
|
+
},
|
|
256
|
+
defaultVisibility: false,
|
|
257
|
+
isVisibilityToggleAvailable: true,
|
|
258
|
+
isMoveToTopAvailable: true,
|
|
259
|
+
isColorPickerAvailable: true
|
|
260
|
+
}];
|
|
261
|
+
export var BASE_MAP_COLOR_MODES = keyMirror({
|
|
262
|
+
NONE: null,
|
|
263
|
+
DARK: null,
|
|
264
|
+
LIGHT: null
|
|
265
|
+
});
|
|
266
|
+
export var NO_MAP_ID = 'no_map';
|
|
267
|
+
|
|
268
|
+
// Fallback style to use when styles are being fetched, or when
|
|
269
|
+
// a style fails to fetch
|
|
270
|
+
export var EMPTY_MAPBOX_STYLE = {
|
|
271
|
+
version: 8,
|
|
272
|
+
sources: {},
|
|
273
|
+
layers: []
|
|
274
|
+
};
|
|
275
|
+
export var MAP_LIB_OPTIONS = {
|
|
276
|
+
MAPBOX: 'mapbox',
|
|
277
|
+
MAPLIBRE: 'maplibre'
|
|
278
|
+
};
|
|
279
|
+
|
|
280
|
+
/** Mapbox GL JS does not support pitch above 60 degrees */
|
|
281
|
+
export var MAPBOX_MAX_PITCH = 60;
|
|
282
|
+
export var NO_BASEMAP_ICON = "".concat(BASEMAP_ICON_PREFIX, "/NO_BASEMAP.png");
|
|
283
|
+
export var DEFAULT_BASE_MAP_STYLE = 'dark-matter';
|
|
284
|
+
export var DEFAULT_NO_BASEMAP_STYLE = {
|
|
285
|
+
id: NO_MAP_ID,
|
|
286
|
+
label: 'No Basemap',
|
|
287
|
+
url: '',
|
|
288
|
+
icon: NO_BASEMAP_ICON,
|
|
289
|
+
layerGroups: [BACKGROUND_LAYER_GROUP],
|
|
290
|
+
colorMode: BASE_MAP_COLOR_MODES.NONE,
|
|
291
|
+
style: EMPTY_MAPBOX_STYLE
|
|
292
|
+
};
|
|
293
|
+
export var DEFAULT_MAPBOX_STYLES = [{
|
|
294
|
+
id: 'dark',
|
|
295
|
+
label: 'Dark',
|
|
296
|
+
url: 'mapbox://styles/uberdata/cjoqbbf6l9k302sl96tyvka09',
|
|
297
|
+
icon: "".concat(BASEMAP_ICON_PREFIX, "/UBER_DARK_V2.png"),
|
|
298
|
+
layerGroups: DEFAULT_LAYER_GROUPS,
|
|
299
|
+
colorMode: BASE_MAP_COLOR_MODES.DARK,
|
|
300
|
+
complimentaryStyleId: 'light'
|
|
301
|
+
}, {
|
|
302
|
+
id: 'light',
|
|
303
|
+
label: 'Light',
|
|
304
|
+
url: 'mapbox://styles/uberdata/cjoqb9j339k1f2sl9t5ic5bn4',
|
|
305
|
+
icon: "".concat(BASEMAP_ICON_PREFIX, "/UBER_LIGHT_V2.png"),
|
|
306
|
+
layerGroups: DEFAULT_LAYER_GROUPS,
|
|
307
|
+
colorMode: BASE_MAP_COLOR_MODES.LIGHT,
|
|
308
|
+
complimentaryStyleId: 'dark'
|
|
309
|
+
}, {
|
|
310
|
+
id: 'muted',
|
|
311
|
+
label: 'Muted Light',
|
|
312
|
+
url: 'mapbox://styles/uberdata/cjfyl03kp1tul2smf5v2tbdd4',
|
|
313
|
+
icon: "".concat(BASEMAP_ICON_PREFIX, "/UBER_MUTED_LIGHT.png"),
|
|
314
|
+
layerGroups: DEFAULT_LAYER_GROUPS,
|
|
315
|
+
colorMode: BASE_MAP_COLOR_MODES.LIGHT,
|
|
316
|
+
complimentaryStyleId: 'muted_night'
|
|
317
|
+
}, {
|
|
318
|
+
id: 'muted_night',
|
|
319
|
+
label: 'Muted Night',
|
|
320
|
+
url: 'mapbox://styles/uberdata/cjfxhlikmaj1b2soyzevnywgs',
|
|
321
|
+
icon: "".concat(BASEMAP_ICON_PREFIX, "/UBER_MUTED_NIGHT.png"),
|
|
322
|
+
layerGroups: DEFAULT_LAYER_GROUPS,
|
|
323
|
+
colorMode: BASE_MAP_COLOR_MODES.DARK,
|
|
324
|
+
complimentaryStyleId: 'muted'
|
|
325
|
+
}];
|
|
326
|
+
export var DEFAULT_MAPBOX_SATELITE_STYLES = [{
|
|
327
|
+
id: 'satellite',
|
|
328
|
+
label: 'Satellite with streets',
|
|
329
|
+
url: "mapbox://styles/mapbox/satellite-streets-v11",
|
|
330
|
+
icon: "".concat(BASEMAP_ICON_PREFIX, "/UBER_SATELLITE.png"),
|
|
331
|
+
layerGroups: DEFAULT_LAYER_GROUPS,
|
|
332
|
+
colorMode: BASE_MAP_COLOR_MODES.NONE
|
|
333
|
+
}];
|
|
334
|
+
export var DEFAULT_MAPLIBRE_STYLES = [{
|
|
335
|
+
id: 'dark-matter',
|
|
336
|
+
label: 'DarkMatter',
|
|
337
|
+
url: 'https://basemaps.cartocdn.com/gl/dark-matter-gl-style/style.json',
|
|
338
|
+
icon: "".concat(BASEMAP_ICON_PREFIX, "/DARKMATTER.png"),
|
|
339
|
+
layerGroups: DEFAULT_LAYER_GROUPS,
|
|
340
|
+
colorMode: BASE_MAP_COLOR_MODES.DARK,
|
|
341
|
+
complimentaryStyleId: 'positron'
|
|
342
|
+
}, {
|
|
343
|
+
id: 'positron',
|
|
344
|
+
label: 'Positron',
|
|
345
|
+
url: 'https://basemaps.cartocdn.com/gl/positron-gl-style/style.json',
|
|
346
|
+
icon: "".concat(BASEMAP_ICON_PREFIX, "/POSITRON.png"),
|
|
347
|
+
layerGroups: DEFAULT_LAYER_GROUPS,
|
|
348
|
+
colorMode: BASE_MAP_COLOR_MODES.LIGHT,
|
|
349
|
+
complimentaryStyleId: 'dark-matter'
|
|
350
|
+
}, {
|
|
351
|
+
id: 'voyager',
|
|
352
|
+
label: 'Voyager',
|
|
353
|
+
url: 'https://basemaps.cartocdn.com/gl/voyager-gl-style/style.json',
|
|
354
|
+
icon: "".concat(BASEMAP_ICON_PREFIX, "/VOYAGER.png"),
|
|
355
|
+
layerGroups: DEFAULT_LAYER_GROUPS,
|
|
356
|
+
colorMode: BASE_MAP_COLOR_MODES.LIGHT,
|
|
357
|
+
complimentaryStyleId: 'dark-matter'
|
|
358
|
+
}];
|
|
359
|
+
export var DEFAULT_MAP_STYLES = [DEFAULT_NO_BASEMAP_STYLE].concat(DEFAULT_MAPLIBRE_STYLES, DEFAULT_MAPBOX_SATELITE_STYLES, DEFAULT_MAPBOX_STYLES);
|
|
360
|
+
export var GEOJSON_FIELDS = {
|
|
361
|
+
geojson: ['_geojson', 'all_points', 'geojson']
|
|
362
|
+
};
|
|
363
|
+
export var ICON_FIELDS = {
|
|
364
|
+
icon: ['icon']
|
|
365
|
+
};
|
|
366
|
+
export var TRIP_POINT_FIELDS = [['lat', 'lng'], ['lat', 'lon'], ['lat', 'long'], ['latitude', 'longitude']];
|
|
367
|
+
export var ALTITUDE_FIELDS = ['alt', 'altitude'];
|
|
368
|
+
export var TRIP_ARC_FIELDS = {
|
|
369
|
+
lat0: 'begintrip',
|
|
370
|
+
lng0: 'begintrip',
|
|
371
|
+
lat1: 'dropoff',
|
|
372
|
+
lng1: 'dropoff'
|
|
373
|
+
};
|
|
374
|
+
export var FILTER_TYPES = keyMirror({
|
|
375
|
+
range: null,
|
|
376
|
+
select: null,
|
|
377
|
+
input: null,
|
|
378
|
+
timeRange: null,
|
|
379
|
+
multiSelect: null,
|
|
380
|
+
polygon: null
|
|
381
|
+
});
|
|
382
|
+
export var FILTER_VIEW_TYPES = keyMirror({
|
|
383
|
+
side: null,
|
|
384
|
+
enlarged: null,
|
|
385
|
+
minified: null
|
|
386
|
+
});
|
|
387
|
+
export var DEFAULT_FILTER_VIEW_TYPE = FILTER_VIEW_TYPES.side;
|
|
388
|
+
export var SCALE_TYPES = keyMirror({
|
|
389
|
+
ordinal: null,
|
|
390
|
+
quantile: null,
|
|
391
|
+
quantize: null,
|
|
392
|
+
jenks: null,
|
|
393
|
+
linear: null,
|
|
394
|
+
sqrt: null,
|
|
395
|
+
log: null,
|
|
396
|
+
threshold: null,
|
|
397
|
+
custom: null,
|
|
398
|
+
customOrdinal: null,
|
|
399
|
+
// ordinal domain to linear range
|
|
400
|
+
point: null
|
|
401
|
+
});
|
|
402
|
+
export var SCALE_TYPE_NAMES = {
|
|
403
|
+
ordinal: 'Ordinal',
|
|
404
|
+
quantile: 'Quantile',
|
|
405
|
+
quantize: 'Quantize',
|
|
406
|
+
jenks: 'Jenks Natural Breaks',
|
|
407
|
+
linear: 'Linear',
|
|
408
|
+
sqrt: 'Sqrt',
|
|
409
|
+
log: 'Log',
|
|
410
|
+
threshold: 'Threshold',
|
|
411
|
+
custom: 'Custom Breaks',
|
|
412
|
+
customOrdinal: 'Custom Ordinal',
|
|
413
|
+
point: 'Point'
|
|
414
|
+
};
|
|
415
|
+
export var SCALE_FUNC = (_SCALE_FUNC = {}, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_SCALE_FUNC, SCALE_TYPES.linear, scaleLinear), SCALE_TYPES.quantize, scaleQuantize), SCALE_TYPES.quantile, scaleQuantile), SCALE_TYPES.jenks, scaleThreshold), SCALE_TYPES.ordinal, scaleOrdinal), SCALE_TYPES.sqrt, scaleSqrt), SCALE_TYPES.log, scaleLog), SCALE_TYPES.point, scalePoint), SCALE_TYPES.threshold, scaleThreshold), SCALE_TYPES.custom, scaleThreshold), _defineProperty(_SCALE_FUNC, SCALE_TYPES.customOrdinal, scaleOrdinal));
|
|
416
|
+
export var ALL_FIELD_TYPES = keyMirror({
|
|
417
|
+
"boolean": null,
|
|
418
|
+
date: null,
|
|
419
|
+
geojson: null,
|
|
420
|
+
integer: null,
|
|
421
|
+
real: null,
|
|
422
|
+
string: null,
|
|
423
|
+
timestamp: null,
|
|
424
|
+
point: null,
|
|
425
|
+
array: null,
|
|
426
|
+
object: null,
|
|
427
|
+
geoarrow: null,
|
|
428
|
+
h3: null
|
|
429
|
+
});
|
|
430
|
+
|
|
431
|
+
// Data Table
|
|
432
|
+
export var SORT_ORDER = keyMirror({
|
|
433
|
+
ASCENDING: null,
|
|
434
|
+
DESCENDING: null,
|
|
435
|
+
UNSORT: null
|
|
436
|
+
});
|
|
437
|
+
export var TABLE_OPTION = keyMirror({
|
|
438
|
+
SORT_ASC: null,
|
|
439
|
+
SORT_DES: null,
|
|
440
|
+
UNSORT: null,
|
|
441
|
+
PIN: null,
|
|
442
|
+
UNPIN: null,
|
|
443
|
+
COPY: null,
|
|
444
|
+
FORMAT_COLUMN: null,
|
|
445
|
+
HIDE: null,
|
|
446
|
+
RENAME: null,
|
|
447
|
+
CHANGE_TYPE: null,
|
|
448
|
+
DELETE: null,
|
|
449
|
+
CREATE_FILTER: null
|
|
450
|
+
});
|
|
451
|
+
export var TABLE_OPTION_LIST = [{
|
|
452
|
+
value: TABLE_OPTION.SORT_ASC,
|
|
453
|
+
display: 'Sort Ascending',
|
|
454
|
+
icon: 'ArrowUp',
|
|
455
|
+
condition: function condition(props) {
|
|
456
|
+
return props.sortTableColumn && props.sortMode !== SORT_ORDER.ASCENDING;
|
|
457
|
+
}
|
|
458
|
+
}, {
|
|
459
|
+
value: TABLE_OPTION.SORT_DES,
|
|
460
|
+
display: 'Sort Descending',
|
|
461
|
+
icon: 'ArrowDown',
|
|
462
|
+
condition: function condition(props) {
|
|
463
|
+
return props.sortTableColumn && props.sortMode !== SORT_ORDER.DESCENDING;
|
|
464
|
+
}
|
|
465
|
+
}, {
|
|
466
|
+
value: TABLE_OPTION.UNSORT,
|
|
467
|
+
display: 'Unsort Column',
|
|
468
|
+
icon: 'Cancel',
|
|
469
|
+
condition: function condition(props) {
|
|
470
|
+
return props.isSorted;
|
|
471
|
+
}
|
|
472
|
+
}, {
|
|
473
|
+
value: TABLE_OPTION.PIN,
|
|
474
|
+
display: 'Pin Column',
|
|
475
|
+
icon: 'Pin',
|
|
476
|
+
condition: function condition(props) {
|
|
477
|
+
return !props.isPinned;
|
|
478
|
+
}
|
|
479
|
+
}, {
|
|
480
|
+
value: TABLE_OPTION.UNPIN,
|
|
481
|
+
display: 'Unpin Column',
|
|
482
|
+
icon: 'Cancel',
|
|
483
|
+
condition: function condition(props) {
|
|
484
|
+
return props.isPinned;
|
|
485
|
+
}
|
|
486
|
+
}, {
|
|
487
|
+
value: TABLE_OPTION.COPY,
|
|
488
|
+
display: 'Copy Column',
|
|
489
|
+
icon: 'Clipboard'
|
|
490
|
+
}, {
|
|
491
|
+
value: TABLE_OPTION.HIDE,
|
|
492
|
+
display: 'Hide Column',
|
|
493
|
+
icon: 'EyeUnseen',
|
|
494
|
+
condition: function condition(props) {
|
|
495
|
+
return props.hideTableColumn;
|
|
496
|
+
}
|
|
497
|
+
}, {
|
|
498
|
+
value: TABLE_OPTION.FORMAT_COLUMN,
|
|
499
|
+
display: 'Format Column',
|
|
500
|
+
icon: 'Hash',
|
|
501
|
+
condition: function condition(props) {
|
|
502
|
+
return props.setDisplayFormat;
|
|
503
|
+
}
|
|
504
|
+
}, {
|
|
505
|
+
value: TABLE_OPTION.RENAME,
|
|
506
|
+
display: 'Rename',
|
|
507
|
+
icon: 'Edit',
|
|
508
|
+
condition: function condition(props) {
|
|
509
|
+
return props.renameTableColumn;
|
|
510
|
+
}
|
|
511
|
+
}, {
|
|
512
|
+
value: TABLE_OPTION.CHANGE_TYPE,
|
|
513
|
+
display: 'Change Data Type',
|
|
514
|
+
icon: 'Edit',
|
|
515
|
+
condition: function condition(props) {
|
|
516
|
+
return props.changeTableColumnType;
|
|
517
|
+
}
|
|
518
|
+
}, {
|
|
519
|
+
value: TABLE_OPTION.CREATE_FILTER,
|
|
520
|
+
display: 'Create Filter',
|
|
521
|
+
icon: 'FilterFunnel',
|
|
522
|
+
condition: function condition(props) {
|
|
523
|
+
return props.createFilterFromColumn;
|
|
524
|
+
}
|
|
525
|
+
}, {
|
|
526
|
+
value: TABLE_OPTION.DELETE,
|
|
527
|
+
display: 'Delete Column',
|
|
528
|
+
icon: 'Trash',
|
|
529
|
+
condition: function condition(props) {
|
|
530
|
+
return props.deleteTableColumn && Object.keys(props.colMeta || {}).length > 1;
|
|
531
|
+
}
|
|
532
|
+
}];
|
|
533
|
+
var YELLOW = '248, 194, 28';
|
|
534
|
+
var PINK = '242, 152, 163';
|
|
535
|
+
var PURPLE = '160, 106, 206';
|
|
536
|
+
var BLUE = '140, 210, 205';
|
|
537
|
+
var BLUE2 = '106, 160, 206';
|
|
538
|
+
var BLUE3 = '0, 172, 237';
|
|
539
|
+
var GREEN = '106, 160, 56';
|
|
540
|
+
var GREEN2 = '74, 165, 150';
|
|
541
|
+
var RED = '237, 88, 106';
|
|
542
|
+
var ORANGE = '231, 110, 58';
|
|
543
|
+
export var FIELD_TYPE_DISPLAY = (_FIELD_TYPE_DISPLAY = {}, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_FIELD_TYPE_DISPLAY, ALL_FIELD_TYPES["boolean"], {
|
|
544
|
+
label: 'bool',
|
|
545
|
+
color: PINK
|
|
546
|
+
}), ALL_FIELD_TYPES.date, {
|
|
547
|
+
label: 'date',
|
|
548
|
+
color: PURPLE
|
|
549
|
+
}), ALL_FIELD_TYPES.geojson, {
|
|
550
|
+
label: 'geo',
|
|
551
|
+
color: BLUE2
|
|
552
|
+
}), ALL_FIELD_TYPES.geoarrow, {
|
|
553
|
+
label: 'geo',
|
|
554
|
+
color: BLUE2
|
|
555
|
+
}), ALL_FIELD_TYPES.integer, {
|
|
556
|
+
label: 'int',
|
|
557
|
+
color: YELLOW
|
|
558
|
+
}), ALL_FIELD_TYPES.real, {
|
|
559
|
+
label: 'float',
|
|
560
|
+
color: YELLOW
|
|
561
|
+
}), ALL_FIELD_TYPES.string, {
|
|
562
|
+
label: 'string',
|
|
563
|
+
color: BLUE
|
|
564
|
+
}), ALL_FIELD_TYPES.timestamp, {
|
|
565
|
+
label: 'time',
|
|
566
|
+
color: GREEN
|
|
567
|
+
}), ALL_FIELD_TYPES.point, {
|
|
568
|
+
label: 'point',
|
|
569
|
+
color: BLUE3
|
|
570
|
+
}), ALL_FIELD_TYPES.array, {
|
|
571
|
+
label: 'array',
|
|
572
|
+
color: ORANGE
|
|
573
|
+
}), _defineProperty(_defineProperty(_FIELD_TYPE_DISPLAY, ALL_FIELD_TYPES.object, {
|
|
574
|
+
label: 'object',
|
|
575
|
+
color: GREEN2
|
|
576
|
+
}), ALL_FIELD_TYPES.h3, {
|
|
577
|
+
label: 'h3',
|
|
578
|
+
color: BLUE
|
|
579
|
+
}));
|
|
580
|
+
export var FIELD_COLORS = {
|
|
581
|
+
"default": RED
|
|
582
|
+
};
|
|
583
|
+
export var HIGHLIGH_COLOR_3D = [255, 255, 255, 60];
|
|
584
|
+
export var CHANNEL_SCALES = keyMirror({
|
|
585
|
+
color: null,
|
|
586
|
+
radius: null,
|
|
587
|
+
size: null,
|
|
588
|
+
colorAggr: null,
|
|
589
|
+
sizeAggr: null,
|
|
590
|
+
angle: null
|
|
591
|
+
});
|
|
592
|
+
export var AGGREGATION_TYPES = {
|
|
593
|
+
// default
|
|
594
|
+
count: 'count',
|
|
595
|
+
// linear
|
|
596
|
+
average: 'average',
|
|
597
|
+
maximum: 'maximum',
|
|
598
|
+
minimum: 'minimum',
|
|
599
|
+
median: 'median',
|
|
600
|
+
stdev: 'stdev',
|
|
601
|
+
sum: 'sum',
|
|
602
|
+
variance: 'variance',
|
|
603
|
+
// ordinal
|
|
604
|
+
mode: 'mode',
|
|
605
|
+
countUnique: 'countUnique'
|
|
606
|
+
};
|
|
607
|
+
export var AGGREGATION_TYPE_OPTIONS = Object.entries(AGGREGATION_TYPES).map(function (_ref7) {
|
|
608
|
+
var _ref8 = _slicedToArray(_ref7, 2),
|
|
609
|
+
key = _ref8[0],
|
|
610
|
+
value = _ref8[1];
|
|
611
|
+
return {
|
|
612
|
+
id: key,
|
|
613
|
+
label: key === 'stdev' ? 'Std Deviation' : key === 'countUnique' ? 'Count Unique' : typeof value === 'string' ? value.charAt(0).toUpperCase() + value.slice(1) : value
|
|
614
|
+
};
|
|
615
|
+
});
|
|
616
|
+
export var linearFieldScaleFunctions = _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, CHANNEL_SCALES.color, [SCALE_TYPES.quantize, SCALE_TYPES.quantile, SCALE_TYPES.jenks, SCALE_TYPES.custom]), CHANNEL_SCALES.radius, [SCALE_TYPES.sqrt]), CHANNEL_SCALES.size, [SCALE_TYPES.linear, SCALE_TYPES.sqrt, SCALE_TYPES.log]), CHANNEL_SCALES.angle, [SCALE_TYPES.linear]);
|
|
617
|
+
var DEFAULT_AGGREGATION_COLOR_SCALES = [SCALE_TYPES.quantize, SCALE_TYPES.quantile, SCALE_TYPES.jenks, SCALE_TYPES.custom];
|
|
618
|
+
export var linearFieldAggrScaleFunctions = _defineProperty(_defineProperty({}, CHANNEL_SCALES.colorAggr, [AGGREGATION_TYPES.average, AGGREGATION_TYPES.maximum, AGGREGATION_TYPES.minimum, AGGREGATION_TYPES.median, AGGREGATION_TYPES.stdev, AGGREGATION_TYPES.sum, AGGREGATION_TYPES.variance, AGGREGATION_TYPES.count].reduce(function (prev, cur) {
|
|
619
|
+
prev[cur] = DEFAULT_AGGREGATION_COLOR_SCALES;
|
|
620
|
+
return prev;
|
|
621
|
+
}, {})), CHANNEL_SCALES.sizeAggr, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, AGGREGATION_TYPES.average, [SCALE_TYPES.linear, SCALE_TYPES.sqrt, SCALE_TYPES.log]), AGGREGATION_TYPES.maximum, [SCALE_TYPES.linear, SCALE_TYPES.sqrt, SCALE_TYPES.log]), AGGREGATION_TYPES.minimum, [SCALE_TYPES.linear, SCALE_TYPES.sqrt, SCALE_TYPES.log]), AGGREGATION_TYPES.median, [SCALE_TYPES.linear, SCALE_TYPES.sqrt, SCALE_TYPES.log]), AGGREGATION_TYPES.stdev, [SCALE_TYPES.linear, SCALE_TYPES.sqrt, SCALE_TYPES.log]), AGGREGATION_TYPES.sum, [SCALE_TYPES.linear, SCALE_TYPES.sqrt, SCALE_TYPES.log]), AGGREGATION_TYPES.variance, [SCALE_TYPES.linear, SCALE_TYPES.sqrt, SCALE_TYPES.log]));
|
|
622
|
+
export var ordinalFieldScaleFunctions = _defineProperty(_defineProperty(_defineProperty({}, CHANNEL_SCALES.color, [SCALE_TYPES.ordinal, SCALE_TYPES.customOrdinal]), CHANNEL_SCALES.radius, [SCALE_TYPES.point]), CHANNEL_SCALES.size, [SCALE_TYPES.point]);
|
|
623
|
+
export var ordinalFieldAggrScaleFunctions = _defineProperty(_defineProperty({}, CHANNEL_SCALES.colorAggr, _defineProperty(_defineProperty({}, AGGREGATION_TYPES.mode, [SCALE_TYPES.ordinal]), AGGREGATION_TYPES.countUnique, [SCALE_TYPES.quantize, SCALE_TYPES.quantile])), CHANNEL_SCALES.sizeAggr, {});
|
|
624
|
+
export var notSupportedScaleOpts = _defineProperty(_defineProperty(_defineProperty({}, CHANNEL_SCALES.color, []), CHANNEL_SCALES.radius, []), CHANNEL_SCALES.size, []);
|
|
625
|
+
export var notSupportAggrOpts = _defineProperty(_defineProperty({}, CHANNEL_SCALES.colorAggr, {}), CHANNEL_SCALES.sizeAggr, {});
|
|
626
|
+
|
|
627
|
+
/**
|
|
628
|
+
* Default aggregation are based on ocunt
|
|
629
|
+
*/
|
|
630
|
+
export var DEFAULT_AGGREGATION = _defineProperty(_defineProperty({}, CHANNEL_SCALES.colorAggr, _defineProperty({}, AGGREGATION_TYPES.count, DEFAULT_AGGREGATION_COLOR_SCALES)), CHANNEL_SCALES.sizeAggr, _defineProperty({}, AGGREGATION_TYPES.count, [SCALE_TYPES.linear, SCALE_TYPES.sqrt, SCALE_TYPES.log]));
|
|
631
|
+
|
|
632
|
+
/**
|
|
633
|
+
* Define what type of scale operation is allowed on each type of fields
|
|
634
|
+
*/
|
|
635
|
+
export var FIELD_OPTS = (_FIELD_OPTS = {}, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_FIELD_OPTS, ALL_FIELD_TYPES.string, {
|
|
636
|
+
type: 'categorical',
|
|
637
|
+
scale: _objectSpread(_objectSpread({}, ordinalFieldScaleFunctions), ordinalFieldAggrScaleFunctions),
|
|
638
|
+
format: {
|
|
639
|
+
legend: function legend(d) {
|
|
640
|
+
return d;
|
|
641
|
+
},
|
|
642
|
+
tooltip: []
|
|
643
|
+
}
|
|
644
|
+
}), ALL_FIELD_TYPES.real, {
|
|
645
|
+
type: 'numerical',
|
|
646
|
+
scale: _objectSpread(_objectSpread({}, linearFieldScaleFunctions), linearFieldAggrScaleFunctions),
|
|
647
|
+
format: {
|
|
648
|
+
legend: function legend(d) {
|
|
649
|
+
return d;
|
|
650
|
+
},
|
|
651
|
+
tooltip: [TOOLTIP_FORMAT_TYPES.NONE, TOOLTIP_FORMAT_TYPES.DECIMAL, TOOLTIP_FORMAT_TYPES.PERCENTAGE]
|
|
652
|
+
}
|
|
653
|
+
}), ALL_FIELD_TYPES.timestamp, {
|
|
654
|
+
type: 'time',
|
|
655
|
+
scale: _objectSpread(_objectSpread({}, linearFieldScaleFunctions), notSupportAggrOpts),
|
|
656
|
+
format: {
|
|
657
|
+
legend: function legend(d) {
|
|
658
|
+
return d;
|
|
659
|
+
},
|
|
660
|
+
tooltip: [TOOLTIP_FORMAT_TYPES.NONE, TOOLTIP_FORMAT_TYPES.DATE, TOOLTIP_FORMAT_TYPES.DATE_TIME]
|
|
661
|
+
}
|
|
662
|
+
}), ALL_FIELD_TYPES.integer, {
|
|
663
|
+
type: 'numerical',
|
|
664
|
+
scale: _objectSpread(_objectSpread({}, _objectSpread(_objectSpread({}, linearFieldScaleFunctions), {}, _defineProperty({}, CHANNEL_SCALES.color, [].concat(_toConsumableArray(linearFieldScaleFunctions[CHANNEL_SCALES.color]), [SCALE_TYPES.customOrdinal])))), linearFieldAggrScaleFunctions),
|
|
665
|
+
format: {
|
|
666
|
+
legend: function legend(d) {
|
|
667
|
+
return d;
|
|
668
|
+
},
|
|
669
|
+
tooltip: [TOOLTIP_FORMAT_TYPES.NONE, TOOLTIP_FORMAT_TYPES.DECIMAL, TOOLTIP_FORMAT_TYPES.PERCENTAGE]
|
|
670
|
+
}
|
|
671
|
+
}), ALL_FIELD_TYPES["boolean"], {
|
|
672
|
+
type: 'boolean',
|
|
673
|
+
scale: _objectSpread(_objectSpread({}, ordinalFieldScaleFunctions), ordinalFieldAggrScaleFunctions),
|
|
674
|
+
format: {
|
|
675
|
+
legend: function legend(d) {
|
|
676
|
+
return d;
|
|
677
|
+
},
|
|
678
|
+
tooltip: [TOOLTIP_FORMAT_TYPES.NONE, TOOLTIP_FORMAT_TYPES.BOOLEAN]
|
|
679
|
+
}
|
|
680
|
+
}), ALL_FIELD_TYPES.date, {
|
|
681
|
+
type: 'time',
|
|
682
|
+
scale: _objectSpread(_objectSpread({}, ordinalFieldScaleFunctions), ordinalFieldAggrScaleFunctions),
|
|
683
|
+
format: {
|
|
684
|
+
legend: function legend(d) {
|
|
685
|
+
return d;
|
|
686
|
+
},
|
|
687
|
+
tooltip: [TOOLTIP_FORMAT_TYPES.NONE, TOOLTIP_FORMAT_TYPES.DATE]
|
|
688
|
+
}
|
|
689
|
+
}), ALL_FIELD_TYPES.geojson, {
|
|
690
|
+
type: 'geometry',
|
|
691
|
+
scale: _objectSpread(_objectSpread({}, notSupportedScaleOpts), notSupportAggrOpts),
|
|
692
|
+
format: {
|
|
693
|
+
legend: function legend() {
|
|
694
|
+
return '...';
|
|
695
|
+
},
|
|
696
|
+
tooltip: []
|
|
697
|
+
}
|
|
698
|
+
}), ALL_FIELD_TYPES.geoarrow, {
|
|
699
|
+
type: 'geometry',
|
|
700
|
+
scale: _objectSpread(_objectSpread({}, notSupportedScaleOpts), notSupportAggrOpts),
|
|
701
|
+
format: {
|
|
702
|
+
legend: function legend() {
|
|
703
|
+
return '...';
|
|
704
|
+
},
|
|
705
|
+
tooltip: []
|
|
706
|
+
}
|
|
707
|
+
}), ALL_FIELD_TYPES.object, {
|
|
708
|
+
type: 'numerical',
|
|
709
|
+
scale: {},
|
|
710
|
+
format: {
|
|
711
|
+
legend: function legend() {
|
|
712
|
+
return '...';
|
|
713
|
+
},
|
|
714
|
+
tooltip: []
|
|
715
|
+
}
|
|
716
|
+
}), ALL_FIELD_TYPES.array, {
|
|
717
|
+
type: 'numerical',
|
|
718
|
+
scale: {},
|
|
719
|
+
format: {
|
|
720
|
+
legend: function legend() {
|
|
721
|
+
return '...';
|
|
722
|
+
},
|
|
723
|
+
tooltip: []
|
|
724
|
+
}
|
|
725
|
+
}), _defineProperty(_FIELD_OPTS, ALL_FIELD_TYPES.h3, {
|
|
726
|
+
type: 'h3',
|
|
727
|
+
scale: _objectSpread(_objectSpread({}, notSupportedScaleOpts), notSupportAggrOpts),
|
|
728
|
+
format: {
|
|
729
|
+
legend: function legend() {
|
|
730
|
+
return '...';
|
|
731
|
+
},
|
|
732
|
+
tooltip: []
|
|
733
|
+
}
|
|
734
|
+
}));
|
|
735
|
+
export var CHANNEL_SCALE_SUPPORTED_FIELDS = Object.keys(CHANNEL_SCALES).reduce(function (accu, key) {
|
|
736
|
+
return _objectSpread(_objectSpread({}, accu), {}, _defineProperty({}, key, Object.keys(FIELD_OPTS).filter(function (ft) {
|
|
737
|
+
return FIELD_OPTS[ft].scale[key] && Object.keys(FIELD_OPTS[ft].scale[key]).length;
|
|
738
|
+
})));
|
|
739
|
+
}, {});
|
|
740
|
+
export var DEFAULT_LAYER_COLOR = {
|
|
741
|
+
tripArc: '#9226C6',
|
|
742
|
+
begintrip_lat: '#1E96BE',
|
|
743
|
+
dropoff_lat: '#FF991F',
|
|
744
|
+
request_lat: '#52A353'
|
|
745
|
+
};
|
|
746
|
+
export var DEFAULT_LAYER_COLOR_PALETTE = 'Global Warming';
|
|
747
|
+
export var DEFAULT_LAYER_COLOR_PALETTE_STEPS = 6;
|
|
748
|
+
|
|
749
|
+
// let user pass in default tooltip fields
|
|
750
|
+
export var DEFAULT_TOOLTIP_FIELDS = [];
|
|
751
|
+
export var NO_VALUE_COLOR = [0, 0, 0, 0];
|
|
752
|
+
/** Visible gray used when a color field has no value and missing features should stay on the map. */
|
|
753
|
+
export var MISSING_VALUE_COLOR = [128, 128, 128, 255];
|
|
754
|
+
export var DEFAULT_PICKING_RADIUS = 3;
|
|
755
|
+
export var OVERLAY_BLENDINGS = {
|
|
756
|
+
normal: {
|
|
757
|
+
label: 'overlayBlending.normal',
|
|
758
|
+
value: 'normal'
|
|
759
|
+
},
|
|
760
|
+
screen: {
|
|
761
|
+
label: 'overlayBlending.screen',
|
|
762
|
+
value: 'screen'
|
|
763
|
+
},
|
|
764
|
+
darken: {
|
|
765
|
+
label: 'overlayBlending.darken',
|
|
766
|
+
value: 'darken'
|
|
767
|
+
}
|
|
768
|
+
};
|
|
769
|
+
export var LAYER_BLENDINGS = {
|
|
770
|
+
additive: {
|
|
771
|
+
label: 'layerBlending.additive',
|
|
772
|
+
blendFunc: ['SRC_ALPHA', 'DST_ALPHA'],
|
|
773
|
+
blendEquation: 'FUNC_ADD'
|
|
774
|
+
},
|
|
775
|
+
normal: {
|
|
776
|
+
// reference to
|
|
777
|
+
// https://limnu.com/webgl-blending-youre-probably-wrong/
|
|
778
|
+
label: 'layerBlending.normal',
|
|
779
|
+
blendFunc: ['SRC_ALPHA', 'ONE_MINUS_SRC_ALPHA', 'ONE', 'ONE_MINUS_SRC_ALPHA'],
|
|
780
|
+
blendEquation: ['FUNC_ADD', 'FUNC_ADD']
|
|
781
|
+
},
|
|
782
|
+
subtractive: {
|
|
783
|
+
label: 'layerBlending.subtractive',
|
|
784
|
+
blendFunc: ['ONE', 'ONE_MINUS_DST_COLOR', 'SRC_ALPHA', 'DST_ALPHA'],
|
|
785
|
+
blendEquation: ['FUNC_SUBTRACT', 'FUNC_ADD']
|
|
786
|
+
}
|
|
787
|
+
};
|
|
788
|
+
export var MAX_DEFAULT_TOOLTIPS = 5;
|
|
789
|
+
export var RESOLUTIONS = keyMirror({
|
|
790
|
+
ONE_X: null,
|
|
791
|
+
TWO_X: null
|
|
792
|
+
});
|
|
793
|
+
export var EXPORT_IMG_RATIOS = keyMirror({
|
|
794
|
+
SCREEN: null,
|
|
795
|
+
FOUR_BY_THREE: null,
|
|
796
|
+
SIXTEEN_BY_NINE: null,
|
|
797
|
+
CUSTOM: null
|
|
798
|
+
});
|
|
799
|
+
export var ScreenRatioOption = {
|
|
800
|
+
id: EXPORT_IMG_RATIOS.SCREEN,
|
|
801
|
+
label: 'modal.exportImage.ratioOriginalScreen',
|
|
802
|
+
getSize: function getSize(screenW, screenH) {
|
|
803
|
+
return {
|
|
804
|
+
width: screenW,
|
|
805
|
+
height: screenH
|
|
806
|
+
};
|
|
807
|
+
}
|
|
808
|
+
};
|
|
809
|
+
export var CustomRatioOption = {
|
|
810
|
+
id: EXPORT_IMG_RATIOS.CUSTOM,
|
|
811
|
+
hidden: true,
|
|
812
|
+
label: 'modal.exportImage.ratioCustom',
|
|
813
|
+
getSize: function getSize(mapW, mapH) {
|
|
814
|
+
return {
|
|
815
|
+
width: mapW,
|
|
816
|
+
height: mapH
|
|
817
|
+
};
|
|
818
|
+
}
|
|
819
|
+
};
|
|
820
|
+
export var FourByThreeRatioOption = {
|
|
821
|
+
id: EXPORT_IMG_RATIOS.FOUR_BY_THREE,
|
|
822
|
+
label: 'modal.exportImage.ratio4_3',
|
|
823
|
+
getSize: function getSize(screenW) {
|
|
824
|
+
return {
|
|
825
|
+
width: screenW,
|
|
826
|
+
height: Math.round(screenW * 0.75)
|
|
827
|
+
};
|
|
828
|
+
}
|
|
829
|
+
};
|
|
830
|
+
export var SixteenByNineRatioOption = {
|
|
831
|
+
id: EXPORT_IMG_RATIOS.SIXTEEN_BY_NINE,
|
|
832
|
+
label: 'modal.exportImage.ratio16_9',
|
|
833
|
+
getSize: function getSize(screenW) {
|
|
834
|
+
return {
|
|
835
|
+
width: screenW,
|
|
836
|
+
height: Math.round(screenW * 0.5625)
|
|
837
|
+
};
|
|
838
|
+
}
|
|
839
|
+
};
|
|
840
|
+
export var EXPORT_IMG_RATIO_OPTIONS = [ScreenRatioOption, FourByThreeRatioOption, SixteenByNineRatioOption, CustomRatioOption];
|
|
841
|
+
export var OneXResolutionOption = {
|
|
842
|
+
id: RESOLUTIONS.ONE_X,
|
|
843
|
+
label: '1x',
|
|
844
|
+
available: true,
|
|
845
|
+
scale: 1,
|
|
846
|
+
getSize: function getSize(screenW, screenH) {
|
|
847
|
+
return {
|
|
848
|
+
width: screenW,
|
|
849
|
+
height: screenH
|
|
850
|
+
};
|
|
851
|
+
}
|
|
852
|
+
};
|
|
853
|
+
export var TwoXResolutionOption = {
|
|
854
|
+
id: RESOLUTIONS.TWO_X,
|
|
855
|
+
label: '2x',
|
|
856
|
+
available: true,
|
|
857
|
+
scale: 2,
|
|
858
|
+
getSize: function getSize(screenW, screenH) {
|
|
859
|
+
return {
|
|
860
|
+
width: screenW * 2,
|
|
861
|
+
height: screenH * 2
|
|
862
|
+
};
|
|
863
|
+
}
|
|
864
|
+
};
|
|
865
|
+
|
|
866
|
+
// Fixed dimension options
|
|
867
|
+
export var Resolution1920x1080Option = {
|
|
868
|
+
id: '1920x1080',
|
|
869
|
+
label: '1920 × 1080 (16:9)',
|
|
870
|
+
available: true,
|
|
871
|
+
getSize: function getSize() {
|
|
872
|
+
return {
|
|
873
|
+
width: 1920,
|
|
874
|
+
height: 1080
|
|
875
|
+
};
|
|
876
|
+
}
|
|
877
|
+
};
|
|
878
|
+
export var Resolution1280x720Option = {
|
|
879
|
+
id: '1280x720',
|
|
880
|
+
label: '1280 × 720 (16:9)',
|
|
881
|
+
available: true,
|
|
882
|
+
getSize: function getSize() {
|
|
883
|
+
return {
|
|
884
|
+
width: 1280,
|
|
885
|
+
height: 720
|
|
886
|
+
};
|
|
887
|
+
}
|
|
888
|
+
};
|
|
889
|
+
export var Resolution2560x1440Option = {
|
|
890
|
+
id: '2560x1440',
|
|
891
|
+
label: '2560 × 1440 (16:9)',
|
|
892
|
+
available: true,
|
|
893
|
+
getSize: function getSize() {
|
|
894
|
+
return {
|
|
895
|
+
width: 2560,
|
|
896
|
+
height: 1440
|
|
897
|
+
};
|
|
898
|
+
}
|
|
899
|
+
};
|
|
900
|
+
export var Resolution1600x900Option = {
|
|
901
|
+
id: '1600x900',
|
|
902
|
+
label: '1600 × 900 (16:9)',
|
|
903
|
+
available: true,
|
|
904
|
+
getSize: function getSize() {
|
|
905
|
+
return {
|
|
906
|
+
width: 1600,
|
|
907
|
+
height: 900
|
|
908
|
+
};
|
|
909
|
+
}
|
|
910
|
+
};
|
|
911
|
+
export var Resolution1024x768Option = {
|
|
912
|
+
id: '1024x768',
|
|
913
|
+
label: '1024 × 768 (4:3)',
|
|
914
|
+
available: true,
|
|
915
|
+
getSize: function getSize() {
|
|
916
|
+
return {
|
|
917
|
+
width: 1024,
|
|
918
|
+
height: 768
|
|
919
|
+
};
|
|
920
|
+
}
|
|
921
|
+
};
|
|
922
|
+
export var Resolution1280x960Option = {
|
|
923
|
+
id: '1280x960',
|
|
924
|
+
label: '1280 × 960 (4:3)',
|
|
925
|
+
available: true,
|
|
926
|
+
getSize: function getSize() {
|
|
927
|
+
return {
|
|
928
|
+
width: 1280,
|
|
929
|
+
height: 960
|
|
930
|
+
};
|
|
931
|
+
}
|
|
932
|
+
};
|
|
933
|
+
export var Resolution1600x1200Option = {
|
|
934
|
+
id: '1600x1200',
|
|
935
|
+
label: '1600 × 1200 (4:3)',
|
|
936
|
+
available: true,
|
|
937
|
+
getSize: function getSize() {
|
|
938
|
+
return {
|
|
939
|
+
width: 1600,
|
|
940
|
+
height: 1200
|
|
941
|
+
};
|
|
942
|
+
}
|
|
943
|
+
};
|
|
944
|
+
export var Resolution1920x1440Option = {
|
|
945
|
+
id: '1920x1440',
|
|
946
|
+
label: '1920 × 1440 (4:3)',
|
|
947
|
+
available: true,
|
|
948
|
+
getSize: function getSize() {
|
|
949
|
+
return {
|
|
950
|
+
width: 1920,
|
|
951
|
+
height: 1440
|
|
952
|
+
};
|
|
953
|
+
}
|
|
954
|
+
};
|
|
955
|
+
export var EXPORT_IMG_RESOLUTION_OPTIONS = [OneXResolutionOption, TwoXResolutionOption, Resolution1280x720Option, Resolution1920x1080Option, Resolution2560x1440Option, Resolution1600x900Option, Resolution1024x768Option, Resolution1280x960Option, Resolution1600x1200Option, Resolution1920x1440Option];
|
|
956
|
+
export var EXPORT_DATA_TYPE = keyMirror({
|
|
957
|
+
CSV: null,
|
|
958
|
+
GEOJSON: null,
|
|
959
|
+
GEOPARQUET: null,
|
|
960
|
+
SHAPEFILE: null,
|
|
961
|
+
GEOPACKAGE: null,
|
|
962
|
+
KML: null,
|
|
963
|
+
KMZ: null
|
|
964
|
+
});
|
|
965
|
+
export var EXPORT_DATA_TYPE_OPTIONS = [{
|
|
966
|
+
id: EXPORT_DATA_TYPE.CSV,
|
|
967
|
+
label: 'csv',
|
|
968
|
+
available: true
|
|
969
|
+
}, {
|
|
970
|
+
id: EXPORT_DATA_TYPE.GEOJSON,
|
|
971
|
+
label: 'geojson',
|
|
972
|
+
available: true
|
|
973
|
+
}, {
|
|
974
|
+
id: EXPORT_DATA_TYPE.GEOPARQUET,
|
|
975
|
+
label: 'parquet',
|
|
976
|
+
available: true
|
|
977
|
+
}, {
|
|
978
|
+
id: EXPORT_DATA_TYPE.SHAPEFILE,
|
|
979
|
+
label: 'shp',
|
|
980
|
+
available: true
|
|
981
|
+
}, {
|
|
982
|
+
id: EXPORT_DATA_TYPE.GEOPACKAGE,
|
|
983
|
+
label: 'gpkg',
|
|
984
|
+
available: true
|
|
985
|
+
}, {
|
|
986
|
+
id: EXPORT_DATA_TYPE.KML,
|
|
987
|
+
label: 'kml',
|
|
988
|
+
available: true
|
|
989
|
+
}, {
|
|
990
|
+
id: EXPORT_DATA_TYPE.KMZ,
|
|
991
|
+
label: 'kmz',
|
|
992
|
+
available: true
|
|
993
|
+
}];
|
|
994
|
+
|
|
995
|
+
// Export map types
|
|
996
|
+
export var EXPORT_MAP_FORMATS = keyMirror({
|
|
997
|
+
HTML: null,
|
|
998
|
+
JSON: null
|
|
999
|
+
});
|
|
1000
|
+
export var EXPORT_HTML_MAP_MODES = keyMirror({
|
|
1001
|
+
READ: null,
|
|
1002
|
+
EDIT: null
|
|
1003
|
+
});
|
|
1004
|
+
|
|
1005
|
+
// Export map options
|
|
1006
|
+
export var EXPORT_MAP_FORMAT_OPTIONS = Object.entries(EXPORT_MAP_FORMATS).map(function (entry) {
|
|
1007
|
+
return {
|
|
1008
|
+
id: entry[0],
|
|
1009
|
+
label: entry[1].toLowerCase(),
|
|
1010
|
+
available: true
|
|
1011
|
+
};
|
|
1012
|
+
});
|
|
1013
|
+
export function getHTMLMapModeTileUrl(mode) {
|
|
1014
|
+
return "https://d1a3f4spazzrp4.cloudfront.net/kepler.gl/documentation/map-".concat(mode.toLowerCase(), "-mode.png");
|
|
1015
|
+
}
|
|
1016
|
+
export var EXPORT_HTML_MAP_MODE_OPTIONS = Object.entries(EXPORT_HTML_MAP_MODES).map(function (entry) {
|
|
1017
|
+
return {
|
|
1018
|
+
id: entry[0],
|
|
1019
|
+
label: "modal.exportMap.html.".concat(entry[1].toLowerCase()),
|
|
1020
|
+
available: true,
|
|
1021
|
+
url: getHTMLMapModeTileUrl(entry[1])
|
|
1022
|
+
};
|
|
1023
|
+
});
|
|
1024
|
+
export var DEFAULT_UUID_COUNT = 6;
|
|
1025
|
+
export var DEFAULT_NOTIFICATION_MESSAGE = 'MESSAGE_NOT_PROVIDED';
|
|
1026
|
+
export var DEFAULT_NOTIFICATION_TYPES = keyMirror({
|
|
1027
|
+
info: null,
|
|
1028
|
+
error: null,
|
|
1029
|
+
warning: null,
|
|
1030
|
+
success: null
|
|
1031
|
+
});
|
|
1032
|
+
export var DEFAULT_NOTIFICATION_TOPICS = keyMirror({
|
|
1033
|
+
global: null,
|
|
1034
|
+
file: null
|
|
1035
|
+
});
|
|
1036
|
+
|
|
1037
|
+
// Minimum time between identical notifications about deck.gl errors
|
|
1038
|
+
export var THROTTLE_NOTIFICATION_TIME = 330;
|
|
1039
|
+
|
|
1040
|
+
// Animation
|
|
1041
|
+
export var BASE_SPEED = 600;
|
|
1042
|
+
export var FPS = 60;
|
|
1043
|
+
|
|
1044
|
+
/**
|
|
1045
|
+
* 4 Animation Window Types
|
|
1046
|
+
* 1. free
|
|
1047
|
+
* |-> |->
|
|
1048
|
+
* Current time is a fixed range, animation controller calls next animation frames continuously to animation a moving window
|
|
1049
|
+
* The increment id based on domain / BASE_SPEED * SPEED
|
|
1050
|
+
*
|
|
1051
|
+
* 2. incremental
|
|
1052
|
+
* | |->
|
|
1053
|
+
* Same as free, current time is a growing range, only the max value of range increment during animation.
|
|
1054
|
+
* The increment is also based on domain / BASE_SPEED * SPEED
|
|
1055
|
+
*
|
|
1056
|
+
* 3. point
|
|
1057
|
+
* o -> o
|
|
1058
|
+
* Current time is a point, animation controller calls next animation frame continuously to animation a moving point
|
|
1059
|
+
* The increment is based on domain / BASE_SPEED * SPEED
|
|
1060
|
+
*
|
|
1061
|
+
* 4. interval
|
|
1062
|
+
* o ~> o
|
|
1063
|
+
* Current time is a point. An array of sorted time steps need to be provided.
|
|
1064
|
+
* animation controller calls next animation at a interval when the point jumps to the next step
|
|
1065
|
+
*/
|
|
1066
|
+
export var ANIMATION_WINDOW = keyMirror({
|
|
1067
|
+
free: null,
|
|
1068
|
+
incremental: null,
|
|
1069
|
+
point: null,
|
|
1070
|
+
interval: null
|
|
1071
|
+
});
|
|
1072
|
+
export var DEFAULT_TIME_FORMAT = 'MM/DD/YY HH:mm:ssa';
|
|
1073
|
+
export var SPEED_CONTROL_RANGE = [0, 10];
|
|
1074
|
+
export var SPEED_CONTROL_STEP = 0.001;
|
|
1075
|
+
|
|
1076
|
+
// Geocoder
|
|
1077
|
+
export var GEOCODER_DATASET_NAME = 'geocoder_dataset';
|
|
1078
|
+
export var GEOCODER_LAYER_ID = 'geocoder_layer';
|
|
1079
|
+
export var GEOCODER_GEO_OFFSET = 0.05;
|
|
1080
|
+
export var GEOCODER_ICON_COLOR = [255, 0, 0];
|
|
1081
|
+
// Base icon size before anchor normalization. The geocoder pin icon is bottom-anchored
|
|
1082
|
+
// and scaled to fit the ScatterplotLayer unit circle (~0.5x), so the rendered size is
|
|
1083
|
+
// compensated here (80 * 2 = 160).
|
|
1084
|
+
export var GEOCODER_ICON_SIZE = 160;
|
|
1085
|
+
|
|
1086
|
+
// Editor
|
|
1087
|
+
export var EDITOR_LAYER_ID = 'kepler_editor_layer';
|
|
1088
|
+
export var EDITOR_LAYER_PICKING_RADIUS = 6;
|
|
1089
|
+
export var EDITOR_MODES = {
|
|
1090
|
+
DRAW_POLYGON: 'DRAW_POLYGON',
|
|
1091
|
+
DRAW_RECTANGLE: 'DRAW_RECTANGLE',
|
|
1092
|
+
DRAW_CIRCLE: 'DRAW_CIRCLE',
|
|
1093
|
+
DRAW_LINESTRING: 'DRAW_LINESTRING',
|
|
1094
|
+
DRAW_POINT: 'DRAW_POINT',
|
|
1095
|
+
EDIT: 'EDIT_VERTEX'
|
|
1096
|
+
};
|
|
1097
|
+
export var EDITOR_DRAW_MODES = [EDITOR_MODES.DRAW_POLYGON, EDITOR_MODES.DRAW_RECTANGLE, EDITOR_MODES.DRAW_CIRCLE, EDITOR_MODES.DRAW_LINESTRING, EDITOR_MODES.DRAW_POINT];
|
|
1098
|
+
export var PLOT_TYPES = keyMirror({
|
|
1099
|
+
histogram: null,
|
|
1100
|
+
lineChart: null
|
|
1101
|
+
});
|
|
1102
|
+
|
|
1103
|
+
// Filter
|
|
1104
|
+
export var INIT_FILTER_ITEMS_IN_DROPDOWN = 100;
|
|
1105
|
+
|
|
1106
|
+
// GPU Filtering
|
|
1107
|
+
/**
|
|
1108
|
+
* Max number of filter value buffers that deck.gl provides
|
|
1109
|
+
*/
|
|
1110
|
+
export var MAX_GPU_FILTERS = 4;
|
|
1111
|
+
export var MAP_THUMBNAIL_DIMENSION = {
|
|
1112
|
+
width: 300,
|
|
1113
|
+
height: 200
|
|
1114
|
+
};
|
|
1115
|
+
export var MAP_INFO_CHARACTER = {
|
|
1116
|
+
title: 100,
|
|
1117
|
+
description: 1024
|
|
1118
|
+
};
|
|
1119
|
+
|
|
1120
|
+
// Load data
|
|
1121
|
+
export var LOADING_METHODS = keyMirror({
|
|
1122
|
+
upload: null,
|
|
1123
|
+
storage: null,
|
|
1124
|
+
tileset: null
|
|
1125
|
+
});
|
|
1126
|
+
export var DEFAULT_FEATURE_FLAGS = {};
|
|
1127
|
+
export var DATASET_FORMATS = keyMirror({
|
|
1128
|
+
row: null,
|
|
1129
|
+
geojson: null,
|
|
1130
|
+
csv: null,
|
|
1131
|
+
keplergl: null,
|
|
1132
|
+
arrow: null,
|
|
1133
|
+
duckdb: null
|
|
1134
|
+
});
|
|
1135
|
+
export var MAP_CONTROLS = keyMirror({
|
|
1136
|
+
visibleLayers: null,
|
|
1137
|
+
mapLegend: null,
|
|
1138
|
+
toggle3d: null,
|
|
1139
|
+
splitMap: null,
|
|
1140
|
+
mapDraw: null,
|
|
1141
|
+
mapLocale: null,
|
|
1142
|
+
mapTheme: null,
|
|
1143
|
+
effect: null,
|
|
1144
|
+
annotation: null,
|
|
1145
|
+
chart: null,
|
|
1146
|
+
viewportJson: null,
|
|
1147
|
+
mapInfo: null
|
|
1148
|
+
});
|
|
1149
|
+
export var MapViewMode = /*#__PURE__*/function (MapViewMode) {
|
|
1150
|
+
MapViewMode["MODE_2D"] = "MODE_2D";
|
|
1151
|
+
MapViewMode["MODE_3D"] = "MODE_3D";
|
|
1152
|
+
MapViewMode["MODE_GLOBE"] = "MODE_GLOBE";
|
|
1153
|
+
return MapViewMode;
|
|
1154
|
+
}({});
|
|
1155
|
+
|
|
1156
|
+
/**
|
|
1157
|
+
* Minimum zoom level allowed in globe mode. Negative values let the user zoom
|
|
1158
|
+
* out further than the web-mercator default of 0, so the whole globe can be
|
|
1159
|
+
* pulled back to appear smaller on screen.
|
|
1160
|
+
*/
|
|
1161
|
+
export var GLOBE_MIN_ZOOM = 2;
|
|
1162
|
+
|
|
1163
|
+
/**
|
|
1164
|
+
* Maximum zoom in globe mode.
|
|
1165
|
+
*
|
|
1166
|
+
* The previous "empty rectangles" at high zoom were caused by the vector basemap
|
|
1167
|
+
* layer declaring `maxZoom: 23` while the raw tile endpoints only have data to
|
|
1168
|
+
* z16 (mapbox-streets-v8) / z14 (CARTO) — deck then requested non-existent tiles
|
|
1169
|
+
* that 404. That is fixed in `getGlobeBaseLayers` by setting `maxZoom` to each
|
|
1170
|
+
* source's true data max so deck overzooms instead.
|
|
1171
|
+
*
|
|
1172
|
+
* The remaining practical ceiling is float32 precision: deck's globe places
|
|
1173
|
+
* geometry in common space on a sphere of radius 256 with no fp64/relative-to-
|
|
1174
|
+
* center trick, so beyond ~visual-zoom 16 (roughly this mapState zoom minus
|
|
1175
|
+
* `zoomAdjust(lat)` ≈ 1.65 at the equator) geometry starts to jitter/drift.
|
|
1176
|
+
*/
|
|
1177
|
+
export var GLOBE_MAX_ZOOM = 16;
|
|
1178
|
+
|
|
1179
|
+
/**
|
|
1180
|
+
* Maximum absolute center latitude allowed in globe mode. Constrains the camera
|
|
1181
|
+
* target to a band around the equator so the view can't be centered on the
|
|
1182
|
+
* poles (deck.gl's default clamps to ~85°, which lets the camera stare straight
|
|
1183
|
+
* down at a pole). Applies symmetrically to the northern and southern hemisphere.
|
|
1184
|
+
*/
|
|
1185
|
+
export var GLOBE_MAX_LATITUDE = 75;
|
|
1186
|
+
export var DEFAULT_GLOBE_CONFIG = {
|
|
1187
|
+
atmosphere: true,
|
|
1188
|
+
hugeHalo: true,
|
|
1189
|
+
hugeHaloRadius: 3.5,
|
|
1190
|
+
hugeHaloOpacity: 0.2,
|
|
1191
|
+
azimuth: false,
|
|
1192
|
+
azimuthAngle: 45,
|
|
1193
|
+
terminator: true,
|
|
1194
|
+
terminatorOpacity: 0.35,
|
|
1195
|
+
basemap: true,
|
|
1196
|
+
labels: false,
|
|
1197
|
+
labelsColor: [114.75, 114.75, 114.75],
|
|
1198
|
+
adminLines: true,
|
|
1199
|
+
adminLinesColor: [40, 63, 93],
|
|
1200
|
+
water: true,
|
|
1201
|
+
waterColor: [17, 35, 48],
|
|
1202
|
+
surface: true,
|
|
1203
|
+
surfaceColor: [9, 16, 29],
|
|
1204
|
+
// Color of the empty space rendered around the globe (deck.gl clear color).
|
|
1205
|
+
// Matches the previous hardcoded clear color [0.015, 0.035, 0.065] in 0-1 space.
|
|
1206
|
+
backgroundColor: [4, 9, 17],
|
|
1207
|
+
// Starfield behind the globe is on by default in globe view.
|
|
1208
|
+
stars: true
|
|
1209
|
+
};
|
|
1210
|
+
export var GLOBE_SUPPORTED_LAYERS = {
|
|
1211
|
+
point: true,
|
|
1212
|
+
arc: true,
|
|
1213
|
+
grid: true,
|
|
1214
|
+
hexagon: true,
|
|
1215
|
+
geojson: true,
|
|
1216
|
+
cluster: true,
|
|
1217
|
+
donut: false,
|
|
1218
|
+
icon: true,
|
|
1219
|
+
hexagonId: true,
|
|
1220
|
+
'3D': true,
|
|
1221
|
+
vectorTile: true,
|
|
1222
|
+
line: true,
|
|
1223
|
+
trip: true,
|
|
1224
|
+
rasterTile: true,
|
|
1225
|
+
heatmap: true,
|
|
1226
|
+
contour: false,
|
|
1227
|
+
voronoi: false,
|
|
1228
|
+
s2: false,
|
|
1229
|
+
tile3d: false,
|
|
1230
|
+
// Flow arrows are flat quads in common space (equatorial plane) and collapse when
|
|
1231
|
+
// viewed edge-on on the globe, so the flow layer is not supported in Globe mode.
|
|
1232
|
+
flow: false,
|
|
1233
|
+
// Flow Field uses mercator ClipExtension bounds; stock clipping is wrong on globe.
|
|
1234
|
+
flowField: false
|
|
1235
|
+
};
|
|
1236
|
+
export var MapSplitMode = /*#__PURE__*/function (MapSplitMode) {
|
|
1237
|
+
MapSplitMode["SINGLE_MAP"] = "SINGLE_MAP";
|
|
1238
|
+
MapSplitMode["DUAL_MAP"] = "DUAL_MAP";
|
|
1239
|
+
MapSplitMode["SWIPE_COMPARE"] = "SWIPE_COMPARE";
|
|
1240
|
+
return MapSplitMode;
|
|
1241
|
+
}({});
|
|
1242
|
+
|
|
1243
|
+
/**
|
|
1244
|
+
* A multiplier for screen-space width/scale for Arc, Line, Icon and Text layers.
|
|
1245
|
+
* Required in order to maintain the same appearance after upgrading to deck.gl v8.5.
|
|
1246
|
+
* https://github.com/visgl/deck.gl/blob/master/docs/upgrade-guide.md
|
|
1247
|
+
*/
|
|
1248
|
+
export var PROJECTED_PIXEL_SIZE_MULTIPLIER = 2 / 3;
|
|
1249
|
+
|
|
1250
|
+
/**
|
|
1251
|
+
* Maximum value for text outline width
|
|
1252
|
+
*/
|
|
1253
|
+
export var TEXT_OUTLINE_MULTIPLIER = 5;
|
|
1254
|
+
export var dataTestIds = {
|
|
1255
|
+
infoIcon: 'info-icon',
|
|
1256
|
+
warningIcon: 'warning-icon',
|
|
1257
|
+
errorIcon: 'error-icon',
|
|
1258
|
+
successIcon: 'success-icon',
|
|
1259
|
+
checkmarkIcon: 'checkmark-icon',
|
|
1260
|
+
copyNotificationIcon: 'copy-notification-icon',
|
|
1261
|
+
sortableLayerItem: 'sortable-layer-item',
|
|
1262
|
+
staticLayerItem: 'static-layer-item',
|
|
1263
|
+
layerTitleEditor: 'layer__title__editor',
|
|
1264
|
+
layerPanel: 'layer-panel',
|
|
1265
|
+
sortableEffectItem: 'sortable-effect-item',
|
|
1266
|
+
staticEffectItem: 'static-effect-item',
|
|
1267
|
+
providerLoading: 'provider-loading',
|
|
1268
|
+
providerMapInfoPanel: 'provider-map-info-panel',
|
|
1269
|
+
providerSelect: 'provider-select',
|
|
1270
|
+
cloudHeader: 'cloud-header',
|
|
1271
|
+
providerShareMap: 'provider-share-map'
|
|
1272
|
+
};
|
|
1273
|
+
|
|
1274
|
+
// Effects
|
|
1275
|
+
export var DEFAULT_TIMEZONE = 'UTC';
|
|
1276
|
+
export var DEFAULT_POST_PROCESSING_EFFECT_TYPE = 'ink';
|
|
1277
|
+
export var DEFAULT_LIGHT_COLOR = [255, 255, 255];
|
|
1278
|
+
export var DEFAULT_LIGHT_INTENSITY = 1;
|
|
1279
|
+
export var DEFAULT_SHADOW_INTENSITY = 0.5;
|
|
1280
|
+
export var DEFAULT_SHADOW_COLOR = [0, 0, 0];
|
|
1281
|
+
export var LIGHT_AND_SHADOW_EFFECT_TIME_MODES = {
|
|
1282
|
+
pick: 'pick',
|
|
1283
|
+
current: 'current',
|
|
1284
|
+
animation: 'animation'
|
|
1285
|
+
};
|
|
1286
|
+
export var DEFAULT_LIGHT_AND_SHADOW_PROPS = {
|
|
1287
|
+
timestamp: Date.now(),
|
|
1288
|
+
timeMode: LIGHT_AND_SHADOW_EFFECT_TIME_MODES.pick,
|
|
1289
|
+
shadowIntensity: DEFAULT_SHADOW_INTENSITY,
|
|
1290
|
+
shadowColor: [].concat(DEFAULT_SHADOW_COLOR),
|
|
1291
|
+
sunLightColor: [].concat(DEFAULT_LIGHT_COLOR),
|
|
1292
|
+
sunLightIntensity: DEFAULT_LIGHT_INTENSITY,
|
|
1293
|
+
ambientLightColor: [].concat(DEFAULT_LIGHT_COLOR),
|
|
1294
|
+
ambientLightIntensity: DEFAULT_LIGHT_INTENSITY
|
|
1295
|
+
};
|
|
1296
|
+
export var LIGHT_AND_SHADOW_EFFECT = {
|
|
1297
|
+
type: 'lightAndShadow',
|
|
1298
|
+
name: 'Light & Shadow',
|
|
1299
|
+
description: 'effectDescription.lightAndShadow',
|
|
1300
|
+
parameters: [{
|
|
1301
|
+
name: 'timestamp',
|
|
1302
|
+
min: 0,
|
|
1303
|
+
max: Number.MAX_SAFE_INTEGER
|
|
1304
|
+
}, {
|
|
1305
|
+
name: 'shadowIntensity',
|
|
1306
|
+
min: 0,
|
|
1307
|
+
max: 1,
|
|
1308
|
+
defaultValue: DEFAULT_SHADOW_INTENSITY
|
|
1309
|
+
}, {
|
|
1310
|
+
name: 'sunLightIntensity',
|
|
1311
|
+
min: 0,
|
|
1312
|
+
max: 5,
|
|
1313
|
+
defaultValue: DEFAULT_LIGHT_INTENSITY
|
|
1314
|
+
}, {
|
|
1315
|
+
name: 'ambientLightIntensity',
|
|
1316
|
+
min: 0,
|
|
1317
|
+
max: 5,
|
|
1318
|
+
defaultValue: DEFAULT_LIGHT_INTENSITY
|
|
1319
|
+
}, {
|
|
1320
|
+
name: 'shadowColor',
|
|
1321
|
+
type: 'color',
|
|
1322
|
+
min: 0,
|
|
1323
|
+
max: 255,
|
|
1324
|
+
defaultValue: DEFAULT_SHADOW_COLOR
|
|
1325
|
+
}, {
|
|
1326
|
+
name: 'sunLightColor',
|
|
1327
|
+
type: 'color',
|
|
1328
|
+
min: 0,
|
|
1329
|
+
max: 255,
|
|
1330
|
+
defaultValue: DEFAULT_LIGHT_COLOR
|
|
1331
|
+
}, {
|
|
1332
|
+
name: 'ambientLightColor',
|
|
1333
|
+
type: 'color',
|
|
1334
|
+
min: 0,
|
|
1335
|
+
max: 255,
|
|
1336
|
+
defaultValue: DEFAULT_LIGHT_COLOR
|
|
1337
|
+
}]
|
|
1338
|
+
};
|
|
1339
|
+
export var DISTANCE_FOG_TYPE = 'distanceFog';
|
|
1340
|
+
export var SURFACE_FOG_TYPE = 'surfaceFog';
|
|
1341
|
+
export var POSTPROCESSING_EFFECTS = {
|
|
1342
|
+
ink: {
|
|
1343
|
+
type: 'ink',
|
|
1344
|
+
name: 'Ink',
|
|
1345
|
+
description: 'effectDescription.ink',
|
|
1346
|
+
parameters: [{
|
|
1347
|
+
name: 'strength',
|
|
1348
|
+
min: 0,
|
|
1349
|
+
max: 1
|
|
1350
|
+
}]
|
|
1351
|
+
},
|
|
1352
|
+
brightnessContrast: {
|
|
1353
|
+
type: 'brightnessContrast',
|
|
1354
|
+
name: 'Brightness & Contrast',
|
|
1355
|
+
description: 'effectDescription.brightnessContrast',
|
|
1356
|
+
parameters: [{
|
|
1357
|
+
name: 'brightness',
|
|
1358
|
+
min: -1,
|
|
1359
|
+
max: 1
|
|
1360
|
+
}, {
|
|
1361
|
+
name: 'contrast',
|
|
1362
|
+
min: -1,
|
|
1363
|
+
max: 1
|
|
1364
|
+
}]
|
|
1365
|
+
},
|
|
1366
|
+
hueSaturation: {
|
|
1367
|
+
type: 'hueSaturation',
|
|
1368
|
+
name: 'Hue & Saturation',
|
|
1369
|
+
description: 'effectDescription.hueSaturation',
|
|
1370
|
+
parameters: [{
|
|
1371
|
+
name: 'hue',
|
|
1372
|
+
min: -1,
|
|
1373
|
+
max: 1
|
|
1374
|
+
}, {
|
|
1375
|
+
name: 'saturation',
|
|
1376
|
+
defaultValue: 0.25,
|
|
1377
|
+
min: -1,
|
|
1378
|
+
max: 1
|
|
1379
|
+
}]
|
|
1380
|
+
},
|
|
1381
|
+
vibrance: {
|
|
1382
|
+
type: 'vibrance',
|
|
1383
|
+
name: 'Vibrance',
|
|
1384
|
+
description: 'effectDescription.vibrance',
|
|
1385
|
+
parameters: [{
|
|
1386
|
+
name: 'amount',
|
|
1387
|
+
defaultValue: 0.5,
|
|
1388
|
+
min: -1,
|
|
1389
|
+
max: 1
|
|
1390
|
+
}]
|
|
1391
|
+
},
|
|
1392
|
+
sepia: {
|
|
1393
|
+
type: 'sepia',
|
|
1394
|
+
name: 'Sepia',
|
|
1395
|
+
description: 'effectDescription.sepia',
|
|
1396
|
+
parameters: [{
|
|
1397
|
+
name: 'amount',
|
|
1398
|
+
min: 0,
|
|
1399
|
+
max: 1
|
|
1400
|
+
}]
|
|
1401
|
+
},
|
|
1402
|
+
dotScreen: {
|
|
1403
|
+
type: 'dotScreen',
|
|
1404
|
+
name: 'Dot Screen',
|
|
1405
|
+
description: 'effectDescription.dotScreen',
|
|
1406
|
+
parameters: [{
|
|
1407
|
+
name: 'angle',
|
|
1408
|
+
min: 0,
|
|
1409
|
+
max: Math.PI / 2
|
|
1410
|
+
}, {
|
|
1411
|
+
name: 'size',
|
|
1412
|
+
min: 1,
|
|
1413
|
+
max: 20
|
|
1414
|
+
}, {
|
|
1415
|
+
name: 'center',
|
|
1416
|
+
type: 'array',
|
|
1417
|
+
label: ['Center X', 'Center Y'],
|
|
1418
|
+
defaultValue: [0.5, 0.5],
|
|
1419
|
+
min: 0,
|
|
1420
|
+
max: 1
|
|
1421
|
+
}]
|
|
1422
|
+
},
|
|
1423
|
+
colorHalftone: {
|
|
1424
|
+
type: 'colorHalftone',
|
|
1425
|
+
name: 'Color Halftone',
|
|
1426
|
+
description: 'effectDescription.colorHalftone',
|
|
1427
|
+
parameters: [{
|
|
1428
|
+
name: 'angle',
|
|
1429
|
+
min: 0,
|
|
1430
|
+
max: Math.PI / 2
|
|
1431
|
+
}, {
|
|
1432
|
+
name: 'size',
|
|
1433
|
+
min: 1,
|
|
1434
|
+
max: 20
|
|
1435
|
+
}, {
|
|
1436
|
+
name: 'center',
|
|
1437
|
+
type: 'array',
|
|
1438
|
+
label: ['Center X', 'Center Y'],
|
|
1439
|
+
defaultValue: [0.5, 0.5],
|
|
1440
|
+
min: 0,
|
|
1441
|
+
max: 1
|
|
1442
|
+
}]
|
|
1443
|
+
},
|
|
1444
|
+
noise: {
|
|
1445
|
+
type: 'noise',
|
|
1446
|
+
name: 'Noise',
|
|
1447
|
+
description: 'effectDescription.noise',
|
|
1448
|
+
parameters: [{
|
|
1449
|
+
name: 'amount',
|
|
1450
|
+
min: 0,
|
|
1451
|
+
max: 1
|
|
1452
|
+
}]
|
|
1453
|
+
},
|
|
1454
|
+
triangleBlur: {
|
|
1455
|
+
type: 'triangleBlur',
|
|
1456
|
+
name: 'Blur (Triangle)',
|
|
1457
|
+
description: 'effectDescription.triangleBlur',
|
|
1458
|
+
parameters: [{
|
|
1459
|
+
name: 'radius',
|
|
1460
|
+
min: 0,
|
|
1461
|
+
max: 100
|
|
1462
|
+
}]
|
|
1463
|
+
},
|
|
1464
|
+
zoomBlur: {
|
|
1465
|
+
type: 'zoomBlur',
|
|
1466
|
+
name: 'Blur (Zoom)',
|
|
1467
|
+
description: 'effectDescription.zoomBlur',
|
|
1468
|
+
parameters: [{
|
|
1469
|
+
name: 'strength',
|
|
1470
|
+
defaultValue: 0.05,
|
|
1471
|
+
min: 0,
|
|
1472
|
+
max: 1
|
|
1473
|
+
}, {
|
|
1474
|
+
name: 'center',
|
|
1475
|
+
type: 'array',
|
|
1476
|
+
label: ['Center X', 'Center Y'],
|
|
1477
|
+
defaultValue: [0.5, 0.5],
|
|
1478
|
+
min: 0,
|
|
1479
|
+
max: 1
|
|
1480
|
+
}]
|
|
1481
|
+
},
|
|
1482
|
+
tiltShift: {
|
|
1483
|
+
type: 'tiltShift',
|
|
1484
|
+
name: 'Blur (Tilt Shift)',
|
|
1485
|
+
description: 'effectDescription.tiltShift',
|
|
1486
|
+
parameters: [{
|
|
1487
|
+
name: 'blurRadius',
|
|
1488
|
+
label: 'Blur',
|
|
1489
|
+
min: 0,
|
|
1490
|
+
max: 50
|
|
1491
|
+
}, {
|
|
1492
|
+
name: 'gradientRadius',
|
|
1493
|
+
label: 'Gradient',
|
|
1494
|
+
min: 0,
|
|
1495
|
+
max: 400
|
|
1496
|
+
}, {
|
|
1497
|
+
name: 'start',
|
|
1498
|
+
type: 'array',
|
|
1499
|
+
label: ['Start', false],
|
|
1500
|
+
defaultValue: [0.0, 0.0],
|
|
1501
|
+
min: 0,
|
|
1502
|
+
max: 1
|
|
1503
|
+
}, {
|
|
1504
|
+
name: 'end',
|
|
1505
|
+
type: 'array',
|
|
1506
|
+
label: ['End', false],
|
|
1507
|
+
defaultValue: [1, 1],
|
|
1508
|
+
min: 0,
|
|
1509
|
+
max: 1
|
|
1510
|
+
}]
|
|
1511
|
+
},
|
|
1512
|
+
edgeWork: {
|
|
1513
|
+
type: 'edgeWork',
|
|
1514
|
+
name: 'Edge work',
|
|
1515
|
+
description: 'effectDescription.edgeWork',
|
|
1516
|
+
parameters: [{
|
|
1517
|
+
name: 'radius',
|
|
1518
|
+
min: 1,
|
|
1519
|
+
max: 50
|
|
1520
|
+
}]
|
|
1521
|
+
},
|
|
1522
|
+
vignette: {
|
|
1523
|
+
type: 'vignette',
|
|
1524
|
+
name: 'Vignette',
|
|
1525
|
+
description: 'effectDescription.vignette',
|
|
1526
|
+
parameters: [{
|
|
1527
|
+
name: 'amount',
|
|
1528
|
+
min: 0,
|
|
1529
|
+
max: 1
|
|
1530
|
+
}, {
|
|
1531
|
+
name: 'radius',
|
|
1532
|
+
min: 0,
|
|
1533
|
+
max: 1
|
|
1534
|
+
}]
|
|
1535
|
+
},
|
|
1536
|
+
magnify: {
|
|
1537
|
+
type: 'magnify',
|
|
1538
|
+
name: 'Magnify',
|
|
1539
|
+
description: 'effectDescription.magnify',
|
|
1540
|
+
parameters: [{
|
|
1541
|
+
name: 'screenXY',
|
|
1542
|
+
type: 'array',
|
|
1543
|
+
label: ['Position X', 'Position Y'],
|
|
1544
|
+
defaultValue: [0.5, 0.5],
|
|
1545
|
+
min: 0,
|
|
1546
|
+
max: 1
|
|
1547
|
+
}, {
|
|
1548
|
+
name: 'radiusPixels',
|
|
1549
|
+
label: 'Size',
|
|
1550
|
+
min: 10,
|
|
1551
|
+
max: 500
|
|
1552
|
+
}, {
|
|
1553
|
+
name: 'zoom',
|
|
1554
|
+
min: 0.5,
|
|
1555
|
+
max: 50
|
|
1556
|
+
}, {
|
|
1557
|
+
name: 'borderWidthPixels',
|
|
1558
|
+
label: 'Border Width',
|
|
1559
|
+
defaultValue: 3,
|
|
1560
|
+
min: 0,
|
|
1561
|
+
max: 50
|
|
1562
|
+
}]
|
|
1563
|
+
},
|
|
1564
|
+
hexagonalPixelate: {
|
|
1565
|
+
type: 'hexagonalPixelate',
|
|
1566
|
+
name: 'Hexagonal Pixelate',
|
|
1567
|
+
description: 'effectDescription.hexagonalPixelate',
|
|
1568
|
+
parameters: [{
|
|
1569
|
+
name: 'scale',
|
|
1570
|
+
defaultValue: 20,
|
|
1571
|
+
min: 1,
|
|
1572
|
+
max: 50
|
|
1573
|
+
}]
|
|
1574
|
+
},
|
|
1575
|
+
distanceFog: {
|
|
1576
|
+
type: DISTANCE_FOG_TYPE,
|
|
1577
|
+
name: 'Distance Fog',
|
|
1578
|
+
description: 'effectDescription.distanceFog',
|
|
1579
|
+
parameters: [{
|
|
1580
|
+
name: 'density',
|
|
1581
|
+
defaultValue: 0.5,
|
|
1582
|
+
min: 0,
|
|
1583
|
+
max: 1
|
|
1584
|
+
}, {
|
|
1585
|
+
name: 'fogStart',
|
|
1586
|
+
label: 'Start',
|
|
1587
|
+
defaultValue: 0.3,
|
|
1588
|
+
min: 0,
|
|
1589
|
+
max: 1
|
|
1590
|
+
}, {
|
|
1591
|
+
name: 'fogRange',
|
|
1592
|
+
label: 'Range',
|
|
1593
|
+
defaultValue: 0.5,
|
|
1594
|
+
min: 0.01,
|
|
1595
|
+
max: 1
|
|
1596
|
+
}, {
|
|
1597
|
+
name: 'fogColor',
|
|
1598
|
+
type: 'color',
|
|
1599
|
+
min: 0,
|
|
1600
|
+
max: 255,
|
|
1601
|
+
defaultValue: [217, 222, 230]
|
|
1602
|
+
}]
|
|
1603
|
+
},
|
|
1604
|
+
surfaceFog: {
|
|
1605
|
+
type: SURFACE_FOG_TYPE,
|
|
1606
|
+
name: 'Surface Fog',
|
|
1607
|
+
description: 'effectDescription.surfaceFog',
|
|
1608
|
+
parameters: [{
|
|
1609
|
+
name: 'density',
|
|
1610
|
+
defaultValue: 0.6,
|
|
1611
|
+
min: 0,
|
|
1612
|
+
max: 1
|
|
1613
|
+
}, {
|
|
1614
|
+
name: 'height',
|
|
1615
|
+
label: 'Elevation (m)',
|
|
1616
|
+
defaultValue: 50,
|
|
1617
|
+
min: -200,
|
|
1618
|
+
max: 6000
|
|
1619
|
+
}, {
|
|
1620
|
+
name: 'animateHeight',
|
|
1621
|
+
type: 'checkbox',
|
|
1622
|
+
label: 'Animate Elevation',
|
|
1623
|
+
tooltip: 'Animates elevation from start to end value during video export preview and recording.',
|
|
1624
|
+
defaultValue: false,
|
|
1625
|
+
min: 0,
|
|
1626
|
+
max: 1
|
|
1627
|
+
}, {
|
|
1628
|
+
name: 'heightEnd',
|
|
1629
|
+
label: 'End Elevation (m)',
|
|
1630
|
+
defaultValue: 100,
|
|
1631
|
+
min: -200,
|
|
1632
|
+
max: 6000
|
|
1633
|
+
}, {
|
|
1634
|
+
name: 'linearEasing',
|
|
1635
|
+
type: 'checkbox',
|
|
1636
|
+
label: 'Linear Easing',
|
|
1637
|
+
tooltip: 'Uses constant speed instead of smooth ease-in / ease-out during elevation animation.',
|
|
1638
|
+
defaultValue: false,
|
|
1639
|
+
min: 0,
|
|
1640
|
+
max: 1
|
|
1641
|
+
}, {
|
|
1642
|
+
name: 'thickness',
|
|
1643
|
+
label: 'Transition (m)',
|
|
1644
|
+
defaultValue: 50,
|
|
1645
|
+
min: 0,
|
|
1646
|
+
max: 1000
|
|
1647
|
+
}, {
|
|
1648
|
+
name: 'fogColor',
|
|
1649
|
+
type: 'color',
|
|
1650
|
+
label: 'Fog Color',
|
|
1651
|
+
min: 0,
|
|
1652
|
+
max: 255,
|
|
1653
|
+
defaultValue: [230, 235, 242]
|
|
1654
|
+
}, {
|
|
1655
|
+
name: 'pattern',
|
|
1656
|
+
type: 'checkbox',
|
|
1657
|
+
label: 'Pattern',
|
|
1658
|
+
tooltip: 'Adds a noise pattern to the fog for a more natural, volumetric look.',
|
|
1659
|
+
defaultValue: false,
|
|
1660
|
+
min: 0,
|
|
1661
|
+
max: 1
|
|
1662
|
+
}]
|
|
1663
|
+
}
|
|
1664
|
+
};
|
|
1665
|
+
export var EFFECT_DESCRIPTIONS = [LIGHT_AND_SHADOW_EFFECT].concat(_toConsumableArray(Object.keys(POSTPROCESSING_EFFECTS).map(function (keyName) {
|
|
1666
|
+
return POSTPROCESSING_EFFECTS[keyName];
|
|
1667
|
+
})));
|
|
1668
|
+
export var SYNC_TIMELINE_MODES = {
|
|
1669
|
+
start: 0,
|
|
1670
|
+
end: 1
|
|
1671
|
+
};
|
|
1672
|
+
export var GEOARROW_METADATA_KEY = 'ARROW:extension:name';
|
|
1673
|
+
|
|
1674
|
+
/**
|
|
1675
|
+
* Enum holding GeoArrow extension type names
|
|
1676
|
+
*/
|
|
1677
|
+
export var GEOARROW_EXTENSIONS = /*#__PURE__*/function (GEOARROW_EXTENSIONS) {
|
|
1678
|
+
GEOARROW_EXTENSIONS["POINT"] = "geoarrow.point";
|
|
1679
|
+
GEOARROW_EXTENSIONS["LINESTRING"] = "geoarrow.linestring";
|
|
1680
|
+
GEOARROW_EXTENSIONS["POLYGON"] = "geoarrow.polygon";
|
|
1681
|
+
GEOARROW_EXTENSIONS["MULTIPOINT"] = "geoarrow.multipoint";
|
|
1682
|
+
GEOARROW_EXTENSIONS["MULTILINESTRING"] = "geoarrow.multilinestring";
|
|
1683
|
+
GEOARROW_EXTENSIONS["MULTIPOLYGON"] = "geoarrow.multipolygon";
|
|
1684
|
+
GEOARROW_EXTENSIONS["WKB"] = "geoarrow.wkb";
|
|
1685
|
+
return GEOARROW_EXTENSIONS;
|
|
1686
|
+
}({});
|
|
1687
|
+
export var LOADERS_CDN_VERSION = '4.3.2';
|
|
1688
|
+
export var LOADERS_CDN_URL = 'https://unpkg.com/@loaders.gl';
|
|
1689
|
+
export var getLoaderOptions = function getLoaderOptions() {
|
|
1690
|
+
return {
|
|
1691
|
+
mvt: {
|
|
1692
|
+
workerUrl: "".concat(LOADERS_CDN_URL, "/mvt@").concat(LOADERS_CDN_VERSION, "/dist/mvt-worker.js")
|
|
1693
|
+
},
|
|
1694
|
+
'quantized-mesh': {
|
|
1695
|
+
workerUrl: "".concat(LOADERS_CDN_URL, "/terrain@").concat(LOADERS_CDN_VERSION, "/dist/quantized-mesh-worker.js")
|
|
1696
|
+
},
|
|
1697
|
+
npy: {
|
|
1698
|
+
workerUrl: "".concat(LOADERS_CDN_URL, "/textures@").concat(LOADERS_CDN_VERSION, "/dist/npy-worker.js")
|
|
1699
|
+
}
|
|
1700
|
+
};
|
|
1701
|
+
};
|
|
1702
|
+
export var CUSTOM_SCENEGRAPH_MODEL_ID = 'custom';
|
|
1703
|
+
export var DEFAULT_SCENEGRAPH_MODEL_ID = 'default-model';
|
|
1704
|
+
export var LEGACY_DEFAULT_SCENEGRAPH_URL = 'https://raw.githubusercontent.com/KhronosGroup/glTF-Sample-Models/master/2.0/Duck/glTF-Binary/Duck.glb';
|
|
1705
|
+
var MODELS_BASE_URL = 'https://studio-public-data.foursquare.com/statics/keplergl/3d-models.2022-06-13';
|
|
1706
|
+
/** Gallery shared by the trip layer and the point 3D layer. */
|
|
1707
|
+
var SCENEGRAPH_GALLERY_MODELS = [{
|
|
1708
|
+
id: 'airplane',
|
|
1709
|
+
label: 'Airplane',
|
|
1710
|
+
icon: null,
|
|
1711
|
+
url: "".concat(MODELS_BASE_URL, "/Plane.glb"),
|
|
1712
|
+
angles: [0, 0, 0],
|
|
1713
|
+
scale: 1.0
|
|
1714
|
+
}, {
|
|
1715
|
+
id: 'boeing777',
|
|
1716
|
+
label: 'Airliner',
|
|
1717
|
+
icon: null,
|
|
1718
|
+
url: "".concat(MODELS_BASE_URL, "/Airliner.glb"),
|
|
1719
|
+
angles: [0, 0, 0],
|
|
1720
|
+
scale: 1.0
|
|
1721
|
+
}, {
|
|
1722
|
+
id: 'uber-evtol',
|
|
1723
|
+
label: 'VTOL',
|
|
1724
|
+
icon: null,
|
|
1725
|
+
url: "".concat(MODELS_BASE_URL, "/evtol.glb"),
|
|
1726
|
+
angles: [0, 0, 0],
|
|
1727
|
+
scale: 1.0
|
|
1728
|
+
}, {
|
|
1729
|
+
id: 'hang-glider',
|
|
1730
|
+
label: 'Glider',
|
|
1731
|
+
icon: null,
|
|
1732
|
+
url: "".concat(MODELS_BASE_URL, "/Hangglider.glb"),
|
|
1733
|
+
angles: [0, 0, 0],
|
|
1734
|
+
scale: 1.0
|
|
1735
|
+
}, {
|
|
1736
|
+
id: 'helicopter',
|
|
1737
|
+
label: 'Helicopter',
|
|
1738
|
+
icon: null,
|
|
1739
|
+
url: "".concat(MODELS_BASE_URL, "/Helicopter.glb"),
|
|
1740
|
+
angles: [0, 0, 0],
|
|
1741
|
+
scale: 1.0
|
|
1742
|
+
}, {
|
|
1743
|
+
id: 'bicycle',
|
|
1744
|
+
label: 'Bicycle',
|
|
1745
|
+
icon: null,
|
|
1746
|
+
url: "".concat(MODELS_BASE_URL, "/Bicycle.glb"),
|
|
1747
|
+
angles: [0, 0, 0],
|
|
1748
|
+
scale: 1.0
|
|
1749
|
+
}, {
|
|
1750
|
+
id: 'scooter',
|
|
1751
|
+
label: 'Scooter',
|
|
1752
|
+
icon: null,
|
|
1753
|
+
url: "".concat(MODELS_BASE_URL, "/Scooter.glb"),
|
|
1754
|
+
angles: [0, 0, 0],
|
|
1755
|
+
scale: 1.0
|
|
1756
|
+
}, {
|
|
1757
|
+
id: 'car',
|
|
1758
|
+
label: 'Car',
|
|
1759
|
+
icon: null,
|
|
1760
|
+
url: "".concat(MODELS_BASE_URL, "/Car.glb"),
|
|
1761
|
+
angles: [0, 0, 0],
|
|
1762
|
+
scale: 1.0
|
|
1763
|
+
}, {
|
|
1764
|
+
id: 'truck',
|
|
1765
|
+
label: 'Truck',
|
|
1766
|
+
icon: null,
|
|
1767
|
+
url: "".concat(MODELS_BASE_URL, "/Truck.glb"),
|
|
1768
|
+
angles: [0, 0, 0],
|
|
1769
|
+
scale: 1.0
|
|
1770
|
+
}, {
|
|
1771
|
+
id: 'semitruck',
|
|
1772
|
+
label: 'Semitruck',
|
|
1773
|
+
icon: null,
|
|
1774
|
+
url: "".concat(MODELS_BASE_URL, "/Semitruck.glb"),
|
|
1775
|
+
angles: [0, 0, 0],
|
|
1776
|
+
scale: 1.0
|
|
1777
|
+
}, {
|
|
1778
|
+
id: 'cargoship',
|
|
1779
|
+
label: 'Cargoship',
|
|
1780
|
+
icon: null,
|
|
1781
|
+
url: "".concat(MODELS_BASE_URL, "/Cargoship.glb"),
|
|
1782
|
+
angles: [0, 0, 0],
|
|
1783
|
+
scale: 1.0
|
|
1784
|
+
}];
|
|
1785
|
+
var CUSTOM_SCENEGRAPH_MODEL = {
|
|
1786
|
+
id: CUSTOM_SCENEGRAPH_MODEL_ID,
|
|
1787
|
+
label: 'Custom',
|
|
1788
|
+
icon: null,
|
|
1789
|
+
url: null,
|
|
1790
|
+
angles: [0, 0, 0],
|
|
1791
|
+
scale: 1.0
|
|
1792
|
+
};
|
|
1793
|
+
|
|
1794
|
+
/** Duck used by the point 3D layer. Yaw lives on the model so angle Z can default to 0. */
|
|
1795
|
+
export var DEFAULT_SCENEGRAPH_MODEL = {
|
|
1796
|
+
id: DEFAULT_SCENEGRAPH_MODEL_ID,
|
|
1797
|
+
label: 'Ducky',
|
|
1798
|
+
icon: null,
|
|
1799
|
+
url: "".concat(MODELS_BASE_URL, "/Duck-Kepler-3D-Layer.glb"),
|
|
1800
|
+
angles: [0, 0, 90],
|
|
1801
|
+
scale: 150
|
|
1802
|
+
};
|
|
1803
|
+
export var TRIP_LAYER_SCENEGRAPH_MODELS = [].concat(SCENEGRAPH_GALLERY_MODELS, [CUSTOM_SCENEGRAPH_MODEL]);
|
|
1804
|
+
|
|
1805
|
+
/** Same gallery as trips, plus Ducky and a custom URL. */
|
|
1806
|
+
export var SCENEGRAPH_LAYER_MODELS = [].concat(SCENEGRAPH_GALLERY_MODELS, [DEFAULT_SCENEGRAPH_MODEL, CUSTOM_SCENEGRAPH_MODEL]);
|
|
1807
|
+
//# sourceMappingURL=default-settings.js.map
|