@kepler.gl/utils 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/application-config.d.ts +180 -1
- package/dist/arrow-data-container.d.ts +55 -2
- package/dist/camera-tour.d.ts +11 -0
- package/dist/camera-utils.d.ts +7 -0
- package/dist/cjs/aggregation.js +84 -0
- package/dist/cjs/aggregation.js.map +1 -0
- package/dist/cjs/application-config-types.js +6 -0
- package/dist/cjs/application-config-types.js.map +1 -0
- package/dist/cjs/application-config.js +178 -0
- package/dist/cjs/application-config.js.map +1 -0
- package/dist/cjs/arrow-data-container.js +1152 -0
- package/dist/cjs/arrow-data-container.js.map +1 -0
- package/dist/cjs/browser-utils.js +17 -0
- package/dist/cjs/browser-utils.js.map +1 -0
- package/dist/cjs/camera-tour.js +99 -0
- package/dist/cjs/camera-tour.js.map +1 -0
- package/dist/cjs/camera-utils.js +81 -0
- package/dist/cjs/camera-utils.js.map +1 -0
- package/dist/cjs/color-utils.js +462 -0
- package/dist/cjs/color-utils.js.map +1 -0
- package/dist/cjs/column-statistics.js +115 -0
- package/dist/cjs/column-statistics.js.map +1 -0
- package/dist/cjs/data-container-interface.js +6 -0
- package/dist/cjs/data-container-interface.js.map +1 -0
- package/dist/cjs/data-container-utils.js +76 -0
- package/dist/cjs/data-container-utils.js.map +1 -0
- package/dist/cjs/data-row.js +110 -0
- package/dist/cjs/data-row.js.map +1 -0
- package/dist/cjs/data-scale-utils.js +634 -0
- package/dist/cjs/data-scale-utils.js.map +1 -0
- package/dist/cjs/data-utils.js +538 -0
- package/dist/cjs/data-utils.js.map +1 -0
- package/dist/cjs/dataset-utils.js +361 -0
- package/dist/cjs/dataset-utils.js.map +1 -0
- package/dist/cjs/dom-to-image.js +433 -0
- package/dist/cjs/dom-to-image.js.map +1 -0
- package/dist/cjs/dom-utils.js +349 -0
- package/dist/cjs/dom-utils.js.map +1 -0
- package/dist/cjs/editor-feature-utils.js +177 -0
- package/dist/cjs/editor-feature-utils.js.map +1 -0
- package/dist/cjs/effect-utils.js +340 -0
- package/dist/cjs/effect-utils.js.map +1 -0
- package/dist/cjs/export-map-html.js +112 -0
- package/dist/cjs/export-map-html.js.map +1 -0
- package/dist/cjs/export-utils.js +318 -0
- package/dist/cjs/export-utils.js.map +1 -0
- package/dist/cjs/extract-dataset-utils.js +218 -0
- package/dist/cjs/extract-dataset-utils.js.map +1 -0
- package/dist/cjs/filter-utils.js +1762 -0
- package/dist/cjs/filter-utils.js.map +1 -0
- package/dist/cjs/format.js +38 -0
- package/dist/cjs/format.js.map +1 -0
- package/dist/cjs/gl-utils.js +118 -0
- package/dist/cjs/gl-utils.js.map +1 -0
- package/dist/{index.js → cjs/index.js} +391 -10
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/indexed-data-container.js +214 -0
- package/dist/cjs/indexed-data-container.js.map +1 -0
- package/dist/cjs/jenks.js +156 -0
- package/dist/cjs/jenks.js.map +1 -0
- package/dist/cjs/locale-utils.js +39 -0
- package/dist/cjs/locale-utils.js.map +1 -0
- package/dist/cjs/map-info-utils.js +41 -0
- package/dist/cjs/map-info-utils.js.map +1 -0
- package/dist/cjs/map-style-utils/mapbox-gl-style-editor.js +198 -0
- package/dist/cjs/map-style-utils/mapbox-gl-style-editor.js.map +1 -0
- package/dist/cjs/map-style-utils/mapbox-utils.js +155 -0
- package/dist/cjs/map-style-utils/mapbox-utils.js.map +1 -0
- package/dist/cjs/map-utils.js +76 -0
- package/dist/cjs/map-utils.js.map +1 -0
- package/dist/cjs/mapbox-utils.js +19 -0
- package/dist/cjs/mapbox-utils.js.map +1 -0
- package/dist/cjs/notifications-utils.js +69 -0
- package/dist/cjs/notifications-utils.js.map +1 -0
- package/dist/cjs/observe-dimensions.js +136 -0
- package/dist/cjs/observe-dimensions.js.map +1 -0
- package/dist/cjs/plot.js +1502 -0
- package/dist/cjs/plot.js.map +1 -0
- package/dist/cjs/position-utils.js +29 -0
- package/dist/cjs/position-utils.js.map +1 -0
- package/dist/cjs/projection-utils.js +141 -0
- package/dist/cjs/projection-utils.js.map +1 -0
- package/dist/cjs/quick-insertion-sort.js +132 -0
- package/dist/cjs/quick-insertion-sort.js.map +1 -0
- package/dist/cjs/row-data-container.js +291 -0
- package/dist/cjs/row-data-container.js.map +1 -0
- package/dist/cjs/slider-scale-utils.js +138 -0
- package/dist/cjs/slider-scale-utils.js.map +1 -0
- package/dist/cjs/split-map-utils.js +117 -0
- package/dist/cjs/split-map-utils.js.map +1 -0
- package/dist/cjs/strings.js +16 -0
- package/dist/cjs/strings.js.map +1 -0
- package/dist/cjs/theme-utils.js +46 -0
- package/dist/cjs/theme-utils.js.map +1 -0
- package/dist/cjs/time.js +321 -0
- package/dist/cjs/time.js.map +1 -0
- package/dist/cjs/types.js +6 -0
- package/dist/cjs/types.js.map +1 -0
- package/dist/cjs/utils.js +224 -0
- package/dist/cjs/utils.js.map +1 -0
- package/dist/column-statistics.d.ts +54 -0
- package/dist/data-container-interface.d.ts +16 -1
- package/dist/data-container-utils.d.ts +2 -1
- package/dist/data-scale-utils.d.ts +5 -0
- package/dist/data-utils.d.ts +3 -3
- package/dist/dataset-utils.d.ts +11 -28
- package/dist/editor-feature-utils.d.ts +30 -0
- package/dist/esm/aggregation.js +75 -0
- package/dist/esm/aggregation.js.map +1 -0
- package/dist/esm/application-config-types.js +3 -0
- package/dist/esm/application-config-types.js.map +1 -0
- package/dist/esm/application-config.js +167 -0
- package/dist/esm/application-config.js.map +1 -0
- package/dist/esm/arrow-data-container.js +1136 -0
- package/dist/esm/arrow-data-container.js.map +1 -0
- package/dist/esm/browser-utils.js +11 -0
- package/dist/esm/browser-utils.js.map +1 -0
- package/dist/esm/camera-tour.js +92 -0
- package/dist/esm/camera-tour.js.map +1 -0
- package/dist/esm/camera-utils.js +74 -0
- package/dist/esm/camera-utils.js.map +1 -0
- package/dist/esm/color-utils.js +435 -0
- package/dist/esm/color-utils.js.map +1 -0
- package/dist/esm/column-statistics.js +105 -0
- package/dist/esm/column-statistics.js.map +1 -0
- package/dist/esm/data-container-interface.js +3 -0
- package/dist/esm/data-container-interface.js.map +1 -0
- package/dist/esm/data-container-utils.js +68 -0
- package/dist/esm/data-container-utils.js.map +1 -0
- package/dist/esm/data-row.js +106 -0
- package/dist/esm/data-row.js.map +1 -0
- package/dist/esm/data-scale-utils.js +602 -0
- package/dist/esm/data-scale-utils.js.map +1 -0
- package/dist/esm/data-utils.js +504 -0
- package/dist/esm/data-utils.js.map +1 -0
- package/dist/esm/dataset-utils.js +352 -0
- package/dist/esm/dataset-utils.js.map +1 -0
- package/dist/esm/dom-to-image.js +426 -0
- package/dist/esm/dom-to-image.js.map +1 -0
- package/dist/esm/dom-utils.js +323 -0
- package/dist/esm/dom-utils.js.map +1 -0
- package/dist/esm/editor-feature-utils.js +164 -0
- package/dist/esm/editor-feature-utils.js.map +1 -0
- package/dist/esm/effect-utils.js +333 -0
- package/dist/esm/effect-utils.js.map +1 -0
- package/dist/esm/export-map-html.js +107 -0
- package/dist/esm/export-map-html.js.map +1 -0
- package/dist/esm/export-utils.js +297 -0
- package/dist/esm/export-utils.js.map +1 -0
- package/dist/esm/extract-dataset-utils.js +206 -0
- package/dist/esm/extract-dataset-utils.js.map +1 -0
- package/dist/esm/filter-utils.js +1701 -0
- package/dist/esm/filter-utils.js.map +1 -0
- package/dist/esm/format.js +31 -0
- package/dist/esm/format.js.map +1 -0
- package/dist/esm/gl-utils.js +113 -0
- package/dist/esm/gl-utils.js.map +1 -0
- package/dist/esm/index.js +55 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/indexed-data-container.js +210 -0
- package/dist/esm/indexed-data-container.js.map +1 -0
- package/dist/esm/jenks.js +149 -0
- package/dist/esm/jenks.js.map +1 -0
- package/dist/esm/locale-utils.js +36 -0
- package/dist/esm/locale-utils.js.map +1 -0
- package/dist/esm/map-info-utils.js +35 -0
- package/dist/esm/map-info-utils.js.map +1 -0
- package/dist/esm/map-style-utils/mapbox-gl-style-editor.js +188 -0
- package/dist/esm/map-style-utils/mapbox-gl-style-editor.js.map +1 -0
- package/dist/esm/map-style-utils/mapbox-utils.js +144 -0
- package/dist/esm/map-style-utils/mapbox-utils.js.map +1 -0
- package/dist/esm/map-utils.js +72 -0
- package/dist/esm/map-utils.js.map +1 -0
- package/dist/esm/mapbox-utils.js +13 -0
- package/dist/esm/mapbox-utils.js.map +1 -0
- package/dist/esm/notifications-utils.js +63 -0
- package/dist/esm/notifications-utils.js.map +1 -0
- package/dist/esm/observe-dimensions.js +128 -0
- package/dist/esm/observe-dimensions.js.map +1 -0
- package/dist/esm/plot.js +1460 -0
- package/dist/esm/plot.js.map +1 -0
- package/dist/esm/position-utils.js +22 -0
- package/dist/esm/position-utils.js.map +1 -0
- package/dist/esm/projection-utils.js +131 -0
- package/dist/esm/projection-utils.js.map +1 -0
- package/dist/esm/quick-insertion-sort.js +125 -0
- package/dist/esm/quick-insertion-sort.js.map +1 -0
- package/dist/esm/row-data-container.js +286 -0
- package/dist/esm/row-data-container.js.map +1 -0
- package/dist/esm/slider-scale-utils.js +129 -0
- package/dist/esm/slider-scale-utils.js.map +1 -0
- package/dist/esm/split-map-utils.js +109 -0
- package/dist/esm/split-map-utils.js.map +1 -0
- package/dist/esm/strings.js +10 -0
- package/dist/esm/strings.js.map +1 -0
- package/dist/esm/theme-utils.js +38 -0
- package/dist/esm/theme-utils.js.map +1 -0
- package/dist/esm/time.js +308 -0
- package/dist/esm/time.js.map +1 -0
- package/dist/esm/types.js +3 -0
- package/dist/esm/types.js.map +1 -0
- package/dist/esm/utils.js +203 -0
- package/dist/esm/utils.js.map +1 -0
- package/dist/export-map-html.d.ts +5 -0
- package/dist/export-utils.d.ts +31 -3
- package/dist/extract-dataset-utils.d.ts +79 -0
- package/dist/filter-utils.d.ts +56 -7
- package/dist/index.d.ts +20 -9
- package/dist/jenks.d.ts +5 -0
- package/dist/map-info-utils.d.ts +11 -1
- package/dist/map-style-utils/mapbox-gl-style-editor.d.ts +11 -10
- package/dist/map-style-utils/mapbox-utils.d.ts +29 -1
- package/dist/plot.d.ts +187 -21
- package/dist/projection-utils.d.ts +6 -4
- package/dist/row-data-container.d.ts +19 -0
- package/dist/split-map-utils.d.ts +7 -0
- package/dist/theme-utils.d.ts +8 -0
- package/dist/time.d.ts +3 -3
- package/dist/types.d.ts +2 -0
- package/package.json +33 -26
- package/dist/aggregation.js +0 -84
- package/dist/application-config-types.js +0 -6
- package/dist/application-config.js +0 -113
- package/dist/arrow-data-container.js +0 -398
- package/dist/browser-utils.js +0 -17
- package/dist/color-utils.js +0 -462
- package/dist/data-container-interface.js +0 -6
- package/dist/data-container-utils.js +0 -75
- package/dist/data-row.js +0 -110
- package/dist/data-scale-utils.js +0 -620
- package/dist/data-utils.js +0 -532
- package/dist/dataset-utils.js +0 -330
- package/dist/dom-to-image.js +0 -433
- package/dist/dom-utils.js +0 -349
- package/dist/effect-utils.js +0 -318
- package/dist/export-map-html.js +0 -38
- package/dist/export-utils.js +0 -203
- package/dist/filter-utils.js +0 -1274
- package/dist/format.js +0 -38
- package/dist/gl-utils.js +0 -118
- package/dist/indexed-data-container.js +0 -214
- package/dist/locale-utils.js +0 -39
- package/dist/map-info-utils.js +0 -14
- package/dist/map-style-utils/mapbox-gl-style-editor.js +0 -194
- package/dist/map-style-utils/mapbox-utils.js +0 -107
- package/dist/map-utils.js +0 -72
- package/dist/mapbox-utils.js +0 -19
- package/dist/noop.d.ts +0 -1
- package/dist/noop.js +0 -13
- package/dist/notifications-utils.js +0 -69
- package/dist/observe-dimensions.js +0 -136
- package/dist/plot.js +0 -637
- package/dist/position-utils.js +0 -26
- package/dist/projection-utils.js +0 -91
- package/dist/quick-insertion-sort.js +0 -132
- package/dist/row-data-container.js +0 -206
- package/dist/searcher-utils.d.ts +0 -1
- package/dist/searcher-utils.js +0 -25
- package/dist/slider-scale-utils.js +0 -138
- package/dist/split-map-utils.js +0 -99
- package/dist/strings.js +0 -16
- package/dist/time.js +0 -325
- package/dist/types.js +0 -6
- package/dist/utils.js +0 -224
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","names":["_window","_interopRequireDefault","require","_strings","ownKeys","e","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty2","getOwnPropertyDescriptors","defineProperties","defineProperty","generateHashIdFromString","str","hash","i","chr","len","toString","charCodeAt","isChrome","Window","chrome","webstore","camelToTitle","breakWord","replace","capitalizeFirstLetter","camelize","exports","match","index","Number","toLowerCase","toUpperCase","insertValue","obj","key","value","Array","isArray","concat","_toConsumableArray2","slice","isObject","_typeof2","isPlainObject","setPath","_ref","_ref2","_toArray2","next","prototype","hasOwnProperty","call","set","path","DEFAULT_ERROR_MESSAGE","getError","err","defaultMessage","undefined","Error","message","error","JSON","stringify","arrayInsert","arr","val","hasMobileWidth","breakPointValues","mobileWidth","matchMedia","palm","matches","hasPortableWidth","desk","isTest","_globalThis$process","globalThis","process","env","NODE_ENV","filterObjectByPredicate","predicate","entries","reduce","acc","entry","isFunction","func","findById","id","find","a","arrayDifference","source","initial","compare","element","foundElement"],"sources":["../../src/utils.ts"],"sourcesContent":["// SPDX-License-Identifier: MIT\n// Copyright contributors to the kepler.gl project\n\nimport Window from 'global/window';\nimport {capitalizeFirstLetter} from './strings';\n\n/**\n * Generate a hash string based on string\n * @param str\n * @returns\n */\nexport function generateHashIdFromString(str: string): string {\n // generate hash string based on string\n let hash = 0;\n let i;\n let chr;\n let len;\n if (str.length === 0) return hash.toString();\n for (i = 0, len = str.length; i < len; i++) {\n chr = str.charCodeAt(i);\n // eslint-disable-next-line no-bitwise\n hash = (hash << 5) - hash + chr;\n // eslint-disable-next-line no-bitwise\n hash |= 0; // Convert to 32bit integer\n }\n return hash.toString(36);\n}\n\n/**\n * Detect chrome\n * @returns {boolean} - yes or no\n */\nexport function isChrome(): boolean {\n // Chrome 1+\n return Window.chrome && Window.chrome.webstore;\n}\n\n/**\n * Convert camel style names to title\n * strokeColor -> Stroke Color\n * @param {string} str\n * @returns {string}\n */\nexport function camelToTitle(str: string): string {\n const breakWord = str.replace(/([A-Z])/g, ' $1');\n return capitalizeFirstLetter(breakWord);\n}\n\n/**\n * Convert names to camel style\n * Stroke Color -> strokeColor\n * @param {string} str\n * @returns {string}\n */\nexport const camelize = (str: string): string => {\n return str.replace(/(?:^\\w|[A-Z]|\\b\\w|\\s+)/g, (match, index) => {\n if (Number(match) === 0) return ''; // or if (/\\s+/.test(match)) for white spaces\n return index === 0 ? match.toLowerCase() : match.toUpperCase();\n });\n};\n\n/**\n * immutably insert value to an Array or Object\n * @param {Array|Object} obj\n * @param {Number|String} key\n * @param {*} value\n * @returns {Array|Object}\n */\nexport const insertValue = <T extends any[] | object>(\n obj: T,\n key: number | string,\n value: any\n): T => {\n if (Array.isArray(obj) && typeof key === 'number') {\n return [...obj.slice(0, key), value, ...obj.slice(key + 1, obj.length)] as T;\n }\n\n return {...obj, [key]: value};\n};\n\n/**\n * check if value is a loose object including a plain object, array, function\n * @param {*} value\n */\nexport function isObject(value): boolean {\n return value !== null && (typeof value === 'object' || typeof value === 'function');\n}\n\n/**\n * whether is an object\n * @returns {boolean} - yes or no\n */\nexport function isPlainObject(obj: unknown): obj is Record<string, unknown> {\n return obj === Object(obj) && typeof obj !== 'function' && !Array.isArray(obj);\n}\n\nconst setPath = <T extends any[] | object>(\n [key, ...next]: (string | number)[],\n value: any,\n obj: object | any[]\n): T => {\n // is Object allows js object, array and function\n if (!isObject(obj)) {\n return obj as T;\n }\n\n if (next.length === 0) {\n return insertValue(obj, key, value) as T;\n }\n\n // @ts-ignore\n return insertValue(\n obj,\n key,\n setPath(next, value, Object.prototype.hasOwnProperty.call(obj, key) ? obj[key] : {})\n );\n};\n\n/**\n * Immutable version of _.set\n * @param {Array<String|Number>} path\n * @param {*} value\n * @param {Object} obj\n * @returns {Object}\n */\n// @ts-ignore\nexport const set = <T extends any[] | object>(path: (string | number)[], value: any, obj: T): T =>\n obj === null ? obj : setPath(path, value, obj);\n\ntype ErrorObject = {\n error?: any;\n err?: any;\n message?: any;\n};\n\nexport const DEFAULT_ERROR_MESSAGE = 'Something went wrong';\n\n/**\n * Get error information of unknown type\n * Extracts as much human readable information as possible\n * Ensure result is an Error object suitable for throw or promise rejection\n *\n * @private\n * @param {*} err - Unknown error\n * @return {string} - human readable error msg\n */\nexport function getError(\n err?: Error | ErrorObject | string,\n defaultMessage: string = DEFAULT_ERROR_MESSAGE\n): string {\n if (!err) {\n return defaultMessage;\n }\n\n if (typeof err === 'string') {\n return err;\n } else if (err instanceof Error) {\n return err.message;\n } else if (typeof err === 'object') {\n return Object.prototype.hasOwnProperty.call(err, 'message')\n ? getError(err.message)\n : Object.prototype.hasOwnProperty.call(err, 'error')\n ? getError(err.error)\n : Object.prototype.hasOwnProperty.call(err, 'err')\n ? getError(err.err)\n : JSON.stringify(err);\n }\n\n return defaultMessage;\n}\n\nexport function arrayInsert<T>(arr: T[], index: number, val: T): T[] {\n if (!Array.isArray(arr)) {\n return arr;\n }\n\n return [...arr.slice(0, index), val, ...arr.slice(index)];\n}\n\nexport function hasMobileWidth(breakPointValues: {palm: number; desk: number}): boolean {\n const mobileWidth = Window.matchMedia(`(max-width: ${breakPointValues.palm}px)`);\n return mobileWidth.matches;\n}\n\nexport function hasPortableWidth(breakPointValues: {palm: number; desk: number}): boolean {\n const mobileWidth = Window.matchMedia(`(max-width: ${breakPointValues.desk}px)`);\n return mobileWidth.matches;\n}\n\nexport function isTest(): boolean {\n return globalThis.process?.env?.NODE_ENV === 'test';\n}\n\n/**\n * Filters an object by an arbitrary predicate\n * Returns a new object containing all elements that match the predicate\n * @param {Object} obj Object to be filtered\n * @param {Function} predicate Predicate by which the object will be filtered\n * @returns {Object}\n */\nexport function filterObjectByPredicate(obj, predicate) {\n return Object.entries(obj).reduce(\n (acc, entry) => (predicate(entry[0], entry[1]) ? {...acc, [entry[0]]: entry[1]} : acc),\n {}\n );\n}\n\nexport function isFunction(func: unknown): boolean {\n return typeof func === 'function';\n}\n\nexport function findById(id: string): <X extends {id: string}>(arr: X[]) => X | undefined {\n return arr => arr.find(a => a.id === id);\n}\n\n/**\n * Returns array difference from\n */\nexport function arrayDifference<X extends {id: string}>(source: X[]): (compare: X[]) => X[] {\n const initial: X[] = [];\n return compare =>\n source.reduce((acc, element) => {\n const foundElement = findById(element.id)(compare);\n return foundElement ? [...acc, foundElement] : acc;\n }, initial);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,IAAAA,OAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AAAgD,SAAAE,QAAAC,CAAA,EAAAC,CAAA,QAAAC,CAAA,GAAAC,MAAA,CAAAC,IAAA,CAAAJ,CAAA,OAAAG,MAAA,CAAAE,qBAAA,QAAAC,CAAA,GAAAH,MAAA,CAAAE,qBAAA,CAAAL,CAAA,GAAAC,CAAA,KAAAK,CAAA,GAAAA,CAAA,CAAAC,MAAA,WAAAN,CAAA,WAAAE,MAAA,CAAAK,wBAAA,CAAAR,CAAA,EAAAC,CAAA,EAAAQ,UAAA,OAAAP,CAAA,CAAAQ,IAAA,CAAAC,KAAA,CAAAT,CAAA,EAAAI,CAAA,YAAAJ,CAAA;AAAA,SAAAU,cAAAZ,CAAA,aAAAC,CAAA,MAAAA,CAAA,GAAAY,SAAA,CAAAC,MAAA,EAAAb,CAAA,UAAAC,CAAA,WAAAW,SAAA,CAAAZ,CAAA,IAAAY,SAAA,CAAAZ,CAAA,QAAAA,CAAA,OAAAF,OAAA,CAAAI,MAAA,CAAAD,CAAA,OAAAa,OAAA,WAAAd,CAAA,QAAAe,gBAAA,aAAAhB,CAAA,EAAAC,CAAA,EAAAC,CAAA,CAAAD,CAAA,SAAAE,MAAA,CAAAc,yBAAA,GAAAd,MAAA,CAAAe,gBAAA,CAAAlB,CAAA,EAAAG,MAAA,CAAAc,yBAAA,CAAAf,C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MAAM,CAACV,MAAM,CAAC,UAACC,GAAG,EAAEY,OAAO,EAAK;MAC9B,IAAMC,YAAY,GAAGT,QAAQ,CAACQ,OAAO,CAACP,EAAE,CAAC,CAACM,OAAO,CAAC;MAClD,OAAOE,YAAY,MAAA5D,MAAA,KAAAC,mBAAA,aAAO8C,GAAG,IAAEa,YAAY,KAAIb,GAAG;IACpD,CAAC,EAAEU,OAAO,CAAC;EAAA;AACf","ignoreList":[]}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { Bin } from '@kepler.gl/types';
|
|
2
|
+
import { DataContainerInterface } from './data-container-interface';
|
|
3
|
+
export declare const NUMERIC_BIN_COUNT = 20;
|
|
4
|
+
export declare enum ColumnStatsType {
|
|
5
|
+
numeric = "numeric",
|
|
6
|
+
categorical = "categorical",
|
|
7
|
+
boolean = "boolean",
|
|
8
|
+
time = "time",
|
|
9
|
+
geo = "geo",
|
|
10
|
+
other = "other"
|
|
11
|
+
}
|
|
12
|
+
export type Quantile = {
|
|
13
|
+
label: string;
|
|
14
|
+
value: number | null;
|
|
15
|
+
};
|
|
16
|
+
export type NumericColumnStats = {
|
|
17
|
+
type: ColumnStatsType.numeric;
|
|
18
|
+
bins: Bin[];
|
|
19
|
+
quantiles: Quantile[];
|
|
20
|
+
mean: number | null;
|
|
21
|
+
std: number | null;
|
|
22
|
+
percentNulls: number | null;
|
|
23
|
+
};
|
|
24
|
+
export type CategoricalColumnStats = {
|
|
25
|
+
type: ColumnStatsType.categorical;
|
|
26
|
+
uniqueValues: number;
|
|
27
|
+
percentNulls: number | null;
|
|
28
|
+
};
|
|
29
|
+
export type TimeColumnStats = {
|
|
30
|
+
type: ColumnStatsType.time;
|
|
31
|
+
bins: Bin[];
|
|
32
|
+
min: number | null;
|
|
33
|
+
max: number | null;
|
|
34
|
+
percentNulls: number | null;
|
|
35
|
+
};
|
|
36
|
+
export type BooleanColumnStats = {
|
|
37
|
+
type: ColumnStatsType.boolean;
|
|
38
|
+
};
|
|
39
|
+
export type GeometryColumnStats = {
|
|
40
|
+
type: ColumnStatsType.geo;
|
|
41
|
+
};
|
|
42
|
+
export type UnknownColumnStats = {
|
|
43
|
+
type: ColumnStatsType.other;
|
|
44
|
+
};
|
|
45
|
+
export type ColumnStats = NumericColumnStats | BooleanColumnStats | CategoricalColumnStats | TimeColumnStats | GeometryColumnStats | UnknownColumnStats;
|
|
46
|
+
export declare function collectColumnValues(dataContainer: DataContainerInterface, fieldIdx: number): unknown[];
|
|
47
|
+
export declare function computeColumnStats(values: readonly unknown[], fieldType: string): ColumnStats;
|
|
48
|
+
/**
|
|
49
|
+
* Compute column statistics asynchronously so the UI can paint a loading state first.
|
|
50
|
+
*/
|
|
51
|
+
export declare function getColumnStatistics({ values, fieldType }: {
|
|
52
|
+
values: readonly unknown[];
|
|
53
|
+
fieldType: string;
|
|
54
|
+
}): Promise<ColumnStats>;
|
|
@@ -13,7 +13,22 @@ export interface DataContainerInterface {
|
|
|
13
13
|
* Updates the data container with new data.
|
|
14
14
|
* @param updateData updated data, e.g. for arrow data container, it's an array of arrow columns or an arrow.Table; for row data container, it's an array of rows.
|
|
15
15
|
*/
|
|
16
|
-
update?(updateData: any[] | arrow.Table): void;
|
|
16
|
+
update?(updateData: any[] | arrow.Table, options?: Record<string, unknown>): void;
|
|
17
|
+
/**
|
|
18
|
+
* Append rows in place. Implemented by row and Arrow containers.
|
|
19
|
+
* @returns false when the rows are rejected (wrong shape or unsupported Arrow type) and the container is unchanged.
|
|
20
|
+
*/
|
|
21
|
+
append?(rows: any[][]): boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Replace one row in place. Implemented by row and Arrow containers.
|
|
24
|
+
* @returns false when the index or row is rejected and the container is unchanged.
|
|
25
|
+
*/
|
|
26
|
+
replace?(index: number, row: any[]): boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Remove rows by index in place. Implemented by row and Arrow containers.
|
|
29
|
+
* @returns false when any index is invalid and the container is unchanged.
|
|
30
|
+
*/
|
|
31
|
+
remove?(indexes: number[]): boolean;
|
|
17
32
|
/**
|
|
18
33
|
* Returns the number of rows in the data container.
|
|
19
34
|
* @returns Number of rows in the data container.
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { DataContainerInterface } from './data-container-interface';
|
|
2
|
-
import { ProtoDatasetField } from '@kepler.gl/types';
|
|
2
|
+
import { GeoArrowBinaryData, ProtoDatasetField } from '@kepler.gl/types';
|
|
3
3
|
import * as arrow from 'apache-arrow';
|
|
4
4
|
export type DataContainerOptions = {
|
|
5
5
|
inputDataFormat?: string;
|
|
6
6
|
fields?: ProtoDatasetField[];
|
|
7
7
|
arrowTable?: arrow.Table;
|
|
8
|
+
geoArrowBinaryData?: GeoArrowBinaryData;
|
|
8
9
|
};
|
|
9
10
|
export declare const DataForm: {
|
|
10
11
|
ROWS_ARRAY: string;
|
|
@@ -23,6 +23,11 @@ type sort = (a: any, b: any) => any;
|
|
|
23
23
|
* return quantile domain for an array of data
|
|
24
24
|
*/
|
|
25
25
|
export declare function getQuantileDomain(data: any[], valueAccessor?: dataValueAccessor, sortFunc?: sort): number[];
|
|
26
|
+
/**
|
|
27
|
+
* Return Jenks natural-break thresholds for an array of data.
|
|
28
|
+
* `k` is the number of color classes (range length).
|
|
29
|
+
*/
|
|
30
|
+
export declare function getJenksDomain(data: any[], valueAccessor: dataValueAccessor | undefined, k: number): number[];
|
|
26
31
|
/**
|
|
27
32
|
* return ordinal domain for a data container
|
|
28
33
|
*/
|
package/dist/data-utils.d.ts
CHANGED
|
@@ -115,14 +115,14 @@ export declare const parseFieldValue: (value: any, type: string, field?: Field)
|
|
|
115
115
|
* @param format
|
|
116
116
|
* @param field
|
|
117
117
|
*/
|
|
118
|
-
export declare function getFormatter(format?: string | Record<string, string> | null, field?: Field): FieldFormatter;
|
|
118
|
+
export declare function getFormatter(format?: string | Record<string, string> | null, field?: Field, timezone?: string | null): FieldFormatter;
|
|
119
119
|
export declare function getColumnFormatter(field: Pick<Field, 'type'> & Partial<Pick<Field, 'format' | 'displayFormat'>>): FieldFormatter;
|
|
120
120
|
export declare function applyValueMap(format: any): (v: any) => any;
|
|
121
|
-
export declare function applyDefaultFormat(tooltipFormat: TooltipFormat): (v: any) => string;
|
|
121
|
+
export declare function applyDefaultFormat(tooltipFormat: TooltipFormat, timezone?: string | null): (v: any) => string;
|
|
122
122
|
export declare function getBooleanFormatter(format: string): FieldFormatter;
|
|
123
123
|
export declare function applyCustomFormat(format: any, field: {
|
|
124
124
|
type?: string;
|
|
125
|
-
}): FieldFormatter;
|
|
125
|
+
}, timezone?: string | null): FieldFormatter;
|
|
126
126
|
export declare function formatNumber(n: number, type?: string): string;
|
|
127
127
|
/**
|
|
128
128
|
* Convert a formatted number from string back to number
|
package/dist/dataset-utils.d.ts
CHANGED
|
@@ -1,36 +1,18 @@
|
|
|
1
1
|
import { ProcessorResult, RGBColor, Field, FieldPair, TimeLabelFormat, TooltipFields, ProtoDataset } from '@kepler.gl/types';
|
|
2
2
|
import { TooltipFormat } from '@kepler.gl/constants';
|
|
3
|
+
import type { DataContainerInterface } from './data-container-interface';
|
|
3
4
|
export declare const datasetColorMaker: Generator<RGBColor, any, any>;
|
|
4
|
-
|
|
5
|
-
* Choose a field to use as the default color field of a layer.
|
|
6
|
-
*
|
|
7
|
-
* The heuristic is:
|
|
8
|
-
*
|
|
9
|
-
* First, exclude fields that are on the exclusion list and don't
|
|
10
|
-
* have names that suggest they contain metrics. Also exclude
|
|
11
|
-
* field names that are blank.
|
|
12
|
-
*
|
|
13
|
-
* Next, look for a field that is of real type and contains one
|
|
14
|
-
* of the preferred names (in order of the preferred names).
|
|
15
|
-
*
|
|
16
|
-
* Next, look for a field that is of integer type and contains
|
|
17
|
-
* one of the preferred names (in order of the preferred names).
|
|
18
|
-
*
|
|
19
|
-
* Next, look for the first field that is of real type (in order
|
|
20
|
-
* of field index).
|
|
21
|
-
*
|
|
22
|
-
* Next, look for the first field that is of integer type (in
|
|
23
|
-
* order of field index).
|
|
24
|
-
*
|
|
25
|
-
* It's possible no field will be chosen (i.e. because all fields
|
|
26
|
-
* are strings.)
|
|
27
|
-
*
|
|
28
|
-
* @param dataset
|
|
29
|
-
*/
|
|
30
|
-
export declare function findDefaultColorField({ fields, fieldPairs }: {
|
|
5
|
+
type DefaultColorFieldDataset = {
|
|
31
6
|
fields: Field[];
|
|
32
7
|
fieldPairs: FieldPair[];
|
|
33
|
-
}
|
|
8
|
+
};
|
|
9
|
+
/** Choose an eligible float from metadata, including datasets loaded through tiles. */
|
|
10
|
+
export declare function findDefaultColorField(dataset: DefaultColorFieldDataset): Field | null;
|
|
11
|
+
/** Prefer floats to integers, checking for variation only within the scan budget. */
|
|
12
|
+
export declare function findDefaultColorFieldWithValues(dataset: DefaultColorFieldDataset & {
|
|
13
|
+
dataContainer: DataContainerInterface;
|
|
14
|
+
filteredIndexForDomain: number[];
|
|
15
|
+
}): Field | null;
|
|
34
16
|
/**
|
|
35
17
|
* Validate input data, adding missing field types, rename duplicate columns
|
|
36
18
|
*/
|
|
@@ -43,3 +25,4 @@ export declare const addTimeLabel: (formats: TimeLabelFormat[]) => {
|
|
|
43
25
|
}[];
|
|
44
26
|
export declare function getFieldFormatLabels(fieldType?: string): TooltipFormat[];
|
|
45
27
|
export declare const getFormatLabels: (fields: TooltipFields[], fieldName: string) => TooltipFormat[];
|
|
28
|
+
export {};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Feature } from '@kepler.gl/types';
|
|
2
|
+
export declare function isReservedEditorProperty(key: string): boolean;
|
|
3
|
+
/**
|
|
4
|
+
* GeoJSON properties that should survive copy / convert, excluding editor internals.
|
|
5
|
+
*/
|
|
6
|
+
export declare function getUserFeatureProperties(feature?: Feature | null): Record<string, unknown>;
|
|
7
|
+
/**
|
|
8
|
+
* Replace user-facing properties while preserving editor-only keys.
|
|
9
|
+
*/
|
|
10
|
+
export declare function mergeUserFeatureProperties(feature: Feature, userProperties?: Record<string, unknown>): Feature;
|
|
11
|
+
export type EditorFeatureCollection = {
|
|
12
|
+
type: 'FeatureCollection';
|
|
13
|
+
features: Feature[];
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Strip editor-only properties so copied / converted GeoJSON is usable as data.
|
|
17
|
+
*/
|
|
18
|
+
export declare function sanitizeEditorFeature(feature: Feature): Feature;
|
|
19
|
+
/**
|
|
20
|
+
* Convert editor sketch features into a GeoJSON FeatureCollection.
|
|
21
|
+
*/
|
|
22
|
+
export declare function editorFeaturesToFeatureCollection(features?: Feature[]): EditorFeatureCollection;
|
|
23
|
+
/**
|
|
24
|
+
* Convert a polygon-filter feature back into an editor sketch.
|
|
25
|
+
*/
|
|
26
|
+
export declare function toSketchFeature(feature: Feature): Feature;
|
|
27
|
+
/**
|
|
28
|
+
* Map position for a filter badge: the vertex nearest the north-east bbox corner.
|
|
29
|
+
*/
|
|
30
|
+
export declare function getFilterFeatureAnchor(feature: Feature): [number, number] | null;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// Copyright contributors to the kepler.gl project
|
|
4
|
+
|
|
5
|
+
import { deviation, min, max, mean, median, sum, variance } from 'd3-array';
|
|
6
|
+
import { AGGREGATION_TYPES } from '@kepler.gl/constants';
|
|
7
|
+
var identity = function identity(d) {
|
|
8
|
+
return d;
|
|
9
|
+
};
|
|
10
|
+
export var getFrequency = function getFrequency(data) {
|
|
11
|
+
var accessor = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : identity;
|
|
12
|
+
var occur = {};
|
|
13
|
+
for (var i = 0; i < data.length; i++) {
|
|
14
|
+
var val = accessor(data[i]);
|
|
15
|
+
occur[val] = (occur[val] || 0) + 1;
|
|
16
|
+
}
|
|
17
|
+
return occur;
|
|
18
|
+
};
|
|
19
|
+
export var getMode = function getMode(data, accessor) {
|
|
20
|
+
var occur = getFrequency(data, accessor);
|
|
21
|
+
return Object.keys(occur).reduce(function (prev, key) {
|
|
22
|
+
return occur[prev] >= occur[key] ? prev : key;
|
|
23
|
+
}, Object.keys(occur)[0]);
|
|
24
|
+
};
|
|
25
|
+
export var countUnique = function countUnique(data) {
|
|
26
|
+
var accessor = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : identity;
|
|
27
|
+
return Object.keys(data.reduce(function (uniques, d) {
|
|
28
|
+
var val = accessor(d);
|
|
29
|
+
uniques[val] = uniques[val] || 0;
|
|
30
|
+
uniques[val] += 1;
|
|
31
|
+
return uniques;
|
|
32
|
+
}, {})).length;
|
|
33
|
+
};
|
|
34
|
+
export var percentMean = function percentMean(data, accessor) {
|
|
35
|
+
var getNumerator = accessor.getNumerator,
|
|
36
|
+
getDenominator = accessor.getDenominator;
|
|
37
|
+
var denominator = aggregate(data, AGGREGATION_TYPES.sum, getDenominator);
|
|
38
|
+
if (denominator <= 0) {
|
|
39
|
+
return 0;
|
|
40
|
+
}
|
|
41
|
+
var result = aggregate(data, AGGREGATION_TYPES.sum, getNumerator) / denominator;
|
|
42
|
+
return result;
|
|
43
|
+
};
|
|
44
|
+
export function aggregate(data, technique) {
|
|
45
|
+
var accessor = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : identity;
|
|
46
|
+
switch (technique) {
|
|
47
|
+
case AGGREGATION_TYPES.average:
|
|
48
|
+
return mean(data, accessor);
|
|
49
|
+
case 'mean_of_percent':
|
|
50
|
+
return percentMean(data, accessor);
|
|
51
|
+
case AGGREGATION_TYPES.countUnique:
|
|
52
|
+
return countUnique(data, accessor);
|
|
53
|
+
case AGGREGATION_TYPES.mode:
|
|
54
|
+
return getMode(data, accessor);
|
|
55
|
+
case AGGREGATION_TYPES.maximum:
|
|
56
|
+
return max(data, accessor);
|
|
57
|
+
case AGGREGATION_TYPES.minimum:
|
|
58
|
+
return min(data, accessor);
|
|
59
|
+
case AGGREGATION_TYPES.median:
|
|
60
|
+
return median(data, accessor);
|
|
61
|
+
case AGGREGATION_TYPES.stdev:
|
|
62
|
+
return deviation(data, accessor);
|
|
63
|
+
case AGGREGATION_TYPES.sum:
|
|
64
|
+
return sum(data, accessor);
|
|
65
|
+
case AGGREGATION_TYPES.variance:
|
|
66
|
+
return variance(data, accessor);
|
|
67
|
+
default:
|
|
68
|
+
return data.length;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
export var AGGREGATION_NAME = _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, AGGREGATION_TYPES.average, 'Average'), AGGREGATION_TYPES.countUnique, 'Number of Unique'), AGGREGATION_TYPES.mode, 'Most Often'), AGGREGATION_TYPES.maximum, 'Max'), AGGREGATION_TYPES.minimum, 'Min'), AGGREGATION_TYPES.median, 'Median'), AGGREGATION_TYPES.stdev, 'Std Deviation'), AGGREGATION_TYPES.sum, 'Total'), AGGREGATION_TYPES.variance, 'Variance');
|
|
72
|
+
|
|
73
|
+
// ratio: both denominator & numerator precent
|
|
74
|
+
// average, min, max, median,
|
|
75
|
+
//# sourceMappingURL=aggregation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"aggregation.js","names":["deviation","min","max","mean","median","sum","variance","AGGREGATION_TYPES","identity","d","getFrequency","data","accessor","arguments","length","undefined","occur","i","val","getMode","Object","keys","reduce","prev","key","countUnique","uniques","percentMean","getNumerator","getDenominator","denominator","aggregate","result","technique","average","mode","maximum","minimum","stdev","AGGREGATION_NAME","_defineProperty"],"sources":["../../src/aggregation.ts"],"sourcesContent":["// SPDX-License-Identifier: MIT\n// Copyright contributors to the kepler.gl project\n\nimport {deviation, min, max, mean, median, sum, variance} from 'd3-array';\nimport {ValueOf} from '@kepler.gl/types';\nimport {AGGREGATION_TYPES, AggregationTypes} from '@kepler.gl/constants';\nconst identity = d => d;\n\nexport const getFrequency = (\n data: any[],\n accessor: (any: any) => any = identity\n): {[key: string | number]: number} => {\n const occur = {};\n for (let i = 0; i < data.length; i++) {\n const val = accessor(data[i]);\n occur[val] = (occur[val] || 0) + 1;\n }\n return occur;\n};\n\nexport const getMode = (data, accessor) => {\n const occur = getFrequency(data, accessor);\n return Object.keys(occur).reduce(\n (prev, key) => (occur[prev] >= occur[key] ? prev : key),\n Object.keys(occur)[0]\n );\n};\n\nexport const countUnique = (data, accessor = identity) => {\n return Object.keys(\n data.reduce((uniques, d) => {\n const val = accessor(d);\n uniques[val] = uniques[val] || 0;\n uniques[val] += 1;\n return uniques;\n }, {})\n ).length;\n};\n\nexport const percentMean = (data, accessor) => {\n const {getNumerator, getDenominator} = accessor;\n const denominator = aggregate(data, AGGREGATION_TYPES.sum, getDenominator);\n if (denominator <= 0) {\n return 0;\n }\n const result = aggregate(data, AGGREGATION_TYPES.sum, getNumerator) / denominator;\n return result;\n};\n\nexport function aggregate(\n data: any[],\n technique: ValueOf<AggregationTypes>,\n accessor: (any: any) => any = identity\n): any {\n switch (technique) {\n case AGGREGATION_TYPES.average:\n return mean(data, accessor);\n case 'mean_of_percent':\n return percentMean(data, accessor);\n case AGGREGATION_TYPES.countUnique:\n return countUnique(data, accessor);\n case AGGREGATION_TYPES.mode:\n return getMode(data, accessor);\n case AGGREGATION_TYPES.maximum:\n return max(data, accessor);\n case AGGREGATION_TYPES.minimum:\n return min(data, accessor);\n case AGGREGATION_TYPES.median:\n return median(data, accessor);\n case AGGREGATION_TYPES.stdev:\n return deviation(data, accessor);\n case AGGREGATION_TYPES.sum:\n return sum(data, accessor);\n case AGGREGATION_TYPES.variance:\n return variance(data, accessor);\n default:\n return data.length;\n }\n}\n\nexport const AGGREGATION_NAME: {\n [key: string]: string;\n} = {\n [AGGREGATION_TYPES.average]: 'Average',\n [AGGREGATION_TYPES.countUnique]: 'Number of Unique',\n [AGGREGATION_TYPES.mode]: 'Most Often',\n [AGGREGATION_TYPES.maximum]: 'Max',\n [AGGREGATION_TYPES.minimum]: 'Min',\n [AGGREGATION_TYPES.median]: 'Median',\n [AGGREGATION_TYPES.stdev]: 'Std Deviation',\n [AGGREGATION_TYPES.sum]: 'Total',\n [AGGREGATION_TYPES.variance]: 'Variance'\n};\n\n// ratio: both denominator & numerator precent\n// average, min, max, median,\n"],"mappings":";AAAA;AACA;;AAEA,SAAQA,SAAS,EAAEC,GAAG,EAAEC,GAAG,EAAEC,IAAI,EAAEC,MAAM,EAAEC,GAAG,EAAEC,QAAQ,QAAO,UAAU;AAEzE,SAAQC,iBAAiB,QAAyB,sBAAsB;AACxE,IAAMC,QAAQ,GAAG,SAAXA,QAAQA,CAAGC,CAAC;EAAA,OAAIA,CAAC;AAAA;AAEvB,OAAO,IAAMC,YAAY,GAAG,SAAfA,YAAYA,CACvBC,IAAW,EAE0B;EAAA,IADrCC,QAA2B,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAGL,QAAQ;EAEtC,IAAMQ,KAAK,GAAG,CAAC,CAAC;EAChB,KAAK,IAAIC,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGN,IAAI,CAACG,MAAM,EAAEG,CAAC,EAAE,EAAE;IACpC,IAAMC,GAAG,GAAGN,QAAQ,CAACD,IAAI,CAACM,CAAC,CAAC,CAAC;IAC7BD,KAAK,CAACE,GAAG,CAAC,GAAG,CAACF,KAAK,CAACE,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC;EACpC;EACA,OAAOF,KAAK;AACd,CAAC;AAED,OAAO,IAAMG,OAAO,GAAG,SAAVA,OAAOA,CAAIR,IAAI,EAAEC,QAAQ,EAAK;EACzC,IAAMI,KAAK,GAAGN,YAAY,CAACC,IAAI,EAAEC,QAAQ,CAAC;EAC1C,OAAOQ,MAAM,CAACC,IAAI,CAACL,KAAK,CAAC,CAACM,MAAM,CAC9B,UAACC,IAAI,EAAEC,GAAG;IAAA,OAAMR,KAAK,CAACO,IAAI,CAAC,IAAIP,KAAK,CAACQ,GAAG,CAAC,GAAGD,IAAI,GAAGC,GAAG;EAAA,CAAC,EACvDJ,MAAM,CAACC,IAAI,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G,KAAK,GACjC7B,iBAAiB,CAAC8B,OAAO,EAAG,KAAK,GACjC9B,iBAAiB,CAACH,MAAM,EAAG,QAAQ,GACnCG,iBAAiB,CAAC+B,KAAK,EAAG,eAAe,GACzC/B,iBAAiB,CAACF,GAAG,EAAG,OAAO,GAC/BE,iBAAiB,CAACD,QAAQ,EAAG,UAAU,CACzC;;AAED;AACA","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"application-config-types.js","names":[],"sources":["../../src/application-config-types.ts"],"sourcesContent":["// SPDX-License-Identifier: MIT\n// Copyright contributors to the kepler.gl project\n\nimport * as arrow from 'apache-arrow';\n\nexport interface DatabaseConnection {\n query(statement: string): Promise<arrow.Table>;\n insertArrowTable(arrowTable: arrow.Table, {name}: {name: string}): Promise<void>;\n close();\n}\n\nexport interface DatabaseAdapter {\n connect(): Promise<DatabaseConnection>;\n registerFileText(name: string, text: string): Promise<void>;\n registerFileHandle(name: string, handle: any, protocol: number, directIO: boolean): Promise<void>;\n}\n"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MIT
|
|
2
|
+
// Copyright contributors to the kepler.gl project
|
|
3
|
+
|
|
4
|
+
import { KEPLER_UNFOLDED_BUCKET } from '@kepler.gl/constants';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Represents a custom SVG icon that can be used in the icon layer.
|
|
8
|
+
* The mesh describes the icon's geometry as triangulated SVG paths.
|
|
9
|
+
*
|
|
10
|
+
* Important: Triangle cells must use counter-clockwise (CCW) winding order.
|
|
11
|
+
* Positions should be in the range [-1, 1] on both axes.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Detect if running with webpack build tool
|
|
16
|
+
*/
|
|
17
|
+
function isWebpackBuild() {
|
|
18
|
+
// @ts-ignore - __webpack_require__ is injected by webpack at runtime
|
|
19
|
+
return typeof __webpack_require__ !== 'undefined';
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* A mechanism to override default Kepler values/settings so that we
|
|
24
|
+
* without having to make application-specific changes to the kepler repo.
|
|
25
|
+
*/
|
|
26
|
+
/**
|
|
27
|
+
* Controls which Redux actions are suppressed by the dev-mode Redux logger.
|
|
28
|
+
* Mirrors the `log.level` convention used by luma.gl / deck.gl.
|
|
29
|
+
*
|
|
30
|
+
* - `0` — log every action (no filtering)
|
|
31
|
+
* - `1` — suppress the highest-frequency UI noise:
|
|
32
|
+
* MOUSE_MOVE, LAYER_HOVER, SET_MAP_BOUNDARY, SET_LOADING_INDICATOR,
|
|
33
|
+
* SET_LOADING_PROGRESS
|
|
34
|
+
* - `2` — suppress everything in level 1 plus map/layer update chatter:
|
|
35
|
+
* LOAD_MAP_STYLES, UPDATE_MAP, LAYER_VISUAL_CHANGE,
|
|
36
|
+
* ON_MAP_CLICK, FILTER_CHANGE, MAP_LOAD_STARTED
|
|
37
|
+
*
|
|
38
|
+
* Effects by context:
|
|
39
|
+
* - **redux-logger** (console output): only active when `NODE_ENV === 'local'` (i.e. `yarn start`)
|
|
40
|
+
* - **Redux DevTools** (`actionsBlacklist`): active whenever the browser extension is present,
|
|
41
|
+
* regardless of `NODE_ENV`
|
|
42
|
+
*
|
|
43
|
+
* Default: `1`
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* ```ts
|
|
47
|
+
* initApplicationConfig({ reduxLogLevel: 2 }); // quieter dev console
|
|
48
|
+
* initApplicationConfig({ reduxLogLevel: 0 }); // see every action
|
|
49
|
+
* ```
|
|
50
|
+
*/
|
|
51
|
+
|
|
52
|
+
/** Built-in file formats that can be listed in {@link KeplerApplicationConfig.acceptedFileFormats}. */
|
|
53
|
+
|
|
54
|
+
var DEFAULT_APPLICATION_CONFIG = {
|
|
55
|
+
defaultHtmlName: 'kepler.gl.html',
|
|
56
|
+
defaultImageName: 'kepler.gl.png',
|
|
57
|
+
defaultJsonName: 'kepler.gl.json',
|
|
58
|
+
defaultDataName: 'kepler.gl',
|
|
59
|
+
defaultExportJsonSettings: {
|
|
60
|
+
hasData: true
|
|
61
|
+
},
|
|
62
|
+
enableCustomExportBranding: true,
|
|
63
|
+
baseMapLibraryConfig: {
|
|
64
|
+
maplibre: {
|
|
65
|
+
getMapLib: function getMapLib() {
|
|
66
|
+
return import('maplibre-gl');
|
|
67
|
+
},
|
|
68
|
+
mapLibCssClass: 'maplibregl',
|
|
69
|
+
mapLibAttributionCssClass: 'maplibre-attribution-container',
|
|
70
|
+
mapLibName: 'MapLibre',
|
|
71
|
+
mapLibUrl: 'https://www.maplibre.org/'
|
|
72
|
+
},
|
|
73
|
+
mapbox: {
|
|
74
|
+
getMapLib: function getMapLib() {
|
|
75
|
+
return import('mapbox-gl');
|
|
76
|
+
},
|
|
77
|
+
mapLibCssClass: 'mapboxgl',
|
|
78
|
+
mapLibAttributionCssClass: 'mapbox-attribution-container',
|
|
79
|
+
mapLibName: 'Mapbox',
|
|
80
|
+
mapLibUrl: 'https://www.mapbox.com/'
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
cdnUrl: KEPLER_UNFOLDED_BUCKET,
|
|
84
|
+
plugins: [],
|
|
85
|
+
// The default table class is KeplerTable.
|
|
86
|
+
// TODO include KeplerTable here when the circular dependency with @kepler.gl/table and @kepler.gl/utils are resolved.
|
|
87
|
+
table: null,
|
|
88
|
+
database: null,
|
|
89
|
+
useArrowProgressiveLoading: false,
|
|
90
|
+
useOnFilteredItemsChange: false,
|
|
91
|
+
// Raster Tile layer config
|
|
92
|
+
enableRasterTileLayer: true,
|
|
93
|
+
rasterServerUseLatestTitiler: true,
|
|
94
|
+
rasterServerShowServerInput: true,
|
|
95
|
+
rasterServerUrls: [],
|
|
96
|
+
// TODO: provide a default free server or leave blank
|
|
97
|
+
rasterServerSupportsElevation: true,
|
|
98
|
+
rasterServerMaxRetries: 1,
|
|
99
|
+
rasterServerRetryDelay: 10000,
|
|
100
|
+
rasterServerServerErrorsToRetry: [503],
|
|
101
|
+
rasterServerMaxPerServerRequests: 0,
|
|
102
|
+
// WMS layer config
|
|
103
|
+
enableWMSLayer: true,
|
|
104
|
+
// Zarr layer config -- experimental, disable via initApplicationConfig
|
|
105
|
+
enableZarrLayer: true,
|
|
106
|
+
// Flow layer config
|
|
107
|
+
enableFlowLayer: true,
|
|
108
|
+
// Bitmap layer config
|
|
109
|
+
enableBitmapLayer: true,
|
|
110
|
+
// A5 layer config
|
|
111
|
+
enableA5Layer: true,
|
|
112
|
+
// GeoHash layer config
|
|
113
|
+
enableGeohashLayer: true,
|
|
114
|
+
// Flow Field layer config
|
|
115
|
+
enableFlowFieldLayer: true,
|
|
116
|
+
// Contour layer config -- disable via initApplicationConfig
|
|
117
|
+
enableContourLayer: true,
|
|
118
|
+
// Voronoi Mosaic layer config -- disable via initApplicationConfig
|
|
119
|
+
enableVoronoiLayer: true,
|
|
120
|
+
// Donut layer config -- disable via initApplicationConfig
|
|
121
|
+
enableDonutLayer: true,
|
|
122
|
+
showInlineTilesetExamples: true,
|
|
123
|
+
// Image export config
|
|
124
|
+
// Default to true for webpack builds, false for other build tools (e.g., Vite)
|
|
125
|
+
escapeXhtmlForWebpack: isWebpackBuild(),
|
|
126
|
+
maxPitch: 60,
|
|
127
|
+
enableMapRepeat: false,
|
|
128
|
+
enableAnnotations: true,
|
|
129
|
+
enableDrawOnMapSketches: true,
|
|
130
|
+
enableMapNavigationControl: true,
|
|
131
|
+
enableMapScale: true,
|
|
132
|
+
enableFitBoundsOnManualLayer: true,
|
|
133
|
+
enableSwipeMode: true,
|
|
134
|
+
enableGlobeView: true,
|
|
135
|
+
enableLayerGroups: true,
|
|
136
|
+
themes: [],
|
|
137
|
+
enableColumnStats: true,
|
|
138
|
+
enableDatasetOps: true,
|
|
139
|
+
enableChartsPanel: true,
|
|
140
|
+
enableMapInfo: true,
|
|
141
|
+
enableCameraBookmarks: true,
|
|
142
|
+
enableCameraTour: true,
|
|
143
|
+
enableJsonEditors: true,
|
|
144
|
+
enableLayerJsonEditor: true,
|
|
145
|
+
enableFilterJsonEditor: true,
|
|
146
|
+
enableEffectJsonEditor: true,
|
|
147
|
+
enableViewportJsonEditor: false,
|
|
148
|
+
enableAnimationJsonEditor: true,
|
|
149
|
+
enableChartJsonEditor: true,
|
|
150
|
+
enableRemoteFileFormatSelector: false,
|
|
151
|
+
largeDatasetWarningRows: 500000,
|
|
152
|
+
largeDatasetWarningBytes: 1024 * 1024 * 1024,
|
|
153
|
+
acceptedFileFormats: null,
|
|
154
|
+
customIcons: [],
|
|
155
|
+
customIconUrl: '',
|
|
156
|
+
reduxLogLevel: 1,
|
|
157
|
+
maxArrowBatches: 1
|
|
158
|
+
};
|
|
159
|
+
var applicationConfig = DEFAULT_APPLICATION_CONFIG;
|
|
160
|
+
export var getApplicationConfig = function getApplicationConfig() {
|
|
161
|
+
return applicationConfig;
|
|
162
|
+
};
|
|
163
|
+
export function initApplicationConfig() {
|
|
164
|
+
var appConfig = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
165
|
+
Object.assign(applicationConfig, appConfig);
|
|
166
|
+
}
|
|
167
|
+
//# sourceMappingURL=application-config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"application-config.js","names":["KEPLER_UNFOLDED_BUCKET","isWebpackBuild","__webpack_require__","DEFAULT_APPLICATION_CONFIG","defaultHtmlName","defaultImageName","defaultJsonName","defaultDataName","defaultExportJsonSettings","hasData","enableCustomExportBranding","baseMapLibraryConfig","maplibre","getMapLib","mapLibCssClass","mapLibAttributionCssClass","mapLibName","mapLibUrl","mapbox","cdnUrl","plugins","table","database","useArrowProgressiveLoading","useOnFilteredItemsChange","enableRasterTileLayer","rasterServerUseLatestTitiler","rasterServerShowServerInput","rasterServerUrls","rasterServerSupportsElevation","rasterServerMaxRetries","rasterServerRetryDelay","rasterServerServerErrorsToRetry","rasterServerMaxPerServerRequests","enableWMSLayer","enableZarrLayer","enableFlowLayer","enableBitmapLayer","enableA5Layer","enableGeohashLayer","enableFlowFieldLayer","enableContourLayer","enableVoronoiLayer","enableDonutLayer","showInlineTilesetExamples","escapeXhtmlForWebpack","maxPitch","enableMapRepeat","enableAnnotations","enableDrawOnMapSketches","enableMapNavigationControl","enableMapScale","enableFitBoundsOnManualLayer","enableSwipeMode","enableGlobeView","enableLayerGroups","themes","enableColumnStats","enableDatasetOps","enableChartsPanel","enableMapInfo","enableCameraBookmarks","enableCameraTour","enableJsonEditors","enableLayerJsonEditor","enableFilterJsonEditor","enableEffectJsonEditor","enableViewportJsonEditor","enableAnimationJsonEditor","enableChartJsonEditor","enableRemoteFileFormatSelector","largeDatasetWarningRows","largeDatasetWarningBytes","acceptedFileFormats","customIcons","customIconUrl","reduxLogLevel","maxArrowBatches","applicationConfig","getApplicationConfig","initApplicationConfig","appConfig","arguments","length","undefined","Object","assign"],"sources":["../../src/application-config.ts"],"sourcesContent":["// SPDX-License-Identifier: MIT\n// Copyright contributors to the kepler.gl project\n\nimport type {MapLib, MapRef} from 'react-map-gl/mapbox-legacy';\n\nimport {KEPLER_UNFOLDED_BUCKET} from '@kepler.gl/constants';\nimport type {BaseMapLibraryType} from '@kepler.gl/constants';\n\nimport type {DatabaseAdapter} from './application-config-types';\n\n/**\n * Represents a custom SVG icon that can be used in the icon layer.\n * The mesh describes the icon's geometry as triangulated SVG paths.\n *\n * Important: Triangle cells must use counter-clockwise (CCW) winding order.\n * Positions should be in the range [-1, 1] on both axes.\n */\nexport type SvgIcon = {\n /** Unique identifier for the icon, used as the value in the data's icon column */\n id: string;\n /** Triangulated SVG path geometry */\n mesh: {\n /** Triangle cell indices referencing positions (CCW winding order) */\n cells: [number, number, number][];\n /** Vertex positions [x, y, z] in range [-1, 1] */\n positions: [number, number, number][];\n };\n};\n\n/**\n * Detect if running with webpack build tool\n */\nfunction isWebpackBuild(): boolean {\n // @ts-ignore - __webpack_require__ is injected by webpack at runtime\n return typeof __webpack_require__ !== 'undefined';\n}\n\nexport type MapLibInstance = MapLib;\nexport type GetMapRef = ReturnType<MapRef['getMap']>;\n\nexport type BaseMapLibraryConfig = {\n getMapLib: () => Promise<MapLibInstance>;\n mapLibAttributionCssClass: string;\n mapLibCssClass: string;\n mapLibName: string;\n mapLibUrl: string;\n};\n\n/**\n * A mechanism to override default Kepler values/settings so that we\n * without having to make application-specific changes to the kepler repo.\n */\n/**\n * Controls which Redux actions are suppressed by the dev-mode Redux logger.\n * Mirrors the `log.level` convention used by luma.gl / deck.gl.\n *\n * - `0` — log every action (no filtering)\n * - `1` — suppress the highest-frequency UI noise:\n * MOUSE_MOVE, LAYER_HOVER, SET_MAP_BOUNDARY, SET_LOADING_INDICATOR,\n * SET_LOADING_PROGRESS\n * - `2` — suppress everything in level 1 plus map/layer update chatter:\n * LOAD_MAP_STYLES, UPDATE_MAP, LAYER_VISUAL_CHANGE,\n * ON_MAP_CLICK, FILTER_CHANGE, MAP_LOAD_STARTED\n *\n * Effects by context:\n * - **redux-logger** (console output): only active when `NODE_ENV === 'local'` (i.e. `yarn start`)\n * - **Redux DevTools** (`actionsBlacklist`): active whenever the browser extension is present,\n * regardless of `NODE_ENV`\n *\n * Default: `1`\n *\n * @example\n * ```ts\n * initApplicationConfig({ reduxLogLevel: 2 }); // quieter dev console\n * initApplicationConfig({ reduxLogLevel: 0 }); // see every action\n * ```\n */\nexport type ReduxLogLevel = 0 | 1 | 2;\n\n/** Built-in file formats that can be listed in {@link KeplerApplicationConfig.acceptedFileFormats}. */\nexport type KeplerAcceptedFileFormat =\n | 'csv'\n | 'tsv'\n | 'dsv'\n | 'json'\n | 'geojson'\n | 'ndjson'\n | 'jsonl'\n | 'geojsonl'\n | 'ndgeojson'\n | 'ldgeojson'\n | 'kml'\n | 'gpx'\n | 'tcx'\n | 'arrow'\n | 'feather'\n | 'parquet'\n | 'shp'\n | 'shapefile'\n | 'zip'\n | 'dbf'\n | 'shx'\n | 'prj'\n | 'cpg'\n | 'xlsx'\n | 'xls'\n | 'xlsm'\n | 'xlsb'\n | 'excel'\n | 'fgb'\n | 'flatgeobuf';\n\nexport type KeplerApplicationConfig = {\n /** Default name of export HTML file, can be overridden by user */\n defaultHtmlName?: string;\n defaultImageName?: string;\n defaultJsonName?: string;\n defaultDataName?: string;\n defaultExportJsonSettings?: {\n hasData?: boolean;\n };\n /**\n * Whether to show editable application name and website controls for exported maps.\n * Enabled by default.\n */\n enableCustomExportBranding?: boolean;\n baseMapLibraryConfig?: Record<BaseMapLibraryType, BaseMapLibraryConfig>;\n plugins?: any[];\n // KeplerTable alternative\n // TODO improve typing by exporting KeplerTable interface to @kepler.gl/types\n table?: any;\n database?: DatabaseAdapter | null;\n\n // Disable progressive loading for arrow files\n useArrowProgressiveLoading?: boolean;\n // Use the onFilteredItemsChange callback for DataFilterExtension.\n // Enabling this option may cause performance issues when dealing with a large number of layers or sublayers,\n // especially if large Arrow files are split into relatively small batches (should be fixed in the future).\n useOnFilteredItemsChange?: boolean;\n\n // A URL to the CDN where the kepler.gl assets are hosted.\n cdnUrl?: string;\n\n // Raster Tile layer config\n // Raster Tile layer is under development and not ready for production use. Disabled by default.\n enableRasterTileLayer?: boolean;\n /** Whether to use Titiler v0.21 API endpoints instead of v0.11 */\n rasterServerUseLatestTitiler?: boolean;\n /** An array of URLs to shards of the raster tile server to be used by the raster tile layer. */\n rasterServerUrls?: string[];\n /** If true then try to fetch quantized elevation meshes from raster servers */\n rasterServerSupportsElevation?: boolean;\n /** How many times to retry a request if case of rasterServerServerErrorsToRetry errors */\n rasterServerMaxRetries?: number;\n /** How long between retries */\n rasterServerRetryDelay?: number;\n /** An array of HTTP status codes that should be retried when encountered. */\n rasterServerServerErrorsToRetry?: number[];\n /** Maximum number of simultaneous requests per raster server. 0 - no limit */\n rasterServerMaxPerServerRequests?: number;\n /** Whether to show the server input field in the raster tile layer setup form */\n rasterServerShowServerInput?: boolean;\n\n // WMS layer config -- Experimental\n // WMS layer is under development and not ready for production use. Disabled by default.\n enableWMSLayer?: boolean;\n\n // Zarr layer config -- Experimental\n // Enabled by default. Set false to hide Zarr in Add Data and layer type pickers.\n // Existing Zarr layers in saved maps can still render.\n enableZarrLayer?: boolean;\n\n // Flow layer config\n enableFlowLayer?: boolean;\n\n // Bitmap layer config\n enableBitmapLayer?: boolean;\n\n // A5 layer config\n // A5 DGGS layer is optional. Disabled by default; enable via initApplicationConfig.\n enableA5Layer?: boolean;\n\n // GeoHash layer config\n // GeoHash layer is optional. Enabled by default; disable via initApplicationConfig.\n enableGeohashLayer?: boolean;\n\n // Flow Field (streamlines) layer config\n enableFlowFieldLayer?: boolean;\n\n // Contour layer config -- Experimental\n // Enabled by default. Set false to hide Contour in layer type pickers.\n // Existing Contour layers in saved maps can still render.\n enableContourLayer?: boolean;\n\n // Voronoi Mosaic layer config\n // Enabled by default. Set false to hide Voronoi in layer type pickers.\n // Existing Voronoi layers in saved maps can still render.\n enableVoronoiLayer?: boolean;\n\n // Donut layer config\n // Enabled by default. Set false to hide Donut in layer type pickers.\n // Existing Donut layers in saved maps can still render.\n enableDonutLayer?: boolean;\n\n /** Whether to show example URLs in tileset setup forms (vector tile, raster tile, WMS, 3D tile) */\n showInlineTilesetExamples?: boolean;\n\n // Image export config\n /** Whether to apply fix for uglify error in dom-to-image (should be true for webpack builds, false for Vite) */\n escapeXhtmlForWebpack?: boolean;\n\n /** Maximum pitch angle in degrees. deck.gl defaults to 60; set higher (up to 85) for elevated perspectives.\n * Note: values above 60 may cause rendering artifacts with some basemap tile providers. */\n maxPitch?: number;\n\n /**\n * Draw flat-map layers on every visible world copy. Disabled by default because\n * each copy adds rendering and picking work. With it disabled, layers can be\n * missing on adjacent world copies across the antimeridian. Enable with\n * `initApplicationConfig({enableMapRepeat: true})`.\n */\n enableMapRepeat?: boolean;\n\n /** Whether to enable the annotations feature. Enabled by default. */\n enableAnnotations?: boolean;\n\n /**\n * Whether to enable extended Draw on Map sketch tools: Point, Line, Copy all,\n * Convert to Layer, and Edit Properties.\n * Polygon and rectangle drawing remain available when this is disabled. Enabled by default.\n */\n enableDrawOnMapSketches?: boolean;\n\n /** Whether to show the map navigation control (zoom buttons and compass). Enabled by default. */\n enableMapNavigationControl?: boolean;\n\n /** Whether to show the map scale bar at the bottom-left of the map. Enabled by default. */\n enableMapScale?: boolean;\n\n /**\n * Fit the map to a dataset when the layer type dropdown gives a manually\n * added layer its first type. The layer already has a dataset (chosen from\n * Add Layer). Programmatic `layerTypeChange`, saved configs, and later type\n * changes do not move the map.\n * Enabled by default. Disable with {@link initApplicationConfig}.\n *\n * @example\n * ```\n * initApplicationConfig({enableFitBoundsOnManualLayer: false});\n * ```\n */\n enableFitBoundsOnManualLayer?: boolean;\n\n /** Whether to enable the swipe compare mode in split map view. Enabled by default. */\n enableSwipeMode?: boolean;\n\n /** Whether to show the option to switch to the globe view. Enabled by default. */\n enableGlobeView?: boolean;\n\n /** Whether to enable the layer groups feature. Enabled by default. */\n enableLayerGroups?: boolean;\n\n /**\n * Named UI themes to cycle (`dark`, `light`, `space`, `base`).\n * Empty (default): dark theme, no switcher.\n * One theme: that theme is used, no switcher.\n * Two or more: first is the default, a map control cycles the list.\n */\n themes?: string[];\n\n /** Whether to show column statistics in the data table modal. Enabled by default. */\n enableColumnStats?: boolean;\n\n /** Group-by, attribute join, and simple spatial join UI on local datasets. Enabled by default. */\n enableDatasetOps?: boolean;\n\n /**\n * Whether to show the charts map-control panel (big number, bar, line,\n * heatmap, pivot table, tooltip charts, and chart cross-filters).\n * Enabled by default. Disable with {@link initApplicationConfig}.\n */\n enableChartsPanel?: boolean;\n\n /**\n * Whether to show the Map info section in Interactions and the on-map\n * name and description card. Enabled by default.\n */\n enableMapInfo?: boolean;\n\n /** Whether to show the Bookmarks panel in Interactions. Enabled by default. */\n enableCameraBookmarks?: boolean;\n\n /** Whether to show the Camera animation panel in Interactions. Enabled by default. */\n enableCameraTour?: boolean;\n\n /**\n * Master switch for power-user JSON editors. When false, every section editor is hidden.\n * Defaults to true; each section also has its own flag.\n *\n * @example\n * ```\n * initApplicationConfig({\n * enableViewportJsonEditor: true,\n * enableLayerJsonEditor: false\n * });\n * ```\n */\n enableJsonEditors?: boolean;\n\n /** Layer panel `{ }` JSON editor. Enabled by default. */\n enableLayerJsonEditor?: boolean;\n\n /** Filter panel `{ }` JSON editor. Enabled by default. */\n enableFilterJsonEditor?: boolean;\n\n /** Effect panel `{ }` JSON editor. Enabled by default. */\n enableEffectJsonEditor?: boolean;\n\n /**\n * Viewport JSON editor map-control button. Disabled by default because it adds an extra\n * map control.\n */\n enableViewportJsonEditor?: boolean;\n\n /** Animation / time-filter playback `{ }` JSON editor. Enabled by default. */\n enableAnimationJsonEditor?: boolean;\n\n /** Charts panel `{ }` JSON editor. Enabled by default. */\n enableChartJsonEditor?: boolean;\n\n /**\n * Show a format dropdown next to the remote dataset URL field (Auto / CSV / GeoJSON / JSON / Arrow / Parquet).\n * Useful for extensionless URLs such as Azure SAS blobs. Disabled by default.\n */\n enableRemoteFileFormatSelector?: boolean;\n\n /**\n * Warn in the Add Data list when a dataset has at least this many rows.\n * `false` shows no warning. The warning waits until the row count is known.\n *\n * @example\n * ```\n * initApplicationConfig({largeDatasetWarningRows: 1_000_000});\n * initApplicationConfig({largeDatasetWarningRows: false});\n * ```\n */\n largeDatasetWarningRows?: false | number;\n\n /**\n * Warn in the Add Data list when a file is at least this many bytes.\n * `false` shows no file-size warning. Either this or {@link largeDatasetWarningRows}\n * can show the same tag.\n *\n * @example\n * ```\n * initApplicationConfig({largeDatasetWarningBytes: 50 * 1024 * 1024});\n * initApplicationConfig({largeDatasetWarningBytes: false});\n * ```\n */\n largeDatasetWarningBytes?: false | number;\n\n /**\n * File formats Kepler may load from drag-and-drop, the file picker, and remote URLs.\n * Values are format ids or extensions (`csv`, `geojson`, `kml`, `shp`, `xlsx`, `fgb`, …).\n * When omitted or `null`, every built-in format is accepted.\n *\n * @example\n * ```\n * initApplicationConfig({acceptedFileFormats: ['csv', 'geojson', 'parquet']});\n * ```\n */\n acceptedFileFormats?: KeplerAcceptedFileFormat[] | null;\n\n /**\n * Custom SVG icons to be made available in the icon layer.\n * These icons will be merged with the default icons fetched from CDN.\n * Each icon must have a unique `id` and a `mesh` describing its triangulated geometry.\n *\n * @example\n * ```\n * initApplicationConfig({\n * customIcons: [\n * {\n * id: 'my-custom-marker',\n * mesh: {\n * cells: [[0, 1, 2], [2, 3, 0]],\n * positions: [[0, 1, 0], [1, -1, 0], [-1, -1, 0], [0, 0, 0]]\n * }\n * }\n * ]\n * });\n * ```\n */\n customIcons?: SvgIcon[];\n\n /**\n * URL to a remote JSON file containing custom SVG icons.\n * The JSON file should have the format: `{ \"svgIcons\": [{ id, mesh: { cells, positions } }, ...] }`\n * Icons from this URL will be merged with default CDN icons and inline `customIcons`.\n *\n * @example\n * ```\n * initApplicationConfig({\n * customIconUrl: 'https://my-server.com/my-icons.json'\n * });\n * ```\n */\n customIconUrl?: string;\n\n /** Controls Redux action logging verbosity in dev mode. See {@link ReduxLogLevel}. */\n reduxLogLevel?: ReduxLogLevel;\n\n /**\n * If an Arrow/Parquet table has more record batches than this, they are\n * compacted into a single batch. The default is `1`, so any table with more\n * than one record batch is compacted. Deck.gl picking supports at most 255\n * pickable leaf layers, and GeoJSON adds fill/stroke/point sublayers per\n * batch, so a higher cap still overruns picking. Compacting copies the table.\n * Progressive Arrow loading skips compaction on intermediate batches and\n * compacts the completed file once. Set a very large number to never compact.\n *\n * @example\n * ```\n * initApplicationConfig({maxArrowBatches: 64});\n * ```\n */\n maxArrowBatches?: number;\n};\n\nconst DEFAULT_APPLICATION_CONFIG: Required<KeplerApplicationConfig> = {\n defaultHtmlName: 'kepler.gl.html',\n defaultImageName: 'kepler.gl.png',\n defaultJsonName: 'kepler.gl.json',\n defaultDataName: 'kepler.gl',\n defaultExportJsonSettings: {\n hasData: true\n },\n enableCustomExportBranding: true,\n\n baseMapLibraryConfig: {\n maplibre: {\n getMapLib: () => import('maplibre-gl') as unknown as Promise<MapLibInstance>,\n mapLibCssClass: 'maplibregl',\n mapLibAttributionCssClass: 'maplibre-attribution-container',\n mapLibName: 'MapLibre',\n mapLibUrl: 'https://www.maplibre.org/'\n },\n mapbox: {\n getMapLib: () => import('mapbox-gl'),\n mapLibCssClass: 'mapboxgl',\n mapLibAttributionCssClass: 'mapbox-attribution-container',\n mapLibName: 'Mapbox',\n mapLibUrl: 'https://www.mapbox.com/'\n }\n },\n\n cdnUrl: KEPLER_UNFOLDED_BUCKET,\n\n plugins: [],\n // The default table class is KeplerTable.\n // TODO include KeplerTable here when the circular dependency with @kepler.gl/table and @kepler.gl/utils are resolved.\n table: null,\n database: null,\n\n useArrowProgressiveLoading: false,\n useOnFilteredItemsChange: false,\n\n // Raster Tile layer config\n enableRasterTileLayer: true,\n rasterServerUseLatestTitiler: true,\n rasterServerShowServerInput: true,\n rasterServerUrls: [], // TODO: provide a default free server or leave blank\n rasterServerSupportsElevation: true,\n rasterServerMaxRetries: 1,\n rasterServerRetryDelay: 10000,\n rasterServerServerErrorsToRetry: [503],\n rasterServerMaxPerServerRequests: 0,\n\n // WMS layer config\n enableWMSLayer: true,\n\n // Zarr layer config -- experimental, disable via initApplicationConfig\n enableZarrLayer: true,\n\n // Flow layer config\n enableFlowLayer: true,\n\n // Bitmap layer config\n enableBitmapLayer: true,\n\n // A5 layer config\n enableA5Layer: true,\n\n // GeoHash layer config\n enableGeohashLayer: true,\n\n // Flow Field layer config\n enableFlowFieldLayer: true,\n\n // Contour layer config -- disable via initApplicationConfig\n enableContourLayer: true,\n\n // Voronoi Mosaic layer config -- disable via initApplicationConfig\n enableVoronoiLayer: true,\n\n // Donut layer config -- disable via initApplicationConfig\n enableDonutLayer: true,\n\n showInlineTilesetExamples: true,\n\n // Image export config\n // Default to true for webpack builds, false for other build tools (e.g., Vite)\n escapeXhtmlForWebpack: isWebpackBuild(),\n\n maxPitch: 60,\n\n enableMapRepeat: false,\n\n enableAnnotations: true,\n\n enableDrawOnMapSketches: true,\n\n enableMapNavigationControl: true,\n\n enableMapScale: true,\n\n enableFitBoundsOnManualLayer: true,\n\n enableSwipeMode: true,\n\n enableGlobeView: true,\n\n enableLayerGroups: true,\n\n themes: [],\n\n enableColumnStats: true,\n\n enableDatasetOps: true,\n\n enableChartsPanel: true,\n\n enableMapInfo: true,\n\n enableCameraBookmarks: true,\n\n enableCameraTour: true,\n\n enableJsonEditors: true,\n enableLayerJsonEditor: true,\n enableFilterJsonEditor: true,\n enableEffectJsonEditor: true,\n enableViewportJsonEditor: false,\n enableAnimationJsonEditor: true,\n enableChartJsonEditor: true,\n\n enableRemoteFileFormatSelector: false,\n\n largeDatasetWarningRows: 500_000,\n\n largeDatasetWarningBytes: 1024 * 1024 * 1024,\n\n acceptedFileFormats: null,\n\n customIcons: [],\n\n customIconUrl: '',\n\n reduxLogLevel: 1,\n\n maxArrowBatches: 1\n};\n\nconst applicationConfig: Required<KeplerApplicationConfig> = DEFAULT_APPLICATION_CONFIG;\n\nexport const getApplicationConfig = (): Required<KeplerApplicationConfig> => applicationConfig;\n\nexport function initApplicationConfig(appConfig: KeplerApplicationConfig = {}) {\n Object.assign(applicationConfig, appConfig);\n}\n"],"mappings":"AAAA;AACA;;AAIA,SAAQA,sBAAsB,QAAO,sBAAsB;;AAK3D;AACA;AACA;AACA;AACA;AACA;AACA;;AAaA;AACA;AACA;AACA,SAASC,cAAcA,CAAA,EAAY;EACjC;EACA,OAAO,OAAOC,mBAAmB,KAAK,WAAW;AACnD;;AAaA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA;;AA8VA,IAAMC,0BAA6D,GAAG;EACpEC,eAAe,EAAE,gBAAgB;EACjCC,gBAAgB,EAAE,eAAe;EACjCC,eAAe,EAAE,gBAAgB;EACjCC,eAAe,EAAE,WAAW;EAC5BC,yBAAyB,EAAE;IACzBC,OAAO,EAAE;EACX,CAAC;EACDC,0BAA0B,EAAE,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