UNPKG

kepler.gl

Version:

kepler.gl is a webgl based application to visualize large scale location data in the browser

1,332 lines (1,305 loc) 158 kB
"use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); Object.defineProperty(exports, "__esModule", { value: true }); exports.MAX_GPU_FILTERS = exports.MAX_DEFAULT_TOOLTIPS = exports.MAP_THUMBNAIL_DIMENSION = exports.MAP_LIB_OPTIONS = exports.MAP_INFO_CHARACTER = exports.MAP_CONTROLS = exports.LOADING_METHODS = exports.LIGHT_AND_SHADOW_EFFECT_TIME_MODES = exports.LIGHT_AND_SHADOW_EFFECT = exports.LAYER_BLENDINGS = exports.KEPLER_UNFOLDED_BUCKET = exports.KEPLER_GL_WEBSITE = exports.KEPLER_GL_VERSION = exports.KEPLER_GL_NAME = exports.INIT_FILTER_ITEMS_IN_DROPDOWN = exports.ICON_FIELDS = exports.HIGHLIGH_COLOR_3D = exports.GEOJSON_FIELDS = exports.GEOCODER_LAYER_ID = exports.GEOCODER_ICON_SIZE = exports.GEOCODER_ICON_COLOR = exports.GEOCODER_GEO_OFFSET = exports.GEOCODER_DATASET_NAME = exports.GEOARROW_METADATA_KEY = exports.GEOARROW_EXTENSIONS = exports.FourByThreeRatioOption = exports.FPS = exports.FILTER_VIEW_TYPES = exports.FILTER_TYPES = exports.FIELD_TYPE_DISPLAY = exports.FIELD_OPTS = exports.FIELD_COLORS = exports.EXPORT_MAP_ID = exports.EXPORT_MAP_FORMAT_OPTIONS = exports.EXPORT_MAP_FORMATS = exports.EXPORT_IMG_RESOLUTION_OPTIONS = exports.EXPORT_IMG_RATIO_OPTIONS = exports.EXPORT_IMG_RATIOS = exports.EXPORT_IMAGE_ID = exports.EXPORT_HTML_MAP_MODE_OPTIONS = exports.EXPORT_HTML_MAP_MODES = exports.EXPORT_DATA_TYPE_OPTIONS = exports.EXPORT_DATA_TYPE = exports.EXPORT_DATA_ID = exports.EMPTY_MAPBOX_STYLE = exports.EFFECT_DESCRIPTIONS = exports.EDITOR_MODES = exports.EDITOR_LAYER_PICKING_RADIUS = exports.EDITOR_LAYER_ID = exports.DIMENSIONS = exports.DELETE_DATA_ID = exports.DEFAULT_UUID_COUNT = exports.DEFAULT_TOOLTIP_FIELDS = exports.DEFAULT_TIME_FORMAT = exports.DEFAULT_TIMEZONE = exports.DEFAULT_SHADOW_INTENSITY = exports.DEFAULT_SHADOW_COLOR = exports.DEFAULT_POST_PROCESSING_EFFECT_TYPE = exports.DEFAULT_PICKING_RADIUS = exports.DEFAULT_NO_BASEMAP_STYLE = exports.DEFAULT_NOTIFICATION_TYPES = exports.DEFAULT_NOTIFICATION_TOPICS = exports.DEFAULT_NOTIFICATION_MESSAGE = exports.DEFAULT_MAP_STYLES = exports.DEFAULT_MAPLIBRE_STYLES = exports.DEFAULT_MAPBOX_STYLES = exports.DEFAULT_MAPBOX_SATELITE_STYLES = exports.DEFAULT_MAPBOX_API_URL = exports.DEFAULT_LIGHT_INTENSITY = exports.DEFAULT_LIGHT_COLOR = exports.DEFAULT_LIGHT_AND_SHADOW_PROPS = exports.DEFAULT_LAYER_GROUPS = exports.DEFAULT_LAYER_COLOR_PALETTE_STEPS = exports.DEFAULT_LAYER_COLOR_PALETTE = exports.DEFAULT_LAYER_COLOR = exports.DEFAULT_FILTER_VIEW_TYPE = exports.DEFAULT_FEATURE_FLAGS = exports.DEFAULT_BLDG_COLOR = exports.DEFAULT_BASE_MAP_STYLE = exports.DEFAULT_BACKGROUND_COLOR = exports.DEFAULT_AGGREGATION = exports.DATA_TABLE_ID = exports.DATASET_FORMATS = exports.CustomRatioOption = exports.CHANNEL_SCALE_SUPPORTED_FIELDS = exports.CHANNEL_SCALES = exports.BASE_SPEED = exports.BASE_MAP_COLOR_MODES = exports.BASE_MAP_BACKGROUND_LAYER_IDS = exports.BASEMAP_ICON_PREFIX = exports.BACKGROUND_LAYER_GROUP_SLUG = exports.BACKGROUND_LAYER_GROUP = exports.ANIMATION_WINDOW = exports.ALTITUDE_FIELDS = exports.ALL_FIELD_TYPES = exports.AGGREGATION_TYPE_OPTIONS = exports.AGGREGATION_TYPES = exports.ADD_MAP_STYLE_ID = exports.ADD_DATA_ID = exports.ACTION_PREFIX = void 0; exports.dataTestIds = exports.TwoXResolutionOption = exports.TRIP_POINT_FIELDS = exports.TRIP_ARC_FIELDS = exports.TRANSITION_DURATION = exports.THROTTLE_NOTIFICATION_TIME = exports.THREE_D_BUILDING_LAYER_GROUP_SLUG = exports.THEME = exports.TEXT_OUTLINE_MULTIPLIER = exports.TABLE_OPTION_LIST = exports.TABLE_OPTION = exports.SixteenByNineRatioOption = exports.ScreenRatioOption = exports.SYNC_TIMELINE_MODES = exports.SPEED_CONTROL_STEP = exports.SPEED_CONTROL_RANGE = exports.SORT_ORDER = exports.SIDEBAR_PANELS = exports.SHARE_MAP_ID = exports.SCALE_TYPE_NAMES = exports.SCALE_TYPES = exports.SCALE_FUNC = exports.SAVE_MAP_ID = exports.RESOLUTIONS = exports.PROJECTED_PIXEL_SIZE_MULTIPLIER = exports.POSTPROCESSING_EFFECTS = exports.PLOT_TYPES = exports.PANEL_VIEW_TOGGLES = exports.PANELS = exports.OneXResolutionOption = exports.OVERWRITE_MAP_ID = exports.OVERLAY_BLENDINGS = exports.NO_VALUE_COLOR = exports.NO_MAP_ID = exports.NO_BASEMAP_ICON = void 0; exports.getHTMLMapModeTileUrl = getHTMLMapModeTileUrl; exports.ordinalFieldScaleFunctions = exports.ordinalFieldAggrScaleFunctions = exports.notSupportedScaleOpts = exports.notSupportAggrOpts = exports.linearFieldScaleFunctions = exports.linearFieldAggrScaleFunctions = void 0; var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray")); var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray")); var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty")); var _keymirror = _interopRequireDefault(require("keymirror")); var _d3Scale = require("d3-scale"); var _tooltip = require("./tooltip"); var _FIELD_TYPE_DISPLAY, _FIELD_OPTS; // SPDX-License-Identifier: MIT // Copyright contributors to the kepler.gl project 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; } 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) { (0, _defineProperty2["default"])(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; } var ACTION_PREFIX = exports.ACTION_PREFIX = '@@kepler.gl/'; var KEPLER_UNFOLDED_BUCKET = exports.KEPLER_UNFOLDED_BUCKET = 'https://studio-public-data.foursquare.com/statics/keplergl'; var BASEMAP_ICON_PREFIX = exports.BASEMAP_ICON_PREFIX = "".concat(KEPLER_UNFOLDED_BUCKET, "/geodude"); var DEFAULT_MAPBOX_API_URL = exports.DEFAULT_MAPBOX_API_URL = 'https://api.mapbox.com'; var TRANSITION_DURATION = exports.TRANSITION_DURATION = 0; // Modal Ids /** * Modal id: data table * @constant * @type {string} * @public */ var DATA_TABLE_ID = exports.DATA_TABLE_ID = 'dataTable'; /** * Modal id: delete dataset confirm dialog * @constant * @type {string} * @public */ var DELETE_DATA_ID = exports.DELETE_DATA_ID = 'deleteData'; /** * Modal id: add data modal * @constant * @type {string} * @public */ var ADD_DATA_ID = exports.ADD_DATA_ID = 'addData'; /** * Modal id: export image modal * @constant * @type {string} * @public */ var EXPORT_IMAGE_ID = exports.EXPORT_IMAGE_ID = 'exportImage'; /** * Modal id: export data modal * @constant * @type {string} * @public */ var EXPORT_DATA_ID = exports.EXPORT_DATA_ID = 'exportData'; /** * Modal id: add custom map style modal * @constant * @type {string} * @public */ var ADD_MAP_STYLE_ID = exports.ADD_MAP_STYLE_ID = 'addMapStyle'; /** * Modal id: export map modal * @constant * @type {string} * @public */ var EXPORT_MAP_ID = exports.EXPORT_MAP_ID = 'exportMap'; /** * Modal id: save map modal * @constant * @type {string} * @public */ var SAVE_MAP_ID = exports.SAVE_MAP_ID = 'saveMap'; /** * Modal id: confirm to overwrite saved map * @constant * @type {string} * @public */ var OVERWRITE_MAP_ID = exports.OVERWRITE_MAP_ID = 'overwriteMap'; /** * Modal id: share map url modal * @constant * @type {string} * @public */ var SHARE_MAP_ID = exports.SHARE_MAP_ID = 'shareMap'; var KEPLER_GL_NAME = exports.KEPLER_GL_NAME = 'kepler.gl'; // __PACKAGE_VERSION__ is automatically injected by Babel/Esbuild during the build process // Since we are injecting this during the build process with babel // while developing VERSION is not defined, we capture the exception and return // an empty string which will allow us to retrieve the latest umd version var KEPLER_GL_VERSION = exports.KEPLER_GL_VERSION = "3.1.1"; var KEPLER_GL_WEBSITE = exports.KEPLER_GL_WEBSITE = 'http://kepler.gl/'; var DIMENSIONS = exports.DIMENSIONS = { sidePanel: { width: 300, margin: { top: 12, left: 12, bottom: 12, right: 20 }, headerHeight: 96 }, mapControl: { width: 184, padding: 12, mapLegend: { pinned: { bottom: 22, right: 12 } } } }; /** * Theme name that can be passed to `KeplerGl` `prop.theme`. * Available themes are `THEME.light` and `THEME.dark`. Default theme is `THEME.dark` * @constant * @type {object} * @public * @example * ```js * const Map = () => <KeplerGl theme={THEME.light} id="map"/> * ``` */ var THEME = exports.THEME = (0, _keymirror["default"])({ light: null, dark: null, base: null }); var SIDEBAR_PANELS = exports.SIDEBAR_PANELS = [{ id: 'layer', label: 'sidebar.panels.layer', onClick: null }, { id: 'filter', label: 'sidebar.panels.filter', onClick: null }, { id: 'interaction', label: 'sidebar.panels.interaction', onClick: null }, { id: 'map', label: 'sidebar.panels.basemap', onClick: null }]; var PANEL_VIEW_TOGGLES = exports.PANEL_VIEW_TOGGLES = (0, _keymirror["default"])({ list: null, byDataset: null }); // backward compatibility var PANELS = exports.PANELS = SIDEBAR_PANELS; // MAP STYLES var DEFAULT_BLDG_COLOR = exports.DEFAULT_BLDG_COLOR = '#D1CEC7'; var DEFAULT_BACKGROUND_COLOR = exports.DEFAULT_BACKGROUND_COLOR = '#000000'; // assists in identifying basemap background layers when auto-determining the backgroundColor var BASE_MAP_BACKGROUND_LAYER_IDS = exports.BASE_MAP_BACKGROUND_LAYER_IDS = ['background', 'bg', 'land', 'water']; var BACKGROUND_LAYER_GROUP_SLUG = exports.BACKGROUND_LAYER_GROUP_SLUG = 'Background'; var THREE_D_BUILDING_LAYER_GROUP_SLUG = exports.THREE_D_BUILDING_LAYER_GROUP_SLUG = '3d building'; var BACKGROUND_LAYER_GROUP = exports.BACKGROUND_LAYER_GROUP = { slug: BACKGROUND_LAYER_GROUP_SLUG, filter: function filter() { return false; }, defaultVisibility: false, isVisibilityToggleAvailable: false, isMoveToTopAvailable: false, isColorPickerAvailable: true }; var DEFAULT_LAYER_GROUPS = exports.DEFAULT_LAYER_GROUPS = [{ slug: 'label', filter: function filter(_ref) { var id = _ref.id, type = _ref.type; return id.match(/(?=(label|place-|poi-))/) || (type === null || type === void 0 ? void 0 : type.match(/(?=(symbol))/)); }, defaultVisibility: true, isVisibilityToggleAvailable: true, isMoveToTopAvailable: true, isColorPickerAvailable: false }, { slug: 'road', filter: function filter(_ref2) { var id = _ref2.id; return id.match(/(?=(road|railway|tunnel|street|bridge))(?!.*label)/); }, defaultVisibility: true, isVisibilityToggleAvailable: true, isMoveToTopAvailable: true, isColorPickerAvailable: false }, { slug: 'border', filter: function filter(_ref3) { var id = _ref3.id; return id.match(/border|boundaries|boundary/); }, defaultVisibility: false, isVisibilityToggleAvailable: true, isMoveToTopAvailable: true, isColorPickerAvailable: false }, { slug: 'building', filter: function filter(_ref4) { var id = _ref4.id; return id.match(/building/); }, defaultVisibility: true, isVisibilityToggleAvailable: true, isMoveToTopAvailable: true, isColorPickerAvailable: false }, { slug: 'water', filter: function filter(_ref5) { var id = _ref5.id; return id.match(/(?=(water|stream|ferry))/); }, defaultVisibility: true, isVisibilityToggleAvailable: true, isMoveToTopAvailable: true, isColorPickerAvailable: false }, { slug: 'land', filter: function filter(_ref6) { var id = _ref6.id; return id.match(/(?=(parks|landcover|industrial|sand|hillshade))/); }, defaultVisibility: true, isVisibilityToggleAvailable: true, isMoveToTopAvailable: true, isColorPickerAvailable: false }, { slug: THREE_D_BUILDING_LAYER_GROUP_SLUG, filter: function filter() { return false; }, defaultVisibility: false, isVisibilityToggleAvailable: true, isMoveToTopAvailable: true, isColorPickerAvailable: true }]; var BASE_MAP_COLOR_MODES = exports.BASE_MAP_COLOR_MODES = (0, _keymirror["default"])({ NONE: null, DARK: null, LIGHT: null }); var NO_MAP_ID = exports.NO_MAP_ID = 'no_map'; // Fallback style to use when styles are being fetched, or when // a style fails to fetch var EMPTY_MAPBOX_STYLE = exports.EMPTY_MAPBOX_STYLE = { version: 8, sources: {}, layers: [] }; var MAP_LIB_OPTIONS = exports.MAP_LIB_OPTIONS = { MAPBOX: 'mapbox', MAPLIBRE: 'maplibre' }; var NO_BASEMAP_ICON = exports.NO_BASEMAP_ICON = "".concat(BASEMAP_ICON_PREFIX, "/NO_BASEMAP.png"); var DEFAULT_BASE_MAP_STYLE = exports.DEFAULT_BASE_MAP_STYLE = 'dark-matter'; var DEFAULT_NO_BASEMAP_STYLE = exports.DEFAULT_NO_BASEMAP_STYLE = { id: NO_MAP_ID, label: 'No Basemap', url: '', icon: NO_BASEMAP_ICON, layerGroups: [BACKGROUND_LAYER_GROUP], colorMode: BASE_MAP_COLOR_MODES.NONE, style: EMPTY_MAPBOX_STYLE }; var DEFAULT_MAPBOX_STYLES = exports.DEFAULT_MAPBOX_STYLES = [{ id: 'dark', label: 'Dark', url: 'mapbox://styles/uberdata/cjoqbbf6l9k302sl96tyvka09', icon: "".concat(BASEMAP_ICON_PREFIX, "/UBER_DARK_V2.png"), layerGroups: DEFAULT_LAYER_GROUPS, colorMode: BASE_MAP_COLOR_MODES.DARK, complimentaryStyleId: 'light' }, { id: 'light', label: 'Light', url: 'mapbox://styles/uberdata/cjoqb9j339k1f2sl9t5ic5bn4', icon: "".concat(BASEMAP_ICON_PREFIX, "/UBER_LIGHT_V2.png"), layerGroups: DEFAULT_LAYER_GROUPS, colorMode: BASE_MAP_COLOR_MODES.LIGHT, complimentaryStyleId: 'dark' }, { id: 'muted', label: 'Muted Light', url: 'mapbox://styles/uberdata/cjfyl03kp1tul2smf5v2tbdd4', icon: "".concat(BASEMAP_ICON_PREFIX, "/UBER_MUTED_LIGHT.png"), layerGroups: DEFAULT_LAYER_GROUPS, colorMode: BASE_MAP_COLOR_MODES.LIGHT, complimentaryStyleId: 'muted_night' }, { id: 'muted_night', label: 'Muted Night', url: 'mapbox://styles/uberdata/cjfxhlikmaj1b2soyzevnywgs', icon: "".concat(BASEMAP_ICON_PREFIX, "/UBER_MUTED_NIGHT.png"), layerGroups: DEFAULT_LAYER_GROUPS, colorMode: BASE_MAP_COLOR_MODES.DARK, complimentaryStyleId: 'muted' }]; var DEFAULT_MAPBOX_SATELITE_STYLES = exports.DEFAULT_MAPBOX_SATELITE_STYLES = [{ id: 'satellite', label: 'Satellite with streets', url: "mapbox://styles/mapbox/satellite-streets-v11", icon: "".concat(BASEMAP_ICON_PREFIX, "/UBER_SATELLITE.png"), layerGroups: DEFAULT_LAYER_GROUPS, colorMode: BASE_MAP_COLOR_MODES.NONE }]; var DEFAULT_MAPLIBRE_STYLES = exports.DEFAULT_MAPLIBRE_STYLES = [{ id: 'dark-matter', label: 'DarkMatter', url: 'https://basemaps.cartocdn.com/gl/dark-matter-gl-style/style.json', icon: "".concat(BASEMAP_ICON_PREFIX, "/DARKMATTER.png"), layerGroups: DEFAULT_LAYER_GROUPS, colorMode: BASE_MAP_COLOR_MODES.DARK, complimentaryStyleId: 'positron' }, { id: 'positron', label: 'Positron', url: 'https://basemaps.cartocdn.com/gl/positron-gl-style/style.json', icon: "".concat(BASEMAP_ICON_PREFIX, "/POSITRON.png"), layerGroups: DEFAULT_LAYER_GROUPS, colorMode: BASE_MAP_COLOR_MODES.LIGHT, complimentaryStyleId: 'dark-matter' }, { id: 'voyager', label: 'Voyager', url: 'https://basemaps.cartocdn.com/gl/voyager-gl-style/style.json', icon: "".concat(BASEMAP_ICON_PREFIX, "/VOYAGER.png"), layerGroups: DEFAULT_LAYER_GROUPS, colorMode: BASE_MAP_COLOR_MODES.LIGHT, complimentaryStyleId: 'dark-matter' }]; var DEFAULT_MAP_STYLES = exports.DEFAULT_MAP_STYLES = [DEFAULT_NO_BASEMAP_STYLE].concat(DEFAULT_MAPLIBRE_STYLES, DEFAULT_MAPBOX_SATELITE_STYLES, DEFAULT_MAPBOX_STYLES); var GEOJSON_FIELDS = exports.GEOJSON_FIELDS = { geojson: ['_geojson', 'all_points', 'geojson'] }; var ICON_FIELDS = exports.ICON_FIELDS = { icon: ['icon'] }; var TRIP_POINT_FIELDS = exports.TRIP_POINT_FIELDS = [['lat', 'lng'], ['lat', 'lon'], ['lat', 'long'], ['latitude', 'longitude']]; var ALTITUDE_FIELDS = exports.ALTITUDE_FIELDS = ['alt', 'altitude']; var TRIP_ARC_FIELDS = exports.TRIP_ARC_FIELDS = { lat0: 'begintrip', lng0: 'begintrip', lat1: 'dropoff', lng1: 'dropoff' }; var FILTER_TYPES = exports.FILTER_TYPES = (0, _keymirror["default"])({ range: null, select: null, input: null, timeRange: null, multiSelect: null, polygon: null }); var FILTER_VIEW_TYPES = exports.FILTER_VIEW_TYPES = (0, _keymirror["default"])({ side: null, enlarged: null, minified: null }); var DEFAULT_FILTER_VIEW_TYPE = exports.DEFAULT_FILTER_VIEW_TYPE = FILTER_VIEW_TYPES.side; var SCALE_TYPES = exports.SCALE_TYPES = (0, _keymirror["default"])({ ordinal: null, quantile: null, quantize: null, linear: null, sqrt: null, log: null, threshold: null, custom: null, customOrdinal: null, // ordinal domain to linear range point: null }); var SCALE_TYPE_NAMES = exports.SCALE_TYPE_NAMES = { ordinal: 'Ordinal', quantile: 'Quantile', quantize: 'Quantize', linear: 'Linear', sqrt: 'Sqrt', log: 'Log', threshold: 'Threshold', custom: 'Custom Breaks', customOrdinal: 'Custom Ordinal', point: 'Point' }; var SCALE_FUNC = exports.SCALE_FUNC = (0, _defineProperty2["default"])((0, _defineProperty2["default"])((0, _defineProperty2["default"])((0, _defineProperty2["default"])((0, _defineProperty2["default"])((0, _defineProperty2["default"])((0, _defineProperty2["default"])((0, _defineProperty2["default"])((0, _defineProperty2["default"])((0, _defineProperty2["default"])({}, SCALE_TYPES.linear, _d3Scale.scaleLinear), SCALE_TYPES.quantize, _d3Scale.scaleQuantize), SCALE_TYPES.quantile, _d3Scale.scaleQuantile), SCALE_TYPES.ordinal, _d3Scale.scaleOrdinal), SCALE_TYPES.sqrt, _d3Scale.scaleSqrt), SCALE_TYPES.log, _d3Scale.scaleLog), SCALE_TYPES.point, _d3Scale.scalePoint), SCALE_TYPES.threshold, _d3Scale.scaleThreshold), SCALE_TYPES.custom, _d3Scale.scaleThreshold), SCALE_TYPES.customOrdinal, _d3Scale.scaleOrdinal); var ALL_FIELD_TYPES = exports.ALL_FIELD_TYPES = (0, _keymirror["default"])({ "boolean": null, date: null, geojson: null, integer: null, real: null, string: null, timestamp: null, point: null, array: null, object: null, geoarrow: null, h3: null }); // Data Table var SORT_ORDER = exports.SORT_ORDER = (0, _keymirror["default"])({ ASCENDING: null, DESCENDING: null, UNSORT: null }); var TABLE_OPTION = exports.TABLE_OPTION = (0, _keymirror["default"])({ SORT_ASC: null, SORT_DES: null, UNSORT: null, PIN: null, UNPIN: null, COPY: null, FORMAT_COLUMN: null }); var TABLE_OPTION_LIST = exports.TABLE_OPTION_LIST = [{ value: TABLE_OPTION.SORT_ASC, display: 'Sort Ascending', icon: 'ArrowUp', condition: function condition(props) { return props.sortTableColumn && props.sortMode !== SORT_ORDER.ASCENDING; } }, { value: TABLE_OPTION.SORT_DES, display: 'Sort Descending', icon: 'ArrowDown', condition: function condition(props) { return props.sortTableColumn && props.sortMode !== SORT_ORDER.DESCENDING; } }, { value: TABLE_OPTION.UNSORT, display: 'Unsort Column', icon: 'Cancel', condition: function condition(props) { return props.isSorted; } }, { value: TABLE_OPTION.PIN, display: 'Pin Column', icon: 'Pin', condition: function condition(props) { return !props.isPinned; } }, { value: TABLE_OPTION.UNPIN, display: 'Unpin Column', icon: 'Cancel', condition: function condition(props) { return props.isPinned; } }, { value: TABLE_OPTION.COPY, display: 'Copy Column', icon: 'Clipboard' }, { value: TABLE_OPTION.FORMAT_COLUMN, display: 'Format Column', icon: 'Hash', condition: function condition(props) { return props.setDisplayFormat; } }]; var YELLOW = '248, 194, 28'; var PINK = '242, 152, 163'; var PURPLE = '160, 106, 206'; var BLUE = '140, 210, 205'; var BLUE2 = '106, 160, 206'; var BLUE3 = '0, 172, 237'; var GREEN = '106, 160, 56'; var GREEN2 = '74, 165, 150'; var RED = '237, 88, 106'; var ORANGE = '231, 110, 58'; var FIELD_TYPE_DISPLAY = exports.FIELD_TYPE_DISPLAY = (_FIELD_TYPE_DISPLAY = {}, (0, _defineProperty2["default"])((0, _defineProperty2["default"])((0, _defineProperty2["default"])((0, _defineProperty2["default"])((0, _defineProperty2["default"])((0, _defineProperty2["default"])((0, _defineProperty2["default"])((0, _defineProperty2["default"])((0, _defineProperty2["default"])((0, _defineProperty2["default"])(_FIELD_TYPE_DISPLAY, ALL_FIELD_TYPES["boolean"], { label: 'bool', color: PINK }), ALL_FIELD_TYPES.date, { label: 'date', color: PURPLE }), ALL_FIELD_TYPES.geojson, { label: 'geo', color: BLUE2 }), ALL_FIELD_TYPES.geoarrow, { label: 'geo', color: BLUE2 }), ALL_FIELD_TYPES.integer, { label: 'int', color: YELLOW }), ALL_FIELD_TYPES.real, { label: 'float', color: YELLOW }), ALL_FIELD_TYPES.string, { label: 'string', color: BLUE }), ALL_FIELD_TYPES.timestamp, { label: 'time', color: GREEN }), ALL_FIELD_TYPES.point, { label: 'point', color: BLUE3 }), ALL_FIELD_TYPES.array, { label: 'array', color: ORANGE }), (0, _defineProperty2["default"])((0, _defineProperty2["default"])(_FIELD_TYPE_DISPLAY, ALL_FIELD_TYPES.object, { label: 'object', color: GREEN2 }), ALL_FIELD_TYPES.h3, { label: 'h3', color: BLUE })); var FIELD_COLORS = exports.FIELD_COLORS = { "default": RED }; var HIGHLIGH_COLOR_3D = exports.HIGHLIGH_COLOR_3D = [255, 255, 255, 60]; var CHANNEL_SCALES = exports.CHANNEL_SCALES = (0, _keymirror["default"])({ color: null, radius: null, size: null, colorAggr: null, sizeAggr: null }); var AGGREGATION_TYPES = exports.AGGREGATION_TYPES = { // default count: 'count', // linear average: 'average', maximum: 'maximum', minimum: 'minimum', median: 'median', stdev: 'stdev', sum: 'sum', variance: 'variance', // ordinal mode: 'mode', countUnique: 'countUnique' }; var AGGREGATION_TYPE_OPTIONS = exports.AGGREGATION_TYPE_OPTIONS = Object.entries(AGGREGATION_TYPES).map(function (_ref7) { var _ref8 = (0, _slicedToArray2["default"])(_ref7, 2), key = _ref8[0], value = _ref8[1]; return { id: key, label: key === 'stdev' ? 'Std Deviation' : key === 'countUnique' ? 'Count Unique' : typeof value === 'string' ? value.charAt(0).toUpperCase() + value.slice(1) : value }; }); var linearFieldScaleFunctions = exports.linearFieldScaleFunctions = (0, _defineProperty2["default"])((0, _defineProperty2["default"])((0, _defineProperty2["default"])({}, CHANNEL_SCALES.color, [SCALE_TYPES.quantize, SCALE_TYPES.quantile, SCALE_TYPES.custom]), CHANNEL_SCALES.radius, [SCALE_TYPES.sqrt]), CHANNEL_SCALES.size, [SCALE_TYPES.linear, SCALE_TYPES.sqrt, SCALE_TYPES.log]); var DEFAULT_AGGREGATION_COLOR_SCALES = [SCALE_TYPES.quantize, SCALE_TYPES.quantile, SCALE_TYPES.custom]; var linearFieldAggrScaleFunctions = exports.linearFieldAggrScaleFunctions = (0, _defineProperty2["default"])((0, _defineProperty2["default"])({}, 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) { prev[cur] = DEFAULT_AGGREGATION_COLOR_SCALES; return prev; }, {})), CHANNEL_SCALES.sizeAggr, (0, _defineProperty2["default"])((0, _defineProperty2["default"])((0, _defineProperty2["default"])((0, _defineProperty2["default"])((0, _defineProperty2["default"])((0, _defineProperty2["default"])((0, _defineProperty2["default"])({}, 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])); var ordinalFieldScaleFunctions = exports.ordinalFieldScaleFunctions = (0, _defineProperty2["default"])((0, _defineProperty2["default"])((0, _defineProperty2["default"])({}, CHANNEL_SCALES.color, [SCALE_TYPES.ordinal, SCALE_TYPES.customOrdinal]), CHANNEL_SCALES.radius, [SCALE_TYPES.point]), CHANNEL_SCALES.size, [SCALE_TYPES.point]); var ordinalFieldAggrScaleFunctions = exports.ordinalFieldAggrScaleFunctions = (0, _defineProperty2["default"])((0, _defineProperty2["default"])({}, CHANNEL_SCALES.colorAggr, (0, _defineProperty2["default"])((0, _defineProperty2["default"])({}, AGGREGATION_TYPES.mode, [SCALE_TYPES.ordinal]), AGGREGATION_TYPES.countUnique, [SCALE_TYPES.quantize, SCALE_TYPES.quantile])), CHANNEL_SCALES.sizeAggr, {}); var notSupportedScaleOpts = exports.notSupportedScaleOpts = (0, _defineProperty2["default"])((0, _defineProperty2["default"])((0, _defineProperty2["default"])({}, CHANNEL_SCALES.color, []), CHANNEL_SCALES.radius, []), CHANNEL_SCALES.size, []); var notSupportAggrOpts = exports.notSupportAggrOpts = (0, _defineProperty2["default"])((0, _defineProperty2["default"])({}, CHANNEL_SCALES.colorAggr, {}), CHANNEL_SCALES.sizeAggr, {}); /** * Default aggregation are based on ocunt */ var DEFAULT_AGGREGATION = exports.DEFAULT_AGGREGATION = (0, _defineProperty2["default"])((0, _defineProperty2["default"])({}, CHANNEL_SCALES.colorAggr, (0, _defineProperty2["default"])({}, AGGREGATION_TYPES.count, DEFAULT_AGGREGATION_COLOR_SCALES)), CHANNEL_SCALES.sizeAggr, (0, _defineProperty2["default"])({}, AGGREGATION_TYPES.count, [SCALE_TYPES.linear, SCALE_TYPES.sqrt, SCALE_TYPES.log])); /** * Define what type of scale operation is allowed on each type of fields */ var FIELD_OPTS = exports.FIELD_OPTS = (_FIELD_OPTS = {}, (0, _defineProperty2["default"])((0, _defineProperty2["default"])((0, _defineProperty2["default"])((0, _defineProperty2["default"])((0, _defineProperty2["default"])((0, _defineProperty2["default"])((0, _defineProperty2["default"])((0, _defineProperty2["default"])((0, _defineProperty2["default"])((0, _defineProperty2["default"])(_FIELD_OPTS, ALL_FIELD_TYPES.string, { type: 'categorical', scale: _objectSpread(_objectSpread({}, ordinalFieldScaleFunctions), ordinalFieldAggrScaleFunctions), format: { legend: function legend(d) { return d; }, tooltip: [] } }), ALL_FIELD_TYPES.real, { type: 'numerical', scale: _objectSpread(_objectSpread({}, linearFieldScaleFunctions), linearFieldAggrScaleFunctions), format: { legend: function legend(d) { return d; }, tooltip: [_tooltip.TOOLTIP_FORMAT_TYPES.NONE, _tooltip.TOOLTIP_FORMAT_TYPES.DECIMAL, _tooltip.TOOLTIP_FORMAT_TYPES.PERCENTAGE] } }), ALL_FIELD_TYPES.timestamp, { type: 'time', scale: _objectSpread(_objectSpread({}, linearFieldScaleFunctions), notSupportAggrOpts), format: { legend: function legend(d) { return d; }, tooltip: [_tooltip.TOOLTIP_FORMAT_TYPES.NONE, _tooltip.TOOLTIP_FORMAT_TYPES.DATE, _tooltip.TOOLTIP_FORMAT_TYPES.DATE_TIME] } }), ALL_FIELD_TYPES.integer, { type: 'numerical', scale: _objectSpread(_objectSpread({}, _objectSpread(_objectSpread({}, linearFieldScaleFunctions), {}, (0, _defineProperty2["default"])({}, CHANNEL_SCALES.color, [].concat((0, _toConsumableArray2["default"])(linearFieldScaleFunctions[CHANNEL_SCALES.color]), [SCALE_TYPES.customOrdinal])))), linearFieldAggrScaleFunctions), format: { legend: function legend(d) { return d; }, tooltip: [_tooltip.TOOLTIP_FORMAT_TYPES.NONE, _tooltip.TOOLTIP_FORMAT_TYPES.DECIMAL, _tooltip.TOOLTIP_FORMAT_TYPES.PERCENTAGE] } }), ALL_FIELD_TYPES["boolean"], { type: 'boolean', scale: _objectSpread(_objectSpread({}, ordinalFieldScaleFunctions), ordinalFieldAggrScaleFunctions), format: { legend: function legend(d) { return d; }, tooltip: [_tooltip.TOOLTIP_FORMAT_TYPES.NONE, _tooltip.TOOLTIP_FORMAT_TYPES.BOOLEAN] } }), ALL_FIELD_TYPES.date, { type: 'time', scale: _objectSpread(_objectSpread({}, ordinalFieldScaleFunctions), ordinalFieldAggrScaleFunctions), format: { legend: function legend(d) { return d; }, tooltip: [_tooltip.TOOLTIP_FORMAT_TYPES.NONE, _tooltip.TOOLTIP_FORMAT_TYPES.DATE] } }), ALL_FIELD_TYPES.geojson, { type: 'geometry', scale: _objectSpread(_objectSpread({}, notSupportedScaleOpts), notSupportAggrOpts), format: { legend: function legend() { return '...'; }, tooltip: [] } }), ALL_FIELD_TYPES.geoarrow, { type: 'geometry', scale: _objectSpread(_objectSpread({}, notSupportedScaleOpts), notSupportAggrOpts), format: { legend: function legend() { return '...'; }, tooltip: [] } }), ALL_FIELD_TYPES.object, { type: 'numerical', scale: {}, format: { legend: function legend() { return '...'; }, tooltip: [] } }), ALL_FIELD_TYPES.array, { type: 'numerical', scale: {}, format: { legend: function legend() { return '...'; }, tooltip: [] } }), (0, _defineProperty2["default"])(_FIELD_OPTS, ALL_FIELD_TYPES.h3, { type: 'h3', scale: _objectSpread(_objectSpread({}, notSupportedScaleOpts), notSupportAggrOpts), format: { legend: function legend() { return '...'; }, tooltip: [] } })); var CHANNEL_SCALE_SUPPORTED_FIELDS = exports.CHANNEL_SCALE_SUPPORTED_FIELDS = Object.keys(CHANNEL_SCALES).reduce(function (accu, key) { return _objectSpread(_objectSpread({}, accu), {}, (0, _defineProperty2["default"])({}, key, Object.keys(FIELD_OPTS).filter(function (ft) { return FIELD_OPTS[ft].scale[key] && Object.keys(FIELD_OPTS[ft].scale[key]).length; }))); }, {}); var DEFAULT_LAYER_COLOR = exports.DEFAULT_LAYER_COLOR = { tripArc: '#9226C6', begintrip_lat: '#1E96BE', dropoff_lat: '#FF991F', request_lat: '#52A353' }; var DEFAULT_LAYER_COLOR_PALETTE = exports.DEFAULT_LAYER_COLOR_PALETTE = 'Global Warming'; var DEFAULT_LAYER_COLOR_PALETTE_STEPS = exports.DEFAULT_LAYER_COLOR_PALETTE_STEPS = 6; // let user pass in default tooltip fields var DEFAULT_TOOLTIP_FIELDS = exports.DEFAULT_TOOLTIP_FIELDS = []; var NO_VALUE_COLOR = exports.NO_VALUE_COLOR = [0, 0, 0, 0]; var DEFAULT_PICKING_RADIUS = exports.DEFAULT_PICKING_RADIUS = 3; var OVERLAY_BLENDINGS = exports.OVERLAY_BLENDINGS = { normal: { label: 'overlayBlending.normal', value: 'normal' }, screen: { label: 'overlayBlending.screen', value: 'screen' }, darken: { label: 'overlayBlending.darken', value: 'darken' } }; var LAYER_BLENDINGS = exports.LAYER_BLENDINGS = { additive: { label: 'layerBlending.additive', blendFunc: ['SRC_ALPHA', 'DST_ALPHA'], blendEquation: 'FUNC_ADD' }, normal: { // reference to // https://limnu.com/webgl-blending-youre-probably-wrong/ label: 'layerBlending.normal', blendFunc: ['SRC_ALPHA', 'ONE_MINUS_SRC_ALPHA', 'ONE', 'ONE_MINUS_SRC_ALPHA'], blendEquation: ['FUNC_ADD', 'FUNC_ADD'] }, subtractive: { label: 'layerBlending.subtractive', blendFunc: ['ONE', 'ONE_MINUS_DST_COLOR', 'SRC_ALPHA', 'DST_ALPHA'], blendEquation: ['FUNC_SUBTRACT', 'FUNC_ADD'] } }; var MAX_DEFAULT_TOOLTIPS = exports.MAX_DEFAULT_TOOLTIPS = 5; var RESOLUTIONS = exports.RESOLUTIONS = (0, _keymirror["default"])({ ONE_X: null, TWO_X: null }); var EXPORT_IMG_RATIOS = exports.EXPORT_IMG_RATIOS = (0, _keymirror["default"])({ SCREEN: null, FOUR_BY_THREE: null, SIXTEEN_BY_NINE: null, CUSTOM: null }); var ScreenRatioOption = exports.ScreenRatioOption = { id: EXPORT_IMG_RATIOS.SCREEN, label: 'modal.exportImage.ratioOriginalScreen', getSize: function getSize(screenW, screenH) { return { width: screenW, height: screenH }; } }; var CustomRatioOption = exports.CustomRatioOption = { id: EXPORT_IMG_RATIOS.CUSTOM, hidden: true, label: 'modal.exportImage.ratioCustom', getSize: function getSize(mapW, mapH) { return { width: mapW, height: mapH }; } }; var FourByThreeRatioOption = exports.FourByThreeRatioOption = { id: EXPORT_IMG_RATIOS.FOUR_BY_THREE, label: 'modal.exportImage.ratio4_3', getSize: function getSize(screenW) { return { width: screenW, height: Math.round(screenW * 0.75) }; } }; var SixteenByNineRatioOption = exports.SixteenByNineRatioOption = { id: EXPORT_IMG_RATIOS.SIXTEEN_BY_NINE, label: 'modal.exportImage.ratio16_9', getSize: function getSize(screenW) { return { width: screenW, height: Math.round(screenW * 0.5625) }; } }; var EXPORT_IMG_RATIO_OPTIONS = exports.EXPORT_IMG_RATIO_OPTIONS = [ScreenRatioOption, CustomRatioOption, FourByThreeRatioOption, SixteenByNineRatioOption]; var OneXResolutionOption = exports.OneXResolutionOption = { id: RESOLUTIONS.ONE_X, label: '1x', available: true, scale: 1, getSize: function getSize(screenW, screenH) { return { width: screenW, height: screenH }; } }; var TwoXResolutionOption = exports.TwoXResolutionOption = { id: RESOLUTIONS.TWO_X, label: '2x', available: true, scale: 2, getSize: function getSize(screenW, screenH) { return { width: screenW * 2, height: screenH * 2 }; } }; var EXPORT_IMG_RESOLUTION_OPTIONS = exports.EXPORT_IMG_RESOLUTION_OPTIONS = [OneXResolutionOption, TwoXResolutionOption]; var EXPORT_DATA_TYPE = exports.EXPORT_DATA_TYPE = (0, _keymirror["default"])({ CSV: null // SHAPEFILE: null, // JSON: null, // GEOJSON: null, // TOPOJSON: null }); var EXPORT_DATA_TYPE_OPTIONS = exports.EXPORT_DATA_TYPE_OPTIONS = [{ id: EXPORT_DATA_TYPE.CSV, label: EXPORT_DATA_TYPE.CSV.toLowerCase(), available: true } // { // id: EXPORT_DATA_TYPE.SHAPEFILE, // label: 'shapefile', // available: false // }, // { // id: EXPORT_DATA_TYPE.JSON, // label: 'json', // available: false // }, // { // id: EXPORT_DATA_TYPE.GEOJSON, // label: 'geojson', // available: false // }, // { // id: EXPORT_DATA_TYPE.TOPOJSON, // label: 'topojson', // available: false // } ]; // Export map types var EXPORT_MAP_FORMATS = exports.EXPORT_MAP_FORMATS = (0, _keymirror["default"])({ HTML: null, JSON: null }); var EXPORT_HTML_MAP_MODES = exports.EXPORT_HTML_MAP_MODES = (0, _keymirror["default"])({ READ: null, EDIT: null }); // Export map options var EXPORT_MAP_FORMAT_OPTIONS = exports.EXPORT_MAP_FORMAT_OPTIONS = Object.entries(EXPORT_MAP_FORMATS).map(function (entry) { return { id: entry[0], label: entry[1].toLowerCase(), available: true }; }); function getHTMLMapModeTileUrl(mode) { return "https://d1a3f4spazzrp4.cloudfront.net/kepler.gl/documentation/map-".concat(mode.toLowerCase(), "-mode.png"); } var EXPORT_HTML_MAP_MODE_OPTIONS = exports.EXPORT_HTML_MAP_MODE_OPTIONS = Object.entries(EXPORT_HTML_MAP_MODES).map(function (entry) { return { id: entry[0], label: "modal.exportMap.html.".concat(entry[1].toLowerCase()), available: true, url: getHTMLMapModeTileUrl(entry[1]) }; }); var DEFAULT_UUID_COUNT = exports.DEFAULT_UUID_COUNT = 6; var DEFAULT_NOTIFICATION_MESSAGE = exports.DEFAULT_NOTIFICATION_MESSAGE = 'MESSAGE_NOT_PROVIDED'; var DEFAULT_NOTIFICATION_TYPES = exports.DEFAULT_NOTIFICATION_TYPES = (0, _keymirror["default"])({ info: null, error: null, warning: null, success: null }); var DEFAULT_NOTIFICATION_TOPICS = exports.DEFAULT_NOTIFICATION_TOPICS = (0, _keymirror["default"])({ global: null, file: null }); // Minimum time between identical notifications about deck.gl errors var THROTTLE_NOTIFICATION_TIME = exports.THROTTLE_NOTIFICATION_TIME = 330; // Animation var BASE_SPEED = exports.BASE_SPEED = 600; var FPS = exports.FPS = 60; /** * 4 Animation Window Types * 1. free * |-> |-> * Current time is a fixed range, animation controller calls next animation frames continuously to animation a moving window * The increment id based on domain / BASE_SPEED * SPEED * * 2. incremental * | |-> * Same as free, current time is a growing range, only the max value of range increment during animation. * The increment is also based on domain / BASE_SPEED * SPEED * * 3. point * o -> o * Current time is a point, animation controller calls next animation frame continuously to animation a moving point * The increment is based on domain / BASE_SPEED * SPEED * * 4. interval * o ~> o * Current time is a point. An array of sorted time steps need to be provided. * animation controller calls next animation at a interval when the point jumps to the next step */ var ANIMATION_WINDOW = exports.ANIMATION_WINDOW = (0, _keymirror["default"])({ free: null, incremental: null, point: null, interval: null }); var DEFAULT_TIME_FORMAT = exports.DEFAULT_TIME_FORMAT = 'MM/DD/YY HH:mm:ssa'; var SPEED_CONTROL_RANGE = exports.SPEED_CONTROL_RANGE = [0, 10]; var SPEED_CONTROL_STEP = exports.SPEED_CONTROL_STEP = 0.001; // Geocoder var GEOCODER_DATASET_NAME = exports.GEOCODER_DATASET_NAME = 'geocoder_dataset'; var GEOCODER_LAYER_ID = exports.GEOCODER_LAYER_ID = 'geocoder_layer'; var GEOCODER_GEO_OFFSET = exports.GEOCODER_GEO_OFFSET = 0.05; var GEOCODER_ICON_COLOR = exports.GEOCODER_ICON_COLOR = [255, 0, 0]; var GEOCODER_ICON_SIZE = exports.GEOCODER_ICON_SIZE = 80; // Editor var EDITOR_LAYER_ID = exports.EDITOR_LAYER_ID = 'kepler_editor_layer'; var EDITOR_LAYER_PICKING_RADIUS = exports.EDITOR_LAYER_PICKING_RADIUS = 6; var EDITOR_MODES = exports.EDITOR_MODES = { DRAW_POLYGON: 'DRAW_POLYGON', DRAW_RECTANGLE: 'DRAW_RECTANGLE', EDIT: 'EDIT_VERTEX' }; var PLOT_TYPES = exports.PLOT_TYPES = (0, _keymirror["default"])({ histogram: null, lineChart: null }); // Filter var INIT_FILTER_ITEMS_IN_DROPDOWN = exports.INIT_FILTER_ITEMS_IN_DROPDOWN = 100; // GPU Filtering /** * Max number of filter value buffers that deck.gl provides */ var MAX_GPU_FILTERS = exports.MAX_GPU_FILTERS = 4; var MAP_THUMBNAIL_DIMENSION = exports.MAP_THUMBNAIL_DIMENSION = { width: 300, height: 200 }; var MAP_INFO_CHARACTER = exports.MAP_INFO_CHARACTER = { title: 100, description: 100 }; // Load data var LOADING_METHODS = exports.LOADING_METHODS = (0, _keymirror["default"])({ upload: null, storage: null, tileset: null }); var DEFAULT_FEATURE_FLAGS = exports.DEFAULT_FEATURE_FLAGS = {}; var DATASET_FORMATS = exports.DATASET_FORMATS = (0, _keymirror["default"])({ row: null, geojson: null, csv: null, keplergl: null, arrow: null, duckdb: null }); var MAP_CONTROLS = exports.MAP_CONTROLS = (0, _keymirror["default"])({ visibleLayers: null, mapLegend: null, toggle3d: null, splitMap: null, mapDraw: null, mapLocale: null, effect: null, aiAssistant: null }); /** * A multiplier for screen-space width/scale for Arc, Line, Icon and Text layers. * Required in order to maintain the same appearance after upgrading to deck.gl v8.5. * https://github.com/visgl/deck.gl/blob/master/docs/upgrade-guide.md */ var PROJECTED_PIXEL_SIZE_MULTIPLIER = exports.PROJECTED_PIXEL_SIZE_MULTIPLIER = 2 / 3; /** * Maximum value for text outline width */ var TEXT_OUTLINE_MULTIPLIER = exports.TEXT_OUTLINE_MULTIPLIER = 5; var dataTestIds = exports.dataTestIds = { infoIcon: 'info-icon', warningIcon: 'warning-icon', errorIcon: 'error-icon', successIcon: 'success-icon', checkmarkIcon: 'checkmark-icon', sortableLayerItem: 'sortable-layer-item', staticLayerItem: 'static-layer-item', layerTitleEditor: 'layer__title__editor', removeLayerAction: 'remove-layer-action', layerPanel: 'layer-panel', sortableEffectItem: 'sortable-effect-item', staticEffectItem: 'static-effect-item', providerLoading: 'provider-loading', providerMapInfoPanel: 'provider-map-info-panel', providerSelect: 'provider-select', cloudHeader: 'cloud-header', providerShareMap: 'provider-share-map' }; // Effects var DEFAULT_TIMEZONE = exports.DEFAULT_TIMEZONE = 'UTC'; var DEFAULT_POST_PROCESSING_EFFECT_TYPE = exports.DEFAULT_POST_PROCESSING_EFFECT_TYPE = 'ink'; var DEFAULT_LIGHT_COLOR = exports.DEFAULT_LIGHT_COLOR = [255, 255, 255]; var DEFAULT_LIGHT_INTENSITY = exports.DEFAULT_LIGHT_INTENSITY = 1; var DEFAULT_SHADOW_INTENSITY = exports.DEFAULT_SHADOW_INTENSITY = 0.5; var DEFAULT_SHADOW_COLOR = exports.DEFAULT_SHADOW_COLOR = [0, 0, 0]; var LIGHT_AND_SHADOW_EFFECT_TIME_MODES = exports.LIGHT_AND_SHADOW_EFFECT_TIME_MODES = { pick: 'pick', current: 'current', animation: 'animation' }; var DEFAULT_LIGHT_AND_SHADOW_PROPS = exports.DEFAULT_LIGHT_AND_SHADOW_PROPS = { timestamp: Date.now(), timeMode: LIGHT_AND_SHADOW_EFFECT_TIME_MODES.pick, shadowIntensity: DEFAULT_SHADOW_INTENSITY, shadowColor: [].concat(DEFAULT_SHADOW_COLOR), sunLightColor: [].concat(DEFAULT_LIGHT_COLOR), sunLightIntensity: DEFAULT_LIGHT_INTENSITY, ambientLightColor: [].concat(DEFAULT_LIGHT_COLOR), ambientLightIntensity: DEFAULT_LIGHT_INTENSITY }; var LIGHT_AND_SHADOW_EFFECT = exports.LIGHT_AND_SHADOW_EFFECT = { type: 'lightAndShadow', name: 'Light & Shadow', parameters: [{ name: 'timestamp', min: 0, max: Number.MAX_SAFE_INTEGER }, { name: 'shadowIntensity', min: 0, max: 1, defaultValue: DEFAULT_SHADOW_INTENSITY }, { name: 'sunLightIntensity', min: 0, max: 1, defaultValue: DEFAULT_LIGHT_INTENSITY }, { name: 'ambientLightIntensity', min: 0, max: 1, defaultValue: DEFAULT_LIGHT_INTENSITY }, { name: 'shadowColor', type: 'color', min: 0, max: 255, defaultValue: DEFAULT_SHADOW_COLOR }, { name: 'sunLightColor', type: 'color', min: 0, max: 255, defaultValue: DEFAULT_LIGHT_COLOR }, { name: 'ambientLightColor', type: 'color', min: 0, max: 255, defaultValue: DEFAULT_LIGHT_COLOR }] }; var POSTPROCESSING_EFFECTS = exports.POSTPROCESSING_EFFECTS = { ink: { type: 'ink', name: 'Ink', parameters: [{ name: 'strength', min: 0, max: 1 }] }, brightnessContrast: { type: 'brightnessContrast', name: 'Brightness & Contrast', parameters: [{ name: 'brightness', min: -1, max: 1 }, { name: 'contrast', min: -1, max: 1 }] }, hueSaturation: { type: 'hueSaturation', name: 'Hue & Saturation', parameters: [{ name: 'hue', min: -1, max: 1 }, { name: 'saturation', defaultValue: 0.25, min: -1, max: 1 }] }, vibrance: { type: 'vibrance', name: 'Vibrance', parameters: [{ name: 'amount', defaultValue: 0.5, min: -1, max: 1 }] }, sepia: { type: 'sepia', name: 'Sepia', parameters: [{ name: 'amount', min: 0, max: 1 }] }, dotScreen: { type: 'dotScreen', name: 'Dot Screen', parameters: [{ name: 'angle', min: 0, max: Math.PI / 2 }, { name: 'size', min: 1, max: 20 }, { name: 'center', type: 'array', label: ['Center X', 'Center Y'], defaultValue: [0.5, 0.5], min: 0, max: 1 }] }, colorHalftone: { type: 'colorHalftone', name: 'Color Halftone', parameters: [{ name: 'angle', min: 0, max: Math.PI / 2 }, { name: 'size', min: 1, max: 20 }, { name: 'center', type: 'array', label: ['Center X', 'Center Y'], defaultValue: [0.5, 0.5], min: 0, max: 1 }] }, noise: { type: 'noise', name: 'Noise', parameters: [{ name: 'amount', min: 0, max: 1 }] }, triangleBlur: { type: 'triangleBlur', name: 'Blur (Triangle)', parameters: [{ name: 'radius', min: 0, max: 100 }] }, zoomBlur: { type: 'zoomBlur', name: 'Blur (Zoom)', parameters: [{ name: 'strength', defaultValue: 0.05, min: 0, max: 1 }, { name: 'center', type: 'array', label: ['Center X', 'Center Y'], defaultValue: [0.5, 0.5], min: 0, max: 1 }] }, tiltShift: { type: 'tiltShift', name: 'Blur (Tilt Shift)', parameters: [{ name: 'blurRadius', label: 'Blur', min: 0, max: 50 }, { name: 'gradientRadius', label: 'Gradient', min: 0, max: 400 }, { name: 'start', type: 'array', label: ['Start', false], defaultValue: [0.0, 0.0], min: 0, max: 1 }, { name: 'end', type: 'array', label: ['End', false], defaultValue: [1, 1], min: 0, max: 1 }] }, edgeWork: { type: 'edgeWork', name: 'Edge work', parameters: [{ name: 'radius', min: 1, max: 50 }] }, vignette: { type: 'vignette', name: 'Vignette', parameters: [{ name: 'amount', min: 0, max: 1 }, { name: 'radius', min: 0, max: 1 }] }, magnify: { type: 'magnify', name: 'Magnify', parameters: [{ name: 'screenXY', type: 'array', label: ['Position X', 'Position Y'], defaultValue: [0.5, 0.5], min: 0, max: 1 }, { name: 'radiusPixels', label: 'Size', min: 10, max: 500 }, { name: 'zoom', min: 0.5, max: 50 }, { name: 'borderWidthPixels', label: 'Border Width', defaultValue: 3, min: 0, max: 50 }] }, hexagonalPixelate: { type: 'hexagonalPixelate', name: 'Hexagonal Pixelate', parameters: [{ name: 'scale', defaultValue: 20, min: 1, max: 50 }] } }; var EFFECT_DESCRIPTIONS = exports.EFFECT_DESCRIPTIONS = [LIGHT_AND_SHADOW_EFFECT].concat((0, _toConsumableArray2["default"])(Object.keys(POSTPROCESSING_EFFECTS).map(function (keyName) { return POSTPROCESSING_EFFECTS[keyName]; }))); var SYNC_TIMELINE_MODES = exports.SYNC_TIMELINE_MODES = { start: 0, end: 1 }; var GEOARROW_METADATA_KEY = exports.GEOARROW_METADATA_KEY = 'ARROW:extension:name'; /** * Enum holding GeoArrow extension type names */ var GEOARROW_EXTENSIONS = exports.GEOARROW_EXTENSIONS = /*#__PURE__*/function (GEOARROW_EXTENSIONS) { GEOARROW_EXTENSIONS["POINT"] = "geoarrow.point"; GEOARROW_EXTENSIONS["LINESTRING"] = "geoarrow.linestring"; GEOARROW_EXTENSIONS["POLYGON"] = "geoarrow.polygon"; GEOARROW_EXTENSIONS["MULTIPOINT"] = "geoarrow.multipoint"; GEOARROW_EXTENSIONS["MULTILINESTRING"] = "geoarrow.multilinestring"; GEOARROW_EXTENSIONS["MULTIPOLYGON"] = "geoarrow.multipolygon"; GEOARROW_EXTENSIONS["WKB"] = "geoarrow.wkb"; return GEOARROW_EXTENSIONS; }({}); //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyJfa2V5bWlycm9yIiwiX2ludGVyb3BSZXF1aXJlRGVmYXVsdCIsInJlcXVpcmUiLCJfZDNTY2FsZSIsIl90b29sdGlwIiwiX0ZJRUxEX1RZUEVfRElTUExBWSIsIl9GSUVMRF9PUFRTIiwib3duS2V5cyIsImUiLCJyIiwidCIsIk9iamVjdCIsImtleXMiLCJnZXRPd25Qcm9wZXJ0eVN5bWJvbHMiLCJvIiwiZmlsdGVyIiwiZ2V0T3duUHJvcGVydHlEZXNjcmlwdG9yIiwiZW51bWVyYWJsZSIsInB1c2giLCJhcHBseSIsIl9vYmplY3RTcHJlYWQiLCJhcmd1bWVudHMiLCJsZW5ndGgiLCJmb3JFYWNoIiwiX2RlZmluZVByb3BlcnR5MiIsImdldE93blByb3BlcnR5RGVzY3JpcHRvcnMiLCJkZWZpbmVQcm9wZXJ0aWVzIiwiZGVmaW5lUHJvcGVydHkiLCJBQ1RJT05fUFJFRklYIiwiZXhwb3J0cyIsIktFUExFUl9VTkZPTERFRF9CVUNLRVQiLCJCQVNFTUFQX0lDT05fUFJFRklYIiwiY29uY2F0IiwiREVGQVVMVF9NQVBCT1hfQVBJX1VSTCIsIlRSQU5TSVRJT05fRFVSQVRJT04iLCJEQVRBX1RBQkxFX0lEIiwiREVMRVRFX0RBVEFfSUQiLCJBRERfREFUQV9JRCIsIkVYUE9SVF9JTUFHRV9JRCIsIkVYUE9SVF9EQVRBX0lEIiwiQUREX01BUF9TVFlMRV9JRCIsIkVYUE9SVF9NQVBfSUQiLCJTQVZFX01BUF9JRCIsIk9WRVJXUklURV9NQVBfSUQiLCJTSEFSRV9NQVBfSUQiLCJLRVBMRVJfR0xfTkFNRSIsIktFUExFUl9HTF9WRVJTSU9OIiwiS0VQTEVSX0dMX1dFQlNJVEUiLCJESU1FTlNJT05TIiwic2lkZVBhbmVsIiwid2lkdGgiLCJtYXJnaW4iLCJ0b3AiLCJsZWZ0IiwiYm90dG9tIiwicmlnaHQiLCJoZWFkZXJIZWlnaHQiLCJtYXBDb250cm9sIiwicGFkZGluZyIsIm1hcExlZ2VuZCIsInBpbm5lZCIsIlRIRU1FIiwia2V5TWlycm9yIiwibGlnaHQiLCJkYXJrIiwiYmFzZSIsIlNJREVCQVJfUEFORUxTIiwiaWQiLCJsYWJlbCIsIm9uQ2xpY2siLCJQQU5FTF9WSUVXX1RPR0dMRVMiLCJsaXN0IiwiYnlEYXRhc2V0IiwiUEFORUxTIiwiREVGQVVMVF9CTERHX0NPTE9SIiwiREVGQVVMVF9CQUNLR1JPVU5EX0NPTE9SIiwiQkFTRV9NQVBfQkFDS0dST1VORF9MQVlFUl9JRFMiLCJCQUNLR1JPVU5EX0xBWUVSX0dST1VQX1NMVUciLCJUSFJFRV9EX0JVSUxESU5HX0xBWUVSX0dST1VQX1NMVUciLCJCQUNLR1JPVU5EX0xBWUVSX0dST1VQIiwic2x1ZyIsImRlZmF1bHRWaXNpYmlsaXR5IiwiaXNWaXNpYmlsaXR5VG9nZ2xlQXZhaWxhYmxlIiwiaXNNb3ZlVG9Ub3BBdmFpbGFibGUiLCJpc0NvbG9yUGlja2VyQXZhaWxhYmxlIiwiREVGQVVMVF9MQVlFUl9HUk9VUFMiLCJfcmVmIiwidHlwZSIsIm1hdGNoIiwiX3JlZjIiLCJfcmVmMyIsIl9yZWY0IiwiX3JlZjUiLCJfcmVmNiIsIkJBU0VfTUFQX0NPTE9SX01PREVTIiwiTk9ORSIsIkRBUksiLCJMSUdIVCIsIk5PX01BUF9JRCIsIkVNUFRZX01BUEJPWF9TVFlMRSIsInZlcnNpb24iLCJzb3VyY2VzIiwibGF5ZXJzIiwiTUFQX0xJQl9PUFRJT05TIiwiTUFQQk9YIiwiTUFQTElCUkUiLCJOT19CQVNFTUFQX0lDT04iLCJERUZBVUxUX0JBU0VfTUFQX1NUWUxFIiwiREVGQVVMVF9OT19CQVNFTUFQX1NUWUxFIiwidXJsIiwiaWNvbiIsImxheWVyR3JvdXBzIiwiY29sb3JNb2RlIiwic3R5bGUiLCJERUZBVUxUX01BUEJPWF9TVFlMRVMiLCJjb21wbGltZW50YXJ5U3R5bGVJZCIsIkRFRkFVTFRfTUFQQk9YX1NBVEVMSVRFX1NUWUxFUyIsIkRFRkFVTFRfTUFQTElCUkVfU1RZTEVTIiwiREVGQVVMVF9NQVBfU1RZTEVTIiwiR0VPSlNPTl9GSUVMRFMiLCJnZW9qc29uIiwiSUNPTl9GSUVMRFMiLCJUUklQX1BPSU5UX0ZJRUxEUyIsIkFMVElUVURFX0ZJRUxEUyIsIlRSSVBfQVJDX0ZJRUxEUyIsImxhdDAiLCJsbmcwIiwibGF0MSIsImxuZzEiLCJGSUxURVJfVFlQRVMiLCJyYW5nZSIsInNlbGVjdCIsImlucHV0IiwidGltZVJhbmdlIiwibXVsdGlTZWxlY3QiLCJwb2x5Z29uIiwiRklMVEVSX1ZJRVdfVFlQRVMiLCJzaWRlIiwiZW5sYXJnZWQiLCJtaW5pZmllZCIsIkRFRkFVTFRfRklMVEVSX1ZJRVdfVFlQRSIsIlNDQUxFX1RZUEVTIiwib3JkaW5hbCIsInF1YW50aWxlIiwicXVhbnRpemUiLCJsaW5lYXIiLCJzcXJ0IiwibG9nIiwidGhyZXNob2xkIiwiY3VzdG9tIiwiY3VzdG9tT3JkaW5hbCIsInBvaW50IiwiU0NBTEVfVFlQRV9OQU1FUyIsIlNDQUxFX0ZVTkMiLCJzY2FsZUxpbmVhciIsInNjYWxlUXVhbnRpemUiLCJzY2FsZVF1YW50aWxlIiwic2NhbGVPcmRpbmFsIiwic2NhbGVTcXJ0Iiwic2NhbGVMb2ciLCJzY2FsZVBvaW50Iiwic2NhbGVUaHJlc2hvbGQiLCJBTExfRklFTERfVFlQRVMiLCJkYXRlIiwiaW50ZWdlciIsInJlYWwiLCJzdHJpbmciLCJ0aW1lc3RhbXAiLCJhcnJheSIsIm9iamVjdCIsImdlb2Fycm93IiwiaDMiLCJTT1JUX09SREVSIiwiQVNDRU5ESU5HIiwiREVTQ0VORElORyIsIlVOU09SVCIsIlRBQkxFX09QVElPTiIsIlNPUlRfQVNDIiwiU09SVF9ERV