@kepler.gl/utils 3.3.0-alpha.23 → 3.3.0-alpha.25

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.
@@ -81,6 +81,17 @@ export type KeplerApplicationConfig = {
81
81
  useArrowProgressiveLoading?: boolean;
82
82
  useOnFilteredItemsChange?: boolean;
83
83
  cdnUrl?: string;
84
+ /**
85
+ * Folder that Export data loads sql.js from to write GeoPackage files. It must hold
86
+ * `sql-wasm.js` and `sql-wasm.wasm` from the sql.js version kepler.gl depends on.
87
+ * Empty loads them from jsDelivr.
88
+ */
89
+ sqlJsUrl?: string;
90
+ /**
91
+ * URL of `parquet_wasm_bg.wasm` from the parquet-wasm version kepler.gl depends on,
92
+ * which Export data uses to write GeoParquet files. Empty loads it from unpkg.
93
+ */
94
+ parquetWasmUrl?: string;
84
95
  enableRasterTileLayer?: boolean;
85
96
  /** Whether to use Titiler v0.21 API endpoints instead of v0.11 */
86
97
  rasterServerUseLatestTitiler?: boolean;
@@ -92,6 +92,8 @@ var DEFAULT_APPLICATION_CONFIG = {
92
92
  }
93
93
  },
94
94
  cdnUrl: _constants.KEPLER_UNFOLDED_BUCKET,
95
+ sqlJsUrl: '',
96
+ parquetWasmUrl: '',
95
97
  plugins: [],
96
98
  // The default table class is KeplerTable.
97
99
  // TODO include KeplerTable here when the circular dependency with @kepler.gl/table and @kepler.gl/utils are resolved.
@@ -1 +1 @@
1
- {"version":3,"file":"application-config.js","names":["_constants","require","_interopRequireWildcard","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","_typeof2","has","get","set","_t","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","isWebpackBuild","__webpack_require__","DEFAULT_APPLICATION_CONFIG","defaultHtmlName","defaultImageName","defaultJsonName","defaultDataName","defaultExportJsonSettings","hasData","enableCustomExportBranding","baseMapLibraryConfig","maplibre","getMapLib","Promise","resolve","then","mapLibCssClass","mapLibAttributionCssClass","mapLibName","mapLibUrl","mapbox","cdnUrl","KEPLER_UNFOLDED_BUCKET","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","exports","initApplicationConfig","appConfig","arguments","length","undefined","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":";;;;;;;;;AAKA,IAAAA,UAAA,GAAAC,OAAA;AAA4D,SAAAC,wBAAAC,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAH,uBAAA,YAAAA,wBAAAC,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EA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AA4CD,iBAAiB;AAAA;AAEvF,SAASG,qBAAqBA,CAAA,EAA0C;EAAA,IAAzCC,SAAkC,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,CAAC,CAAC;EAC3EzF,MAAM,CAAC4F,MAAM,CAACR,iBAAiB,EAAEI,SAAS,CAAC;AAC7C","ignoreList":[]}
1
+ {"version":3,"file":"application-config.js","names":["_constants","require","_interopRequireWildcard","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","_typeof2","has","get","set","_t","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","isWebpackBuild","__webpack_require__","DEFAULT_APPLICATION_CONFIG","defaultHtmlName","defaultImageName","defaultJsonName","defaultDataName","defaultExportJsonSettings","hasData","enableCustomExportBranding","baseMapLibraryConfig","maplibre","getMapLib","Promise","resolve","then","mapLibCssClass","mapLibAttributionCssClass","mapLibName","mapLibUrl","mapbox","cdnUrl","KEPLER_UNFOLDED_BUCKET","sqlJsUrl","parquetWasmUrl","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","exports","initApplicationConfig","appConfig","arguments","length","undefined","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 * Folder that Export data loads sql.js from to write GeoPackage files. It must hold\n * `sql-wasm.js` and `sql-wasm.wasm` from the sql.js version kepler.gl depends on.\n * Empty loads them from jsDelivr.\n */\n sqlJsUrl?: string;\n /**\n * URL of `parquet_wasm_bg.wasm` from the parquet-wasm version kepler.gl depends on,\n * which Export data uses to write GeoParquet files. Empty loads it from unpkg.\n */\n parquetWasmUrl?: 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 sqlJsUrl: '',\n parquetWasmUrl: '',\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":";;;;;;;;;AAKA,IAAAA,UAAA,GAAAC,OAAA;AAA4D,SAAAC,wBAAAC,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAH,uBAAA,YAAAA,wBAAAC,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,mBAAAT,CAAA,iBAAAA,CAAA,oBAAAU,QAAA,aAAAV,CAAA,0BAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CAAAM,GAAA,CAAAZ,CAAA,GAAAM,CAAA,CAAAO,GAAA,CAAAb,CAAA,EAAAQ,CAAA,cAAAM,EAAA,IAAAd,CAAA,gBAAAc,EAAA,OAA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(isGlobeMode && isFogEffect) {
57
57
  return null;
58
58
  }
59
-
60
- // Always reset isExportMode so the flag doesn't persist from a
61
- // previous export session on reused effect instances.
62
- if (isLightingEffect || isFogEffect) {
63
- effect.deckEffect.isExportMode = Boolean(isExport);
64
- }
65
59
  var enabledInThisView = effect.isEnabled && !(isGlobeMode && isLightingEffect);
66
60
  if (enabledInThisView) {
67
61
  // deck.gl's EffectManager matches effects by id and reuses old
@@ -90,6 +84,11 @@ function computeDeckEffects(_ref) {
90
84
  // Disabling shadow on the lights avoids visual effects.
91
85
  disableLightingEffect(effect);
92
86
  }
87
+ // Reset the flag on the active lighting instance after adoption, even
88
+ // when disabled; export and the interactive maps can reuse effects.
89
+ if (isLightingEffect || isFogEffect) {
90
+ effect.deckEffect.isExportMode = Boolean(isExport);
91
+ }
93
92
  if (enabledInThisView || effect.type === _constants.LIGHT_AND_SHADOW_EFFECT.type) {
94
93
  if (effect.type === _constants.LIGHT_AND_SHADOW_EFFECT.type) {
95
94
  hasLightingShadow = true;
@@ -223,7 +222,7 @@ function updateEffect(_ref2) {
223
222
  mapState = _ref2.mapState,
224
223
  effect = _ref2.effect;
225
224
  if (effect.type === _constants.LIGHT_AND_SHADOW_EFFECT.type) {
226
- var _deckEffect$direction, _deckEffect$direction2, _deckEffect$direction3;
225
+ var _deckEffect$direction, _deckEffect$direction2, _parameters$shadowMap, _deckEffect$direction3;
227
226
  var deckEffect = effect.deckEffect;
228
227
  var parameters = effect.parameters;
229
228
 
@@ -244,6 +243,10 @@ function updateEffect(_ref2) {
244
243
  return l.shadow;
245
244
  })) !== null && _deckEffect$direction !== void 0 ? _deckEffect$direction : false;
246
245
 
246
+ // Each split map is rendered as its own Deck viewport and also reports one
247
+ // viewport to ShadowPass. Exclude it explicitly, in addition to that guard.
248
+ deckEffect.shadowMapResolution = mapState !== null && mapState !== void 0 && mapState.isSplit ? _constants.SHADOW_MAP_RESOLUTIONS.auto : (_parameters$shadowMap = parameters.shadowMapResolution) !== null && _parameters$shadowMap !== void 0 ? _parameters$shadowMap : _constants.SHADOW_MAP_RESOLUTIONS.auto;
249
+
247
250
  // Sync shadow color & intensity (not handled by deck.gl setProps)
248
251
  deckEffect.shadowColor = [].concat((0, _toConsumableArray2["default"])((0, _colorUtils.normalizeColor)(parameters.shadowColor)), [parameters.shadowIntensity]);
249
252
 
@@ -1 +1 @@
1
- {"version":3,"file":"effect-utils.js","names":["_suncalc","_interopRequireDefault","require","_cloneDeep","_constants","_commonUtils","_utils","_dataUtils","_colorUtils","_createForOfIteratorHelper","r","e","t","Symbol","iterator","Array","isArray","_unsupportedIterableToArray","length","_n","F","s","n","done","value","f","TypeError","o","a","u","call","next","_arrayLikeToArray","toString","slice","constructor","name","from","test","_lastLightingDeckEffect","computeDeckEffects","_ref","_mapState$globe","visState","mapState","isExport","hasLightingShadow","isGlobeMode","Boolean","globe","enabled","deckEffects","effectOrder","map","effectId","effect","findById","effects","deckEffect","isFogEffect","type","SURFACE_FOG_TYPE","DISTANCE_FOG_TYPE","isLightingEffect","LIGHT_AND_SHADOW_EFFECT","isExportMode","enabledInThisView","isEnabled","orphaned","cleanup","updateEffect","disableLightingEffect","filter","disableDeckLightingEffect","unshift","fixEffectOrder","exports","lightShadowEffect","find","ind","indexOf","id","splice","distanceFogEffect","targetPos","surfaceFogEffect","reorderEffectOrder","originEffectId","destinationEffectId","activeIndex","overIndex","arrayMove","isDaytime","lat","lon","timestamp","date","Date","_SunCalc$getTimes","SunCalc","getTimes","sunrise","sunset","shadow","outputUniformShadow","_iterator","directionalLights","_step","light","err","_ref2","_deckEffect$direction","_deckEffect$direction2","_deckEffect$direction3","parameters","_iterator2","_step2","some","l","shadowColor","concat","_toConsumableArray2","normalizeColor","shadowIntensity","ambientLight","intensity","ambientLightIntensity","color","ambientLightColor","timeMode","sunLight","sunLightColor","LIGHT_AND_SHADOW_EFFECT_TIME_MODES","current","now","animation","currentTime","animationConfig","filters","FILTER_TYPES","timeRange","view","FILTER_VIEW_TYPES","enlarged","syncedWithLayerTimeline","_filter$value$","_filter$value","latitude","longitude","sunLightIntensity","validateEffectParameters","arguments","undefined","effectDescription","result","cloneDeep","forEach","description","defaultValue","min","max","Object","prototype","hasOwnProperty","property","v","i","_defaultValue$i","Number","isFinite","clamp"],"sources":["../../src/effect-utils.ts"],"sourcesContent":["// SPDX-License-Identifier: MIT\n// Copyright contributors to the kepler.gl project\n\nimport SunCalc from 'suncalc';\nimport cloneDeep from 'es-toolkit/compat/cloneDeep';\n\nimport type {Effect as DeckEffect} from '@deck.gl/core';\n\nimport {\n LIGHT_AND_SHADOW_EFFECT,\n LIGHT_AND_SHADOW_EFFECT_TIME_MODES,\n FILTER_TYPES,\n FILTER_VIEW_TYPES,\n DISTANCE_FOG_TYPE,\n SURFACE_FOG_TYPE\n} from '@kepler.gl/constants';\nimport {arrayMove} from '@kepler.gl/common-utils';\nimport {MapState, Effect, EffectProps, EffectDescription} from '@kepler.gl/types';\nimport {findById} from './utils';\nimport {clamp} from './data-utils';\nimport {normalizeColor} from './color-utils';\n\n// TODO isolate types - depends on @kepler.gl/schemas\ntype VisState = any;\n\n// Retains the last LightingEffect deckEffect so we can keep it in the\n// effects array (with shadows disabled) after the user removes the\n// Light & Shadow effect from the UI. Without this, deck.gl calls\n// cleanup() which removes the shadow shader module, but existing layer\n// models still have shadow_uShadowMap bindings → texture errors.\nlet _lastLightingDeckEffect: any = null;\n\nexport function computeDeckEffects({\n visState,\n mapState,\n isExport\n}: {\n visState: VisState;\n mapState: MapState;\n isExport?: boolean;\n}): DeckEffect[] {\n // TODO: 1) deck effects per deck context 2) preserved between draws\n let hasLightingShadow = false;\n\n // Light & Shadow and both Fog effects are not supported in globe mode:\n // - Fog effects are screen-space post-processing passes that read the flat\n // MapView depth buffer and don't make sense on the sphere.\n // - Shadows are cast on the flat ground plane, not the globe surface.\n // In globe mode we drop the fog effects entirely and force the lighting\n // effect into its shadow-disabled state (kept in the array, like the normal\n // \"disabled\" path, so the shadow shader module stays registered and layer\n // models don't end up with stale shadow_uShadowMap bindings).\n const isGlobeMode = Boolean(mapState?.globe?.enabled);\n\n const deckEffects = visState.effectOrder\n .map(effectId => {\n const effect = findById(effectId)(visState.effects) as Effect | undefined;\n if (effect?.deckEffect) {\n const isFogEffect = effect.type === SURFACE_FOG_TYPE || effect.type === DISTANCE_FOG_TYPE;\n const isLightingEffect = effect.type === LIGHT_AND_SHADOW_EFFECT.type;\n\n // Globe mode: skip fog effects, and keep lighting effects only in their\n // shadow-disabled form.\n if (isGlobeMode && isFogEffect) {\n return null;\n }\n\n // Always reset isExportMode so the flag doesn't persist from a\n // previous export session on reused effect instances.\n if (isLightingEffect || isFogEffect) {\n effect.deckEffect.isExportMode = Boolean(isExport);\n }\n\n const enabledInThisView = effect.isEnabled && !(isGlobeMode && isLightingEffect);\n\n if (enabledInThisView) {\n // deck.gl's EffectManager matches effects by id and reuses old\n // instances (calling oldEffect.setProps(newEffect.props)) instead\n // of replacing them. When a lighting effect is removed and\n // re-added, the cached _lastLightingDeckEffect is the instance\n // that deck.gl will actually render with. Adopt it so that\n // parameter syncing in updateEffect targets the right object.\n if (\n !isExport &&\n effect.type === LIGHT_AND_SHADOW_EFFECT.type &&\n _lastLightingDeckEffect &&\n _lastLightingDeckEffect !== effect.deckEffect\n ) {\n const orphaned = effect.deckEffect;\n effect.deckEffect = _lastLightingDeckEffect;\n if (orphaned && typeof orphaned.cleanup === 'function') {\n orphaned.cleanup();\n }\n }\n updateEffect({visState, mapState, effect});\n } else if (effect.type === LIGHT_AND_SHADOW_EFFECT.type) {\n // Keep lighting effects in the array even when disabled to avoid\n // removing the shadow shader module. Composite layer sublayers\n // don't regenerate models when default shader modules change,\n // leaving stale pipelines with shadow_uShadowMap bindings.\n // Disabling shadow on the lights avoids visual effects.\n disableLightingEffect(effect);\n }\n if (enabledInThisView || effect.type === LIGHT_AND_SHADOW_EFFECT.type) {\n if (effect.type === LIGHT_AND_SHADOW_EFFECT.type) {\n hasLightingShadow = true;\n if (!isExport) {\n _lastLightingDeckEffect = effect.deckEffect;\n }\n }\n return effect.deckEffect;\n }\n }\n return null;\n })\n .filter(effect => effect);\n\n if (!hasLightingShadow && _lastLightingDeckEffect) {\n disableDeckLightingEffect(_lastLightingDeckEffect);\n deckEffects.unshift(_lastLightingDeckEffect);\n }\n\n return deckEffects;\n}\n\n/**\n * Always keep light & shadow effect at the top, then distance fog and\n * surface fog right after it (before other post-processing effects).\n * Both fog effects read the depth buffer from renderBuffers[0];\n * subsequent effects clear depth during their render passes, so fog\n * must run before that happens.\n */\nexport const fixEffectOrder = (effects: Effect[], effectOrder: string[]): string[] => {\n const lightShadowEffect = effects.find(effect => effect.type === LIGHT_AND_SHADOW_EFFECT.type);\n if (lightShadowEffect) {\n const ind = effectOrder.indexOf(lightShadowEffect.id);\n if (ind > 0) {\n effectOrder.splice(ind, 1);\n effectOrder.unshift(lightShadowEffect.id);\n }\n }\n\n const distanceFogEffect = effects.find(effect => effect.type === DISTANCE_FOG_TYPE);\n if (distanceFogEffect) {\n const ind = effectOrder.indexOf(distanceFogEffect.id);\n const targetPos = lightShadowEffect ? 1 : 0;\n if (ind > targetPos) {\n effectOrder.splice(ind, 1);\n effectOrder.splice(targetPos, 0, distanceFogEffect.id);\n }\n }\n\n const surfaceFogEffect = effects.find(effect => effect.type === SURFACE_FOG_TYPE);\n if (surfaceFogEffect) {\n const ind = effectOrder.indexOf(surfaceFogEffect.id);\n let targetPos = 0;\n if (lightShadowEffect) targetPos++;\n if (distanceFogEffect) targetPos++;\n if (ind > targetPos) {\n effectOrder.splice(ind, 1);\n effectOrder.splice(targetPos, 0, surfaceFogEffect.id);\n }\n }\n\n return effectOrder;\n};\n\nexport function reorderEffectOrder(\n effectOrder: string[],\n originEffectId: string,\n destinationEffectId: string\n): string[] {\n const activeIndex = effectOrder.indexOf(originEffectId);\n const overIndex = effectOrder.indexOf(destinationEffectId);\n return arrayMove(effectOrder, activeIndex, overIndex);\n}\n\n/**\n * Check if the current time is daytime at the given location\n * @param {number} lat Latitude\n * @param {number} lon Longitude\n * @param {number} timestamp Milliseconds since the Unix Epoch\n * @returns boolean\n */\nfunction isDaytime(lat, lon, timestamp) {\n const date = new Date(timestamp);\n const {sunrise, sunset} = SunCalc.getTimes(date, lat, lon);\n return date >= sunrise && date <= sunset;\n}\n\n/**\n * Disable shadow rendering on a lighting effect without removing it.\n * This keeps the shadow shader module registered and prevents stale\n * texture binding errors in composite layer sublayers.\n */\nfunction disableLightingEffect(effect: Effect) {\n const deckEffect = effect.deckEffect;\n if (!deckEffect) return;\n disableDeckLightingEffect(deckEffect);\n}\n\n/**\n * Disable shadow rendering directly on a deck.gl LightingEffect instance.\n */\nfunction disableDeckLightingEffect(deckEffect: any) {\n deckEffect.shadow = false;\n deckEffect.outputUniformShadow = false;\n for (const light of deckEffect.directionalLights || []) {\n light.shadow = false;\n }\n}\n\n/**\n * Update effect to match latest vis and map states.\n *\n * deck.gl's EffectManager compares effects by `id` and reuses the\n * existing (old) instance when a new one with the same id is supplied\n * (calling `oldEffect.setProps(newEffect.props)` instead of replacing).\n * LightingEffect.setProps only updates light sources, not shadowColor.\n * So we must sync ALL parameters here every frame to ensure the deck\n * effect always reflects the kepler-side state — even if deck.gl\n * silently swapped the instance under us.\n */\nfunction updateEffect({visState, mapState, effect}: {visState: any; mapState: any; effect: any}) {\n if (effect.type === LIGHT_AND_SHADOW_EFFECT.type) {\n const deckEffect = effect.deckEffect;\n const {parameters} = effect;\n\n // Re-enable shadow rendering in case it was previously disabled\n for (const light of deckEffect.directionalLights || []) {\n light.shadow = true;\n }\n deckEffect.shadow = deckEffect.directionalLights?.some(l => l.shadow) ?? false;\n\n // Sync shadow color & intensity (not handled by deck.gl setProps)\n deckEffect.shadowColor = [\n ...normalizeColor(parameters.shadowColor),\n parameters.shadowIntensity\n ];\n\n // Sync ambient light\n if (deckEffect.ambientLight) {\n deckEffect.ambientLight.intensity = parameters.ambientLightIntensity;\n deckEffect.ambientLight.color = parameters.ambientLightColor.slice();\n }\n\n let {timestamp} = parameters;\n const {timeMode} = parameters;\n const sunLight = deckEffect.directionalLights?.[0];\n if (sunLight) {\n sunLight.color = parameters.sunLightColor.slice();\n }\n\n // set timestamp for shadow\n if (timeMode === LIGHT_AND_SHADOW_EFFECT_TIME_MODES.current) {\n timestamp = Date.now();\n } else if (timeMode === LIGHT_AND_SHADOW_EFFECT_TIME_MODES.animation) {\n const {currentTime} = visState.animationConfig;\n timestamp = currentTime ?? 0;\n // Zero is a valid animation time, not a reason to fall back to a filter.\n if (!timestamp && currentTime !== 0) {\n const filter = visState.filters.find(\n filter =>\n filter.type === FILTER_TYPES.timeRange &&\n (filter.view === FILTER_VIEW_TYPES.enlarged || filter.syncedWithLayerTimeline)\n );\n if (filter) {\n timestamp = filter.value?.[0] ?? 0;\n }\n }\n }\n // A preview clone may adopt the retained deck effect, including in pick mode.\n if (sunLight) sunLight.timestamp = timestamp;\n\n // output uniform shadow during nighttime\n if (isDaytime(mapState.latitude, mapState.longitude, timestamp)) {\n deckEffect.outputUniformShadow = false;\n if (sunLight) sunLight.intensity = parameters.sunLightIntensity;\n } else {\n deckEffect.outputUniformShadow = true;\n if (sunLight) sunLight.intensity = 0;\n }\n }\n}\n\n/**\n * Validates parameters for an effect, clamps numbers to allowed ranges\n * or applies default values in case of wrong non-numeric values.\n * All unknown properties aren't modified.\n * @param parameters Parameters candidate for an effect.\n * @param effectDescription Description of an effect.\n * @returns\n */\nexport function validateEffectParameters(\n parameters: EffectProps['parameters'] = {},\n effectDescription: EffectDescription['parameters']\n): EffectProps['parameters'] {\n const result = cloneDeep(parameters);\n effectDescription.forEach(description => {\n const {defaultValue, name, type, min, max} = description;\n\n if (!Object.prototype.hasOwnProperty.call(result, name)) return;\n const property = result[name];\n\n if (type === 'color' || type === 'array') {\n if (!Array.isArray(defaultValue)) return;\n if (property.length !== defaultValue?.length) {\n result[name] = defaultValue;\n return;\n }\n defaultValue.forEach((v, i) => {\n let value = property[i];\n value = Number.isFinite(value) ? clamp([min, max], value) : defaultValue[i] ?? min;\n if (value !== undefined) {\n property[i] = value;\n }\n });\n return;\n }\n\n if (type === 'checkbox') {\n result[name] = Boolean(property);\n return;\n }\n\n const value = Number.isFinite(property) ? clamp([min, max], property) : defaultValue ?? min;\n\n if (value !== undefined) {\n result[name] = value;\n }\n });\n return result;\n}\n"],"mappings":";;;;;;;;;;;AAGA,IAAAA,QAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAF,sBAAA,CAAAC,OAAA;AAIA,IAAAE,UAAA,GAAAF,OAAA;AAQA,IAAAG,YAAA,GAAAH,OAAA;AAEA,IAAAI,MAAA,GAAAJ,OAAA;AACA,IAAAK,UAAA,GAAAL,OAAA;AACA,IAAAM,WAAA,GAAAN,OAAA;AAA6C,SAAAO,2BAAAC,CAAA,EAAAC,CAAA,QAAAC,CAAA,yBAAAC,MAAA,IAAAH,CAAA,CAAAG,MAAA,CAAAC,QAAA,KAAAJ,CAAA,qBAAAE,CAAA,QAAAG,KAAA,CAAAC,OAAA,CAAAN,CAAA,MAAAE,CAAA,GAAAK,2BAAA,CAAAP,CAAA,MAAAC,CAAA,IAAAD,CAAA,uBAAAA,CAAA,CAAAQ,MAAA,IAAAN,CAAA,KAAAF,CAAA,GAAAE,CAAA,OAAAO,EAAA,MAAAC,CAAA,YAAAA,EAAA,eAAAC,CAAA,EAAAD,CAAA,EAAAE,CAAA,WAAAA,EAAA,WAAAH,EAAA,IAAAT,CAAA,CAAAQ,MAAA,KAAAK,IAAA,WAAAA,IAAA,MAAAC,KAAA,EAAAd,CAAA,CAAAS,EAAA,UAAAR,CAAA,WAAAA,EAAAD,CAAA,UAAAA,CAAA,KAAAe,CAAA,EAAAL,CAAA,gBAAAM,SAAA,iJAAAC,CAAA,EAAAC,CAAA,OAAAC,CAAA,gBAAAR,CAAA,WAAAA,EAAA,IAAAT,CAAA,GAAAA,CAAA,CAAAkB,IAAA,CAAApB,CAAA,MAAAY,CAAA,WAAAA,EAAA,QAAAZ,CAAA,GAAAE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U,EAAE;MACvB8F,MAAM,CAACtH,IAAI,CAAC,GAAGY,OAAO,CAACoH,QAAQ,CAAC;MAChC;IACF;IAEA,IAAM5I,KAAK,GAAGgJ,MAAM,CAACC,QAAQ,CAACL,QAAQ,CAAC,GAAG,IAAAM,gBAAK,EAAC,CAACX,GAAG,EAAEC,GAAG,CAAC,EAAEI,QAAQ,CAAC,GAAGN,YAAY,aAAZA,YAAY,cAAZA,YAAY,GAAIC,GAAG;IAE3F,IAAIvI,KAAK,KAAKgI,SAAS,EAAE;MACvBE,MAAM,CAACtH,IAAI,CAAC,GAAGZ,KAAK;IACtB;EACF,CAAC,CAAC;EACF,OAAOkI,MAAM;AACf","ignoreList":[]}
1
+ {"version":3,"file":"effect-utils.js","names":["_suncalc","_interopRequireDefault","require","_cloneDeep","_constants","_commonUtils","_utils","_dataUtils","_colorUtils","_createForOfIteratorHelper","r","e","t","Symbol","iterator","Array","isArray","_unsupportedIterableToArray","length","_n","F","s","n","done","value","f","TypeError","o","a","u","call","next","_arrayLikeToArray","toString","slice","constructor","name","from","test","_lastLightingDeckEffect","computeDeckEffects","_ref","_mapState$globe","visState","mapState","isExport","hasLightingShadow","isGlobeMode","Boolean","globe","enabled","deckEffects","effectOrder","map","effectId","effect","findById","effects","deckEffect","isFogEffect","type","SURFACE_FOG_TYPE","DISTANCE_FOG_TYPE","isLightingEffect","LIGHT_AND_SHADOW_EFFECT","enabledInThisView","isEnabled","orphaned","cleanup","updateEffect","disableLightingEffect","isExportMode","filter","disableDeckLightingEffect","unshift","fixEffectOrder","exports","lightShadowEffect","find","ind","indexOf","id","splice","distanceFogEffect","targetPos","surfaceFogEffect","reorderEffectOrder","originEffectId","destinationEffectId","activeIndex","overIndex","arrayMove","isDaytime","lat","lon","timestamp","date","Date","_SunCalc$getTimes","SunCalc","getTimes","sunrise","sunset","shadow","outputUniformShadow","_iterator","directionalLights","_step","light","err","_ref2","_deckEffect$direction","_deckEffect$direction2","_parameters$shadowMap","_deckEffect$direction3","parameters","_iterator2","_step2","some","l","shadowMapResolution","isSplit","SHADOW_MAP_RESOLUTIONS","auto","shadowColor","concat","_toConsumableArray2","normalizeColor","shadowIntensity","ambientLight","intensity","ambientLightIntensity","color","ambientLightColor","timeMode","sunLight","sunLightColor","LIGHT_AND_SHADOW_EFFECT_TIME_MODES","current","now","animation","currentTime","animationConfig","filters","FILTER_TYPES","timeRange","view","FILTER_VIEW_TYPES","enlarged","syncedWithLayerTimeline","_filter$value$","_filter$value","latitude","longitude","sunLightIntensity","validateEffectParameters","arguments","undefined","effectDescription","result","cloneDeep","forEach","description","defaultValue","min","max","Object","prototype","hasOwnProperty","property","v","i","_defaultValue$i","Number","isFinite","clamp"],"sources":["../../src/effect-utils.ts"],"sourcesContent":["// SPDX-License-Identifier: MIT\n// Copyright contributors to the kepler.gl project\n\nimport SunCalc from 'suncalc';\nimport cloneDeep from 'es-toolkit/compat/cloneDeep';\n\nimport type {Effect as DeckEffect} from '@deck.gl/core';\n\nimport {\n LIGHT_AND_SHADOW_EFFECT,\n LIGHT_AND_SHADOW_EFFECT_TIME_MODES,\n SHADOW_MAP_RESOLUTIONS,\n FILTER_TYPES,\n FILTER_VIEW_TYPES,\n DISTANCE_FOG_TYPE,\n SURFACE_FOG_TYPE\n} from '@kepler.gl/constants';\nimport {arrayMove} from '@kepler.gl/common-utils';\nimport {MapState, Effect, EffectProps, EffectDescription} from '@kepler.gl/types';\nimport {findById} from './utils';\nimport {clamp} from './data-utils';\nimport {normalizeColor} from './color-utils';\n\n// TODO isolate types - depends on @kepler.gl/schemas\ntype VisState = any;\n\n// Retains the last LightingEffect deckEffect so we can keep it in the\n// effects array (with shadows disabled) after the user removes the\n// Light & Shadow effect from the UI. Without this, deck.gl calls\n// cleanup() which removes the shadow shader module, but existing layer\n// models still have shadow_uShadowMap bindings → texture errors.\nlet _lastLightingDeckEffect: any = null;\n\nexport function computeDeckEffects({\n visState,\n mapState,\n isExport\n}: {\n visState: VisState;\n mapState: MapState;\n isExport?: boolean;\n}): DeckEffect[] {\n // TODO: 1) deck effects per deck context 2) preserved between draws\n let hasLightingShadow = false;\n\n // Light & Shadow and both Fog effects are not supported in globe mode:\n // - Fog effects are screen-space post-processing passes that read the flat\n // MapView depth buffer and don't make sense on the sphere.\n // - Shadows are cast on the flat ground plane, not the globe surface.\n // In globe mode we drop the fog effects entirely and force the lighting\n // effect into its shadow-disabled state (kept in the array, like the normal\n // \"disabled\" path, so the shadow shader module stays registered and layer\n // models don't end up with stale shadow_uShadowMap bindings).\n const isGlobeMode = Boolean(mapState?.globe?.enabled);\n\n const deckEffects = visState.effectOrder\n .map(effectId => {\n const effect = findById(effectId)(visState.effects) as Effect | undefined;\n if (effect?.deckEffect) {\n const isFogEffect = effect.type === SURFACE_FOG_TYPE || effect.type === DISTANCE_FOG_TYPE;\n const isLightingEffect = effect.type === LIGHT_AND_SHADOW_EFFECT.type;\n\n // Globe mode: skip fog effects, and keep lighting effects only in their\n // shadow-disabled form.\n if (isGlobeMode && isFogEffect) {\n return null;\n }\n\n const enabledInThisView = effect.isEnabled && !(isGlobeMode && isLightingEffect);\n\n if (enabledInThisView) {\n // deck.gl's EffectManager matches effects by id and reuses old\n // instances (calling oldEffect.setProps(newEffect.props)) instead\n // of replacing them. When a lighting effect is removed and\n // re-added, the cached _lastLightingDeckEffect is the instance\n // that deck.gl will actually render with. Adopt it so that\n // parameter syncing in updateEffect targets the right object.\n if (\n !isExport &&\n effect.type === LIGHT_AND_SHADOW_EFFECT.type &&\n _lastLightingDeckEffect &&\n _lastLightingDeckEffect !== effect.deckEffect\n ) {\n const orphaned = effect.deckEffect;\n effect.deckEffect = _lastLightingDeckEffect;\n if (orphaned && typeof orphaned.cleanup === 'function') {\n orphaned.cleanup();\n }\n }\n updateEffect({visState, mapState, effect});\n } else if (effect.type === LIGHT_AND_SHADOW_EFFECT.type) {\n // Keep lighting effects in the array even when disabled to avoid\n // removing the shadow shader module. Composite layer sublayers\n // don't regenerate models when default shader modules change,\n // leaving stale pipelines with shadow_uShadowMap bindings.\n // Disabling shadow on the lights avoids visual effects.\n disableLightingEffect(effect);\n }\n // Reset the flag on the active lighting instance after adoption, even\n // when disabled; export and the interactive maps can reuse effects.\n if (isLightingEffect || isFogEffect) {\n effect.deckEffect.isExportMode = Boolean(isExport);\n }\n\n if (enabledInThisView || effect.type === LIGHT_AND_SHADOW_EFFECT.type) {\n if (effect.type === LIGHT_AND_SHADOW_EFFECT.type) {\n hasLightingShadow = true;\n if (!isExport) {\n _lastLightingDeckEffect = effect.deckEffect;\n }\n }\n return effect.deckEffect;\n }\n }\n return null;\n })\n .filter(effect => effect);\n\n if (!hasLightingShadow && _lastLightingDeckEffect) {\n disableDeckLightingEffect(_lastLightingDeckEffect);\n deckEffects.unshift(_lastLightingDeckEffect);\n }\n\n return deckEffects;\n}\n\n/**\n * Always keep light & shadow effect at the top, then distance fog and\n * surface fog right after it (before other post-processing effects).\n * Both fog effects read the depth buffer from renderBuffers[0];\n * subsequent effects clear depth during their render passes, so fog\n * must run before that happens.\n */\nexport const fixEffectOrder = (effects: Effect[], effectOrder: string[]): string[] => {\n const lightShadowEffect = effects.find(effect => effect.type === LIGHT_AND_SHADOW_EFFECT.type);\n if (lightShadowEffect) {\n const ind = effectOrder.indexOf(lightShadowEffect.id);\n if (ind > 0) {\n effectOrder.splice(ind, 1);\n effectOrder.unshift(lightShadowEffect.id);\n }\n }\n\n const distanceFogEffect = effects.find(effect => effect.type === DISTANCE_FOG_TYPE);\n if (distanceFogEffect) {\n const ind = effectOrder.indexOf(distanceFogEffect.id);\n const targetPos = lightShadowEffect ? 1 : 0;\n if (ind > targetPos) {\n effectOrder.splice(ind, 1);\n effectOrder.splice(targetPos, 0, distanceFogEffect.id);\n }\n }\n\n const surfaceFogEffect = effects.find(effect => effect.type === SURFACE_FOG_TYPE);\n if (surfaceFogEffect) {\n const ind = effectOrder.indexOf(surfaceFogEffect.id);\n let targetPos = 0;\n if (lightShadowEffect) targetPos++;\n if (distanceFogEffect) targetPos++;\n if (ind > targetPos) {\n effectOrder.splice(ind, 1);\n effectOrder.splice(targetPos, 0, surfaceFogEffect.id);\n }\n }\n\n return effectOrder;\n};\n\nexport function reorderEffectOrder(\n effectOrder: string[],\n originEffectId: string,\n destinationEffectId: string\n): string[] {\n const activeIndex = effectOrder.indexOf(originEffectId);\n const overIndex = effectOrder.indexOf(destinationEffectId);\n return arrayMove(effectOrder, activeIndex, overIndex);\n}\n\n/**\n * Check if the current time is daytime at the given location\n * @param {number} lat Latitude\n * @param {number} lon Longitude\n * @param {number} timestamp Milliseconds since the Unix Epoch\n * @returns boolean\n */\nfunction isDaytime(lat, lon, timestamp) {\n const date = new Date(timestamp);\n const {sunrise, sunset} = SunCalc.getTimes(date, lat, lon);\n return date >= sunrise && date <= sunset;\n}\n\n/**\n * Disable shadow rendering on a lighting effect without removing it.\n * This keeps the shadow shader module registered and prevents stale\n * texture binding errors in composite layer sublayers.\n */\nfunction disableLightingEffect(effect: Effect) {\n const deckEffect = effect.deckEffect;\n if (!deckEffect) return;\n disableDeckLightingEffect(deckEffect);\n}\n\n/**\n * Disable shadow rendering directly on a deck.gl LightingEffect instance.\n */\nfunction disableDeckLightingEffect(deckEffect: any) {\n deckEffect.shadow = false;\n deckEffect.outputUniformShadow = false;\n for (const light of deckEffect.directionalLights || []) {\n light.shadow = false;\n }\n}\n\n/**\n * Update effect to match latest vis and map states.\n *\n * deck.gl's EffectManager compares effects by `id` and reuses the\n * existing (old) instance when a new one with the same id is supplied\n * (calling `oldEffect.setProps(newEffect.props)` instead of replacing).\n * LightingEffect.setProps only updates light sources, not shadowColor.\n * So we must sync ALL parameters here every frame to ensure the deck\n * effect always reflects the kepler-side state — even if deck.gl\n * silently swapped the instance under us.\n */\nfunction updateEffect({visState, mapState, effect}: {visState: any; mapState: any; effect: any}) {\n if (effect.type === LIGHT_AND_SHADOW_EFFECT.type) {\n const deckEffect = effect.deckEffect;\n const {parameters} = effect;\n\n // Re-enable shadow rendering in case it was previously disabled\n for (const light of deckEffect.directionalLights || []) {\n light.shadow = true;\n }\n deckEffect.shadow = deckEffect.directionalLights?.some(l => l.shadow) ?? false;\n\n // Each split map is rendered as its own Deck viewport and also reports one\n // viewport to ShadowPass. Exclude it explicitly, in addition to that guard.\n deckEffect.shadowMapResolution = mapState?.isSplit\n ? SHADOW_MAP_RESOLUTIONS.auto\n : parameters.shadowMapResolution ?? SHADOW_MAP_RESOLUTIONS.auto;\n\n // Sync shadow color & intensity (not handled by deck.gl setProps)\n deckEffect.shadowColor = [\n ...normalizeColor(parameters.shadowColor),\n parameters.shadowIntensity\n ];\n\n // Sync ambient light\n if (deckEffect.ambientLight) {\n deckEffect.ambientLight.intensity = parameters.ambientLightIntensity;\n deckEffect.ambientLight.color = parameters.ambientLightColor.slice();\n }\n\n let {timestamp} = parameters;\n const {timeMode} = parameters;\n const sunLight = deckEffect.directionalLights?.[0];\n if (sunLight) {\n sunLight.color = parameters.sunLightColor.slice();\n }\n\n // set timestamp for shadow\n if (timeMode === LIGHT_AND_SHADOW_EFFECT_TIME_MODES.current) {\n timestamp = Date.now();\n } else if (timeMode === LIGHT_AND_SHADOW_EFFECT_TIME_MODES.animation) {\n const {currentTime} = visState.animationConfig;\n timestamp = currentTime ?? 0;\n // Zero is a valid animation time, not a reason to fall back to a filter.\n if (!timestamp && currentTime !== 0) {\n const filter = visState.filters.find(\n filter =>\n filter.type === FILTER_TYPES.timeRange &&\n (filter.view === FILTER_VIEW_TYPES.enlarged || filter.syncedWithLayerTimeline)\n );\n if (filter) {\n timestamp = filter.value?.[0] ?? 0;\n }\n }\n }\n // A preview clone may adopt the retained deck effect, including in pick mode.\n if (sunLight) sunLight.timestamp = timestamp;\n\n // output uniform shadow during nighttime\n if (isDaytime(mapState.latitude, mapState.longitude, timestamp)) {\n deckEffect.outputUniformShadow = false;\n if (sunLight) sunLight.intensity = parameters.sunLightIntensity;\n } else {\n deckEffect.outputUniformShadow = true;\n if (sunLight) sunLight.intensity = 0;\n }\n }\n}\n\n/**\n * Validates parameters for an effect, clamps numbers to allowed ranges\n * or applies default values in case of wrong non-numeric values.\n * All unknown properties aren't modified.\n * @param parameters Parameters candidate for an effect.\n * @param effectDescription Description of an effect.\n * @returns\n */\nexport function validateEffectParameters(\n parameters: EffectProps['parameters'] = {},\n effectDescription: EffectDescription['parameters']\n): EffectProps['parameters'] {\n const result = cloneDeep(parameters);\n effectDescription.forEach(description => {\n const {defaultValue, name, type, min, max} = description;\n\n if (!Object.prototype.hasOwnProperty.call(result, name)) return;\n const property = result[name];\n\n if (type === 'color' || type === 'array') {\n if (!Array.isArray(defaultValue)) return;\n if (property.length !== defaultValue?.length) {\n result[name] = defaultValue;\n return;\n }\n defaultValue.forEach((v, i) => {\n let value = property[i];\n value = Number.isFinite(value) ? clamp([min, max], value) : defaultValue[i] ?? min;\n if (value !== undefined) {\n property[i] = value;\n }\n });\n return;\n }\n\n if (type === 'checkbox') {\n result[name] = Boolean(property);\n return;\n }\n\n const value = Number.isFinite(property) ? clamp([min, max], property) : defaultValue ?? min;\n\n if (value !== undefined) {\n result[name] = value;\n }\n });\n return result;\n}\n"],"mappings":";;;;;;;;;;;AAGA,IAAAA,QAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAF,sBAAA,CAAAC,OAAA;AAIA,IAAAE,UAAA,GAAAF,OAAA;AASA,IAAAG,YAAA,GAAAH,OAAA;AAEA,IAAAI,MAAA,GAAAJ,OAAA;AACA,IAAAK,UAAA,GAAAL,OAAA;AACA,IAAAM,WAAA,GAAAN,OAAA;AAA6C,SAAAO,2BAAAC,CAAA,EAAAC,CAAA,QAAAC,CAAA,yBAAAC,MAAA,IAAAH,CAAA,CAAAG,MAAA,CAAAC,QAAA,KAAAJ,CAAA,qBAAAE,CAAA,QAAAG,KAAA,CAAAC,OAAA,CAAAN,CAAA,MAAAE,CAAA,GAAAK,2BAAA,CAAAP,CAAA,MAAAC,CAAA,IAAAD,CAAA,uBAAAA,CAAA,CAAAQ,MAAA,IAAAN,CAA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ONFIG = {
81
81
  }
82
82
  },
83
83
  cdnUrl: KEPLER_UNFOLDED_BUCKET,
84
+ sqlJsUrl: '',
85
+ parquetWasmUrl: '',
84
86
  plugins: [],
85
87
  // The default table class is KeplerTable.
86
88
  // TODO include KeplerTable here when the circular dependency with @kepler.gl/table and @kepler.gl/utils are resolved.
@@ -1 +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,IAAI;EAEhCC,oBAAoB,EAAE;IACpBC,QAAQ,EAAE;MACRC,SAAS,EAAE,SAAXA,SAASA,CAAA;QAAA,OAAQ,MAAM,CAAC,aAAa,CAAC;MAAA,CAAsC;MAC5EC,cAAc,EAAE,YAAY;MAC5BC,yBAAyB,EAAE,gCAAgC;MAC3DC,UAAU,EAAE,UAAU;MACtBC,SAAS,EAAE;IACb,CAAC;IACDC,MAAM,EAAE;MACNL,SAAS,EAAE,SAAXA,SAASA,CAAA;QAAA,OAAQ,MAAM,CAAC,WAAW,CAAC;MAAA;MACpCC,cAAc,EAAE,UAAU;MAC1BC,yBAAyB,EAAE,8BAA8B;MACzDC,UAAU,EAAE,QAAQ;MACpBC,SAAS,EAAE;IACb;EACF,CAAC;EAEDE,MAAM,EAAEnB,sBAAsB;EAE9BoB,OAAO,EAAE,EAAE;EACX;EACA;EACAC,KAAK,EAAE,IA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;EAEtBC,iBAAiB,EAAE,IAAI;EACvBC,qBAAqB,EAAE,IAAI;EAC3BC,sBAAsB,EAAE,IAAI;EAC5BC,sBAAsB,EAAE,IAAI;EAC5BC,wBAAwB,EAAE,KAAK;EAC/BC,yBAAyB,EAAE,IAAI;EAC/BC,qBAAqB,EAAE,IAAI;EAE3BC,8BAA8B,EAAE,KAAK;EAErCC,uBAAuB,EAAE,MAAO;EAEhCC,wBAAwB,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI;EAE5CC,mBAAmB,EAAE,IAAI;EAEzBC,WAAW,EAAE,EAAE;EAEfC,aAAa,EAAE,EAAE;EAEjBC,aAAa,EAAE,CAAC;EAEhBC,eAAe,EAAE;AACnB,CAAC;AAED,IAAMC,iBAAoD,GAAG3E,0BAA0B;AAEvF,OAAO,IAAM4E,oBAAoB,GAAG,SAAvBA,oBAAoBA,CAAA;EAAA,OAA4CD,iBAAiB;AAAA;AAE9F,OAAO,SAASE,qBAAqBA,CAAA,EAA0C;EAAA,IAAzCC,SAAkC,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,CAAC,CAAC;EAC3EG,MAAM,CAACC,MAAM,CAACR,iBAAiB,EAAEG,SAAS,CAAC;AAC7C","ignoreList":[]}
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","sqlJsUrl","parquetWasmUrl","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 * Folder that Export data loads sql.js from to write GeoPackage files. It must hold\n * `sql-wasm.js` and `sql-wasm.wasm` from the sql.js version kepler.gl depends on.\n * Empty loads them from jsDelivr.\n */\n sqlJsUrl?: string;\n /**\n * URL of `parquet_wasm_bg.wasm` from the parquet-wasm version kepler.gl depends on,\n * which Export data uses to write GeoParquet files. Empty loads it from unpkg.\n */\n parquetWasmUrl?: 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 sqlJsUrl: '',\n parquetWasmUrl: '',\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;AAC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AAG,IAAI,GAAG,IAAI;EAE5CC,mBAAmB,EAAE,IAAI;EAEzBC,WAAW,EAAE,EAAE;EAEfC,aAAa,EAAE,EAAE;EAEjBC,aAAa,EAAE,CAAC;EAEhBC,eAAe,EAAE;AACnB,CAAC;AAED,IAAMC,iBAAoD,GAAG7E,0BAA0B;AAEvF,OAAO,IAAM8E,oBAAoB,GAAG,SAAvBA,oBAAoBA,CAAA;EAAA,OAA4CD,iBAAiB;AAAA;AAE9F,OAAO,SAASE,qBAAqBA,CAAA,EAA0C;EAAA,IAAzCC,SAAkC,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,CAAC,CAAC;EAC3EG,MAAM,CAACC,MAAM,CAACR,iBAAiB,EAAEG,SAAS,CAAC;AAC7C","ignoreList":[]}
@@ -7,7 +7,7 @@ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length)
7
7
 
8
8
  import SunCalc from 'suncalc';
9
9
  import cloneDeep from 'es-toolkit/compat/cloneDeep';
10
- import { LIGHT_AND_SHADOW_EFFECT, LIGHT_AND_SHADOW_EFFECT_TIME_MODES, FILTER_TYPES, FILTER_VIEW_TYPES, DISTANCE_FOG_TYPE, SURFACE_FOG_TYPE } from '@kepler.gl/constants';
10
+ import { LIGHT_AND_SHADOW_EFFECT, LIGHT_AND_SHADOW_EFFECT_TIME_MODES, SHADOW_MAP_RESOLUTIONS, FILTER_TYPES, FILTER_VIEW_TYPES, DISTANCE_FOG_TYPE, SURFACE_FOG_TYPE } from '@kepler.gl/constants';
11
11
  import { arrayMove } from '@kepler.gl/common-utils';
12
12
  import { findById } from './utils';
13
13
  import { clamp } from './data-utils';
@@ -49,12 +49,6 @@ export function computeDeckEffects(_ref) {
49
49
  if (isGlobeMode && isFogEffect) {
50
50
  return null;
51
51
  }
52
-
53
- // Always reset isExportMode so the flag doesn't persist from a
54
- // previous export session on reused effect instances.
55
- if (isLightingEffect || isFogEffect) {
56
- effect.deckEffect.isExportMode = Boolean(isExport);
57
- }
58
52
  var enabledInThisView = effect.isEnabled && !(isGlobeMode && isLightingEffect);
59
53
  if (enabledInThisView) {
60
54
  // deck.gl's EffectManager matches effects by id and reuses old
@@ -83,6 +77,11 @@ export function computeDeckEffects(_ref) {
83
77
  // Disabling shadow on the lights avoids visual effects.
84
78
  disableLightingEffect(effect);
85
79
  }
80
+ // Reset the flag on the active lighting instance after adoption, even
81
+ // when disabled; export and the interactive maps can reuse effects.
82
+ if (isLightingEffect || isFogEffect) {
83
+ effect.deckEffect.isExportMode = Boolean(isExport);
84
+ }
86
85
  if (enabledInThisView || effect.type === LIGHT_AND_SHADOW_EFFECT.type) {
87
86
  if (effect.type === LIGHT_AND_SHADOW_EFFECT.type) {
88
87
  hasLightingShadow = true;
@@ -216,7 +215,7 @@ function updateEffect(_ref2) {
216
215
  mapState = _ref2.mapState,
217
216
  effect = _ref2.effect;
218
217
  if (effect.type === LIGHT_AND_SHADOW_EFFECT.type) {
219
- var _deckEffect$direction, _deckEffect$direction2, _deckEffect$direction3;
218
+ var _deckEffect$direction, _deckEffect$direction2, _parameters$shadowMap, _deckEffect$direction3;
220
219
  var deckEffect = effect.deckEffect;
221
220
  var parameters = effect.parameters;
222
221
 
@@ -237,6 +236,10 @@ function updateEffect(_ref2) {
237
236
  return l.shadow;
238
237
  })) !== null && _deckEffect$direction !== void 0 ? _deckEffect$direction : false;
239
238
 
239
+ // Each split map is rendered as its own Deck viewport and also reports one
240
+ // viewport to ShadowPass. Exclude it explicitly, in addition to that guard.
241
+ deckEffect.shadowMapResolution = mapState !== null && mapState !== void 0 && mapState.isSplit ? SHADOW_MAP_RESOLUTIONS.auto : (_parameters$shadowMap = parameters.shadowMapResolution) !== null && _parameters$shadowMap !== void 0 ? _parameters$shadowMap : SHADOW_MAP_RESOLUTIONS.auto;
242
+
240
243
  // Sync shadow color & intensity (not handled by deck.gl setProps)
241
244
  deckEffect.shadowColor = [].concat(_toConsumableArray(normalizeColor(parameters.shadowColor)), [parameters.shadowIntensity]);
242
245
 
@@ -1 +1 @@
1
- {"version":3,"file":"effect-utils.js","names":["SunCalc","cloneDeep","LIGHT_AND_SHADOW_EFFECT","LIGHT_AND_SHADOW_EFFECT_TIME_MODES","FILTER_TYPES","FILTER_VIEW_TYPES","DISTANCE_FOG_TYPE","SURFACE_FOG_TYPE","arrayMove","findById","clamp","normalizeColor","_lastLightingDeckEffect","computeDeckEffects","_ref","_mapState$globe","visState","mapState","isExport","hasLightingShadow","isGlobeMode","Boolean","globe","enabled","deckEffects","effectOrder","map","effectId","effect","effects","deckEffect","isFogEffect","type","isLightingEffect","isExportMode","enabledInThisView","isEnabled","orphaned","cleanup","updateEffect","disableLightingEffect","filter","disableDeckLightingEffect","unshift","fixEffectOrder","lightShadowEffect","find","ind","indexOf","id","splice","distanceFogEffect","targetPos","surfaceFogEffect","reorderEffectOrder","originEffectId","destinationEffectId","activeIndex","overIndex","isDaytime","lat","lon","timestamp","date","Date","_SunCalc$getTimes","getTimes","sunrise","sunset","shadow","outputUniformShadow","_iterator","_createForOfIteratorHelper","directionalLights","_step","s","n","done","light","value","err","e","f","_ref2","_deckEffect$direction","_deckEffect$direction2","_deckEffect$direction3","parameters","_iterator2","_step2","some","l","shadowColor","concat","_toConsumableArray","shadowIntensity","ambientLight","intensity","ambientLightIntensity","color","ambientLightColor","slice","timeMode","sunLight","sunLightColor","current","now","animation","currentTime","animationConfig","filters","timeRange","view","enlarged","syncedWithLayerTimeline","_filter$value$","_filter$value","latitude","longitude","sunLightIntensity","validateEffectParameters","arguments","length","undefined","effectDescription","result","forEach","description","defaultValue","name","min","max","Object","prototype","hasOwnProperty","call","property","Array","isArray","v","i","_defaultValue$i","Number","isFinite"],"sources":["../../src/effect-utils.ts"],"sourcesContent":["// SPDX-License-Identifier: MIT\n// Copyright contributors to the kepler.gl project\n\nimport SunCalc from 'suncalc';\nimport cloneDeep from 'es-toolkit/compat/cloneDeep';\n\nimport type {Effect as DeckEffect} from '@deck.gl/core';\n\nimport {\n LIGHT_AND_SHADOW_EFFECT,\n LIGHT_AND_SHADOW_EFFECT_TIME_MODES,\n FILTER_TYPES,\n FILTER_VIEW_TYPES,\n DISTANCE_FOG_TYPE,\n SURFACE_FOG_TYPE\n} from '@kepler.gl/constants';\nimport {arrayMove} from '@kepler.gl/common-utils';\nimport {MapState, Effect, EffectProps, EffectDescription} from '@kepler.gl/types';\nimport {findById} from './utils';\nimport {clamp} from './data-utils';\nimport {normalizeColor} from './color-utils';\n\n// TODO isolate types - depends on @kepler.gl/schemas\ntype VisState = any;\n\n// Retains the last LightingEffect deckEffect so we can keep it in the\n// effects array (with shadows disabled) after the user removes the\n// Light & Shadow effect from the UI. Without this, deck.gl calls\n// cleanup() which removes the shadow shader module, but existing layer\n// models still have shadow_uShadowMap bindings → texture errors.\nlet _lastLightingDeckEffect: any = null;\n\nexport function computeDeckEffects({\n visState,\n mapState,\n isExport\n}: {\n visState: VisState;\n mapState: MapState;\n isExport?: boolean;\n}): DeckEffect[] {\n // TODO: 1) deck effects per deck context 2) preserved between draws\n let hasLightingShadow = false;\n\n // Light & Shadow and both Fog effects are not supported in globe mode:\n // - Fog effects are screen-space post-processing passes that read the flat\n // MapView depth buffer and don't make sense on the sphere.\n // - Shadows are cast on the flat ground plane, not the globe surface.\n // In globe mode we drop the fog effects entirely and force the lighting\n // effect into its shadow-disabled state (kept in the array, like the normal\n // \"disabled\" path, so the shadow shader module stays registered and layer\n // models don't end up with stale shadow_uShadowMap bindings).\n const isGlobeMode = Boolean(mapState?.globe?.enabled);\n\n const deckEffects = visState.effectOrder\n .map(effectId => {\n const effect = findById(effectId)(visState.effects) as Effect | undefined;\n if (effect?.deckEffect) {\n const isFogEffect = effect.type === SURFACE_FOG_TYPE || effect.type === DISTANCE_FOG_TYPE;\n const isLightingEffect = effect.type === LIGHT_AND_SHADOW_EFFECT.type;\n\n // Globe mode: skip fog effects, and keep lighting effects only in their\n // shadow-disabled form.\n if (isGlobeMode && isFogEffect) {\n return null;\n }\n\n // Always reset isExportMode so the flag doesn't persist from a\n // previous export session on reused effect instances.\n if (isLightingEffect || isFogEffect) {\n effect.deckEffect.isExportMode = Boolean(isExport);\n }\n\n const enabledInThisView = effect.isEnabled && !(isGlobeMode && isLightingEffect);\n\n if (enabledInThisView) {\n // deck.gl's EffectManager matches effects by id and reuses old\n // instances (calling oldEffect.setProps(newEffect.props)) instead\n // of replacing them. When a lighting effect is removed and\n // re-added, the cached _lastLightingDeckEffect is the instance\n // that deck.gl will actually render with. Adopt it so that\n // parameter syncing in updateEffect targets the right object.\n if (\n !isExport &&\n effect.type === LIGHT_AND_SHADOW_EFFECT.type &&\n _lastLightingDeckEffect &&\n _lastLightingDeckEffect !== effect.deckEffect\n ) {\n const orphaned = effect.deckEffect;\n effect.deckEffect = _lastLightingDeckEffect;\n if (orphaned && typeof orphaned.cleanup === 'function') {\n orphaned.cleanup();\n }\n }\n updateEffect({visState, mapState, effect});\n } else if (effect.type === LIGHT_AND_SHADOW_EFFECT.type) {\n // Keep lighting effects in the array even when disabled to avoid\n // removing the shadow shader module. Composite layer sublayers\n // don't regenerate models when default shader modules change,\n // leaving stale pipelines with shadow_uShadowMap bindings.\n // Disabling shadow on the lights avoids visual effects.\n disableLightingEffect(effect);\n }\n if (enabledInThisView || effect.type === LIGHT_AND_SHADOW_EFFECT.type) {\n if (effect.type === LIGHT_AND_SHADOW_EFFECT.type) {\n hasLightingShadow = true;\n if (!isExport) {\n _lastLightingDeckEffect = effect.deckEffect;\n }\n }\n return effect.deckEffect;\n }\n }\n return null;\n })\n .filter(effect => effect);\n\n if (!hasLightingShadow && _lastLightingDeckEffect) {\n disableDeckLightingEffect(_lastLightingDeckEffect);\n deckEffects.unshift(_lastLightingDeckEffect);\n }\n\n return deckEffects;\n}\n\n/**\n * Always keep light & shadow effect at the top, then distance fog and\n * surface fog right after it (before other post-processing effects).\n * Both fog effects read the depth buffer from renderBuffers[0];\n * subsequent effects clear depth during their render passes, so fog\n * must run before that happens.\n */\nexport const fixEffectOrder = (effects: Effect[], effectOrder: string[]): string[] => {\n const lightShadowEffect = effects.find(effect => effect.type === LIGHT_AND_SHADOW_EFFECT.type);\n if (lightShadowEffect) {\n const ind = effectOrder.indexOf(lightShadowEffect.id);\n if (ind > 0) {\n effectOrder.splice(ind, 1);\n effectOrder.unshift(lightShadowEffect.id);\n }\n }\n\n const distanceFogEffect = effects.find(effect => effect.type === DISTANCE_FOG_TYPE);\n if (distanceFogEffect) {\n const ind = effectOrder.indexOf(distanceFogEffect.id);\n const targetPos = lightShadowEffect ? 1 : 0;\n if (ind > targetPos) {\n effectOrder.splice(ind, 1);\n effectOrder.splice(targetPos, 0, distanceFogEffect.id);\n }\n }\n\n const surfaceFogEffect = effects.find(effect => effect.type === SURFACE_FOG_TYPE);\n if (surfaceFogEffect) {\n const ind = effectOrder.indexOf(surfaceFogEffect.id);\n let targetPos = 0;\n if (lightShadowEffect) targetPos++;\n if (distanceFogEffect) targetPos++;\n if (ind > targetPos) {\n effectOrder.splice(ind, 1);\n effectOrder.splice(targetPos, 0, surfaceFogEffect.id);\n }\n }\n\n return effectOrder;\n};\n\nexport function reorderEffectOrder(\n effectOrder: string[],\n originEffectId: string,\n destinationEffectId: string\n): string[] {\n const activeIndex = effectOrder.indexOf(originEffectId);\n const overIndex = effectOrder.indexOf(destinationEffectId);\n return arrayMove(effectOrder, activeIndex, overIndex);\n}\n\n/**\n * Check if the current time is daytime at the given location\n * @param {number} lat Latitude\n * @param {number} lon Longitude\n * @param {number} timestamp Milliseconds since the Unix Epoch\n * @returns boolean\n */\nfunction isDaytime(lat, lon, timestamp) {\n const date = new Date(timestamp);\n const {sunrise, sunset} = SunCalc.getTimes(date, lat, lon);\n return date >= sunrise && date <= sunset;\n}\n\n/**\n * Disable shadow rendering on a lighting effect without removing it.\n * This keeps the shadow shader module registered and prevents stale\n * texture binding errors in composite layer sublayers.\n */\nfunction disableLightingEffect(effect: Effect) {\n const deckEffect = effect.deckEffect;\n if (!deckEffect) return;\n disableDeckLightingEffect(deckEffect);\n}\n\n/**\n * Disable shadow rendering directly on a deck.gl LightingEffect instance.\n */\nfunction disableDeckLightingEffect(deckEffect: any) {\n deckEffect.shadow = false;\n deckEffect.outputUniformShadow = false;\n for (const light of deckEffect.directionalLights || []) {\n light.shadow = false;\n }\n}\n\n/**\n * Update effect to match latest vis and map states.\n *\n * deck.gl's EffectManager compares effects by `id` and reuses the\n * existing (old) instance when a new one with the same id is supplied\n * (calling `oldEffect.setProps(newEffect.props)` instead of replacing).\n * LightingEffect.setProps only updates light sources, not shadowColor.\n * So we must sync ALL parameters here every frame to ensure the deck\n * effect always reflects the kepler-side state — even if deck.gl\n * silently swapped the instance under us.\n */\nfunction updateEffect({visState, mapState, effect}: {visState: any; mapState: any; effect: any}) {\n if (effect.type === LIGHT_AND_SHADOW_EFFECT.type) {\n const deckEffect = effect.deckEffect;\n const {parameters} = effect;\n\n // Re-enable shadow rendering in case it was previously disabled\n for (const light of deckEffect.directionalLights || []) {\n light.shadow = true;\n }\n deckEffect.shadow = deckEffect.directionalLights?.some(l => l.shadow) ?? false;\n\n // Sync shadow color & intensity (not handled by deck.gl setProps)\n deckEffect.shadowColor = [\n ...normalizeColor(parameters.shadowColor),\n parameters.shadowIntensity\n ];\n\n // Sync ambient light\n if (deckEffect.ambientLight) {\n deckEffect.ambientLight.intensity = parameters.ambientLightIntensity;\n deckEffect.ambientLight.color = parameters.ambientLightColor.slice();\n }\n\n let {timestamp} = parameters;\n const {timeMode} = parameters;\n const sunLight = deckEffect.directionalLights?.[0];\n if (sunLight) {\n sunLight.color = parameters.sunLightColor.slice();\n }\n\n // set timestamp for shadow\n if (timeMode === LIGHT_AND_SHADOW_EFFECT_TIME_MODES.current) {\n timestamp = Date.now();\n } else if (timeMode === LIGHT_AND_SHADOW_EFFECT_TIME_MODES.animation) {\n const {currentTime} = visState.animationConfig;\n timestamp = currentTime ?? 0;\n // Zero is a valid animation time, not a reason to fall back to a filter.\n if (!timestamp && currentTime !== 0) {\n const filter = visState.filters.find(\n filter =>\n filter.type === FILTER_TYPES.timeRange &&\n (filter.view === FILTER_VIEW_TYPES.enlarged || filter.syncedWithLayerTimeline)\n );\n if (filter) {\n timestamp = filter.value?.[0] ?? 0;\n }\n }\n }\n // A preview clone may adopt the retained deck effect, including in pick mode.\n if (sunLight) sunLight.timestamp = timestamp;\n\n // output uniform shadow during nighttime\n if (isDaytime(mapState.latitude, mapState.longitude, timestamp)) {\n deckEffect.outputUniformShadow = false;\n if (sunLight) sunLight.intensity = parameters.sunLightIntensity;\n } else {\n deckEffect.outputUniformShadow = true;\n if (sunLight) sunLight.intensity = 0;\n }\n }\n}\n\n/**\n * Validates parameters for an effect, clamps numbers to allowed ranges\n * or applies default values in case of wrong non-numeric values.\n * All unknown properties aren't modified.\n * @param parameters Parameters candidate for an effect.\n * @param effectDescription Description of an effect.\n * @returns\n */\nexport function validateEffectParameters(\n parameters: EffectProps['parameters'] = {},\n effectDescription: EffectDescription['parameters']\n): EffectProps['parameters'] {\n const result = cloneDeep(parameters);\n effectDescription.forEach(description => {\n const {defaultValue, name, type, min, max} = description;\n\n if (!Object.prototype.hasOwnProperty.call(result, name)) return;\n const property = result[name];\n\n if (type === 'color' || type === 'array') {\n if (!Array.isArray(defaultValue)) return;\n if (property.length !== defaultValue?.length) {\n result[name] = defaultValue;\n return;\n }\n defaultValue.forEach((v, i) => {\n let value = property[i];\n value = Number.isFinite(value) ? clamp([min, max], value) : defaultValue[i] ?? min;\n if (value !== undefined) {\n property[i] = value;\n }\n });\n return;\n }\n\n if (type === 'checkbox') {\n result[name] = Boolean(property);\n return;\n }\n\n const value = Number.isFinite(property) ? clamp([min, max], property) : defaultValue ?? min;\n\n if (value !== undefined) {\n result[name] = value;\n }\n });\n return result;\n}\n"],"mappings":";;;;AAAA;AACA;;AAEA,OAAOA,OAAO,MAAM,SAAS;AAC7B,OAAOC,SAAS,MAAM,6BAA6B;AAInD,SACEC,uBAAuB,EACvBC,kCAAkC,EAClCC,YAAY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;QACvB7D,KAAK,GAAG+D,MAAM,CAACC,QAAQ,CAAChE,KAAK,CAAC,GAAGrE,KAAK,CAAC,CAACwH,GAAG,EAAEC,GAAG,CAAC,EAAEpD,KAAK,CAAC,IAAA8D,eAAA,GAAGb,YAAY,CAACY,CAAC,CAAC,cAAAC,eAAA,cAAAA,eAAA,GAAIX,GAAG;QAClF,IAAInD,KAAK,KAAK4C,SAAS,EAAE;UACvBa,QAAQ,CAACI,CAAC,CAAC,GAAG7D,KAAK;QACrB;MACF,CAAC,CAAC;MACF;IACF;IAEA,IAAI/C,IAAI,KAAK,UAAU,EAAE;MACvB6F,MAAM,CAACI,IAAI,CAAC,GAAG5G,OAAO,CAACmH,QAAQ,CAAC;MAChC;IACF;IAEA,IAAMzD,KAAK,GAAG+D,MAAM,CAACC,QAAQ,CAACP,QAAQ,CAAC,GAAG9H,KAAK,CAAC,CAACwH,GAAG,EAAEC,GAAG,CAAC,EAAEK,QAAQ,CAAC,GAAGR,YAAY,aAAZA,YAAY,cAAZA,YAAY,GAAIE,GAAG;IAE3F,IAAInD,KAAK,KAAK4C,SAAS,EAAE;MACvBE,MAAM,CAACI,IAAI,CAAC,GAAGlD,KAAK;IACtB;EACF,CAAC,CAAC;EACF,OAAO8C,MAAM;AACf","ignoreList":[]}
1
+ {"version":3,"file":"effect-utils.js","names":["SunCalc","cloneDeep","LIGHT_AND_SHADOW_EFFECT","LIGHT_AND_SHADOW_EFFECT_TIME_MODES","SHADOW_MAP_RESOLUTIONS","FILTER_TYPES","FILTER_VIEW_TYPES","DISTANCE_FOG_TYPE","SURFACE_FOG_TYPE","arrayMove","findById","clamp","normalizeColor","_lastLightingDeckEffect","computeDeckEffects","_ref","_mapState$globe","visState","mapState","isExport","hasLightingShadow","isGlobeMode","Boolean","globe","enabled","deckEffects","effectOrder","map","effectId","effect","effects","deckEffect","isFogEffect","type","isLightingEffect","enabledInThisView","isEnabled","orphaned","cleanup","updateEffect","disableLightingEffect","isExportMode","filter","disableDeckLightingEffect","unshift","fixEffectOrder","lightShadowEffect","find","ind","indexOf","id","splice","distanceFogEffect","targetPos","surfaceFogEffect","reorderEffectOrder","originEffectId","destinationEffectId","activeIndex","overIndex","isDaytime","lat","lon","timestamp","date","Date","_SunCalc$getTimes","getTimes","sunrise","sunset","shadow","outputUniformShadow","_iterator","_createForOfIteratorHelper","directionalLights","_step","s","n","done","light","value","err","e","f","_ref2","_deckEffect$direction","_deckEffect$direction2","_parameters$shadowMap","_deckEffect$direction3","parameters","_iterator2","_step2","some","l","shadowMapResolution","isSplit","auto","shadowColor","concat","_toConsumableArray","shadowIntensity","ambientLight","intensity","ambientLightIntensity","color","ambientLightColor","slice","timeMode","sunLight","sunLightColor","current","now","animation","currentTime","animationConfig","filters","timeRange","view","enlarged","syncedWithLayerTimeline","_filter$value$","_filter$value","latitude","longitude","sunLightIntensity","validateEffectParameters","arguments","length","undefined","effectDescription","result","forEach","description","defaultValue","name","min","max","Object","prototype","hasOwnProperty","call","property","Array","isArray","v","i","_defaultValue$i","Number","isFinite"],"sources":["../../src/effect-utils.ts"],"sourcesContent":["// SPDX-License-Identifier: MIT\n// Copyright contributors to the kepler.gl project\n\nimport SunCalc from 'suncalc';\nimport cloneDeep from 'es-toolkit/compat/cloneDeep';\n\nimport type {Effect as DeckEffect} from '@deck.gl/core';\n\nimport {\n LIGHT_AND_SHADOW_EFFECT,\n LIGHT_AND_SHADOW_EFFECT_TIME_MODES,\n SHADOW_MAP_RESOLUTIONS,\n FILTER_TYPES,\n FILTER_VIEW_TYPES,\n DISTANCE_FOG_TYPE,\n SURFACE_FOG_TYPE\n} from '@kepler.gl/constants';\nimport {arrayMove} from '@kepler.gl/common-utils';\nimport {MapState, Effect, EffectProps, EffectDescription} from '@kepler.gl/types';\nimport {findById} from './utils';\nimport {clamp} from './data-utils';\nimport {normalizeColor} from './color-utils';\n\n// TODO isolate types - depends on @kepler.gl/schemas\ntype VisState = any;\n\n// Retains the last LightingEffect deckEffect so we can keep it in the\n// effects array (with shadows disabled) after the user removes the\n// Light & Shadow effect from the UI. Without this, deck.gl calls\n// cleanup() which removes the shadow shader module, but existing layer\n// models still have shadow_uShadowMap bindings → texture errors.\nlet _lastLightingDeckEffect: any = null;\n\nexport function computeDeckEffects({\n visState,\n mapState,\n isExport\n}: {\n visState: VisState;\n mapState: MapState;\n isExport?: boolean;\n}): DeckEffect[] {\n // TODO: 1) deck effects per deck context 2) preserved between draws\n let hasLightingShadow = false;\n\n // Light & Shadow and both Fog effects are not supported in globe mode:\n // - Fog effects are screen-space post-processing passes that read the flat\n // MapView depth buffer and don't make sense on the sphere.\n // - Shadows are cast on the flat ground plane, not the globe surface.\n // In globe mode we drop the fog effects entirely and force the lighting\n // effect into its shadow-disabled state (kept in the array, like the normal\n // \"disabled\" path, so the shadow shader module stays registered and layer\n // models don't end up with stale shadow_uShadowMap bindings).\n const isGlobeMode = Boolean(mapState?.globe?.enabled);\n\n const deckEffects = visState.effectOrder\n .map(effectId => {\n const effect = findById(effectId)(visState.effects) as Effect | undefined;\n if (effect?.deckEffect) {\n const isFogEffect = effect.type === SURFACE_FOG_TYPE || effect.type === DISTANCE_FOG_TYPE;\n const isLightingEffect = effect.type === LIGHT_AND_SHADOW_EFFECT.type;\n\n // Globe mode: skip fog effects, and keep lighting effects only in their\n // shadow-disabled form.\n if (isGlobeMode && isFogEffect) {\n return null;\n }\n\n const enabledInThisView = effect.isEnabled && !(isGlobeMode && isLightingEffect);\n\n if (enabledInThisView) {\n // deck.gl's EffectManager matches effects by id and reuses old\n // instances (calling oldEffect.setProps(newEffect.props)) instead\n // of replacing them. When a lighting effect is removed and\n // re-added, the cached _lastLightingDeckEffect is the instance\n // that deck.gl will actually render with. Adopt it so that\n // parameter syncing in updateEffect targets the right object.\n if (\n !isExport &&\n effect.type === LIGHT_AND_SHADOW_EFFECT.type &&\n _lastLightingDeckEffect &&\n _lastLightingDeckEffect !== effect.deckEffect\n ) {\n const orphaned = effect.deckEffect;\n effect.deckEffect = _lastLightingDeckEffect;\n if (orphaned && typeof orphaned.cleanup === 'function') {\n orphaned.cleanup();\n }\n }\n updateEffect({visState, mapState, effect});\n } else if (effect.type === LIGHT_AND_SHADOW_EFFECT.type) {\n // Keep lighting effects in the array even when disabled to avoid\n // removing the shadow shader module. Composite layer sublayers\n // don't regenerate models when default shader modules change,\n // leaving stale pipelines with shadow_uShadowMap bindings.\n // Disabling shadow on the lights avoids visual effects.\n disableLightingEffect(effect);\n }\n // Reset the flag on the active lighting instance after adoption, even\n // when disabled; export and the interactive maps can reuse effects.\n if (isLightingEffect || isFogEffect) {\n effect.deckEffect.isExportMode = Boolean(isExport);\n }\n\n if (enabledInThisView || effect.type === LIGHT_AND_SHADOW_EFFECT.type) {\n if (effect.type === LIGHT_AND_SHADOW_EFFECT.type) {\n hasLightingShadow = true;\n if (!isExport) {\n _lastLightingDeckEffect = effect.deckEffect;\n }\n }\n return effect.deckEffect;\n }\n }\n return null;\n })\n .filter(effect => effect);\n\n if (!hasLightingShadow && _lastLightingDeckEffect) {\n disableDeckLightingEffect(_lastLightingDeckEffect);\n deckEffects.unshift(_lastLightingDeckEffect);\n }\n\n return deckEffects;\n}\n\n/**\n * Always keep light & shadow effect at the top, then distance fog and\n * surface fog right after it (before other post-processing effects).\n * Both fog effects read the depth buffer from renderBuffers[0];\n * subsequent effects clear depth during their render passes, so fog\n * must run before that happens.\n */\nexport const fixEffectOrder = (effects: Effect[], effectOrder: string[]): string[] => {\n const lightShadowEffect = effects.find(effect => effect.type === LIGHT_AND_SHADOW_EFFECT.type);\n if (lightShadowEffect) {\n const ind = effectOrder.indexOf(lightShadowEffect.id);\n if (ind > 0) {\n effectOrder.splice(ind, 1);\n effectOrder.unshift(lightShadowEffect.id);\n }\n }\n\n const distanceFogEffect = effects.find(effect => effect.type === DISTANCE_FOG_TYPE);\n if (distanceFogEffect) {\n const ind = effectOrder.indexOf(distanceFogEffect.id);\n const targetPos = lightShadowEffect ? 1 : 0;\n if (ind > targetPos) {\n effectOrder.splice(ind, 1);\n effectOrder.splice(targetPos, 0, distanceFogEffect.id);\n }\n }\n\n const surfaceFogEffect = effects.find(effect => effect.type === SURFACE_FOG_TYPE);\n if (surfaceFogEffect) {\n const ind = effectOrder.indexOf(surfaceFogEffect.id);\n let targetPos = 0;\n if (lightShadowEffect) targetPos++;\n if (distanceFogEffect) targetPos++;\n if (ind > targetPos) {\n effectOrder.splice(ind, 1);\n effectOrder.splice(targetPos, 0, surfaceFogEffect.id);\n }\n }\n\n return effectOrder;\n};\n\nexport function reorderEffectOrder(\n effectOrder: string[],\n originEffectId: string,\n destinationEffectId: string\n): string[] {\n const activeIndex = effectOrder.indexOf(originEffectId);\n const overIndex = effectOrder.indexOf(destinationEffectId);\n return arrayMove(effectOrder, activeIndex, overIndex);\n}\n\n/**\n * Check if the current time is daytime at the given location\n * @param {number} lat Latitude\n * @param {number} lon Longitude\n * @param {number} timestamp Milliseconds since the Unix Epoch\n * @returns boolean\n */\nfunction isDaytime(lat, lon, timestamp) {\n const date = new Date(timestamp);\n const {sunrise, sunset} = SunCalc.getTimes(date, lat, lon);\n return date >= sunrise && date <= sunset;\n}\n\n/**\n * Disable shadow rendering on a lighting effect without removing it.\n * This keeps the shadow shader module registered and prevents stale\n * texture binding errors in composite layer sublayers.\n */\nfunction disableLightingEffect(effect: Effect) {\n const deckEffect = effect.deckEffect;\n if (!deckEffect) return;\n disableDeckLightingEffect(deckEffect);\n}\n\n/**\n * Disable shadow rendering directly on a deck.gl LightingEffect instance.\n */\nfunction disableDeckLightingEffect(deckEffect: any) {\n deckEffect.shadow = false;\n deckEffect.outputUniformShadow = false;\n for (const light of deckEffect.directionalLights || []) {\n light.shadow = false;\n }\n}\n\n/**\n * Update effect to match latest vis and map states.\n *\n * deck.gl's EffectManager compares effects by `id` and reuses the\n * existing (old) instance when a new one with the same id is supplied\n * (calling `oldEffect.setProps(newEffect.props)` instead of replacing).\n * LightingEffect.setProps only updates light sources, not shadowColor.\n * So we must sync ALL parameters here every frame to ensure the deck\n * effect always reflects the kepler-side state — even if deck.gl\n * silently swapped the instance under us.\n */\nfunction updateEffect({visState, mapState, effect}: {visState: any; mapState: any; effect: any}) {\n if (effect.type === LIGHT_AND_SHADOW_EFFECT.type) {\n const deckEffect = effect.deckEffect;\n const {parameters} = effect;\n\n // Re-enable shadow rendering in case it was previously disabled\n for (const light of deckEffect.directionalLights || []) {\n light.shadow = true;\n }\n deckEffect.shadow = deckEffect.directionalLights?.some(l => l.shadow) ?? false;\n\n // Each split map is rendered as its own Deck viewport and also reports one\n // viewport to ShadowPass. Exclude it explicitly, in addition to that guard.\n deckEffect.shadowMapResolution = mapState?.isSplit\n ? SHADOW_MAP_RESOLUTIONS.auto\n : parameters.shadowMapResolution ?? SHADOW_MAP_RESOLUTIONS.auto;\n\n // Sync shadow color & intensity (not handled by deck.gl setProps)\n deckEffect.shadowColor = [\n ...normalizeColor(parameters.shadowColor),\n parameters.shadowIntensity\n ];\n\n // Sync ambient light\n if (deckEffect.ambientLight) {\n deckEffect.ambientLight.intensity = parameters.ambientLightIntensity;\n deckEffect.ambientLight.color = parameters.ambientLightColor.slice();\n }\n\n let {timestamp} = parameters;\n const {timeMode} = parameters;\n const sunLight = deckEffect.directionalLights?.[0];\n if (sunLight) {\n sunLight.color = parameters.sunLightColor.slice();\n }\n\n // set timestamp for shadow\n if (timeMode === LIGHT_AND_SHADOW_EFFECT_TIME_MODES.current) {\n timestamp = Date.now();\n } else if (timeMode === LIGHT_AND_SHADOW_EFFECT_TIME_MODES.animation) {\n const {currentTime} = visState.animationConfig;\n timestamp = currentTime ?? 0;\n // Zero is a valid animation time, not a reason to fall back to a filter.\n if (!timestamp && currentTime !== 0) {\n const filter = visState.filters.find(\n filter =>\n filter.type === FILTER_TYPES.timeRange &&\n (filter.view === FILTER_VIEW_TYPES.enlarged || filter.syncedWithLayerTimeline)\n );\n if (filter) {\n timestamp = filter.value?.[0] ?? 0;\n }\n }\n }\n // A preview clone may adopt the retained deck effect, including in pick mode.\n if (sunLight) sunLight.timestamp = timestamp;\n\n // output uniform shadow during nighttime\n if (isDaytime(mapState.latitude, mapState.longitude, timestamp)) {\n deckEffect.outputUniformShadow = false;\n if (sunLight) sunLight.intensity = parameters.sunLightIntensity;\n } else {\n deckEffect.outputUniformShadow = true;\n if (sunLight) sunLight.intensity = 0;\n }\n }\n}\n\n/**\n * Validates parameters for an effect, clamps numbers to allowed ranges\n * or applies default values in case of wrong non-numeric values.\n * All unknown properties aren't modified.\n * @param parameters Parameters candidate for an effect.\n * @param effectDescription Description of an effect.\n * @returns\n */\nexport function validateEffectParameters(\n parameters: EffectProps['parameters'] = {},\n effectDescription: EffectDescription['parameters']\n): EffectProps['parameters'] {\n const result = cloneDeep(parameters);\n effectDescription.forEach(description => {\n const {defaultValue, name, type, min, max} = description;\n\n if (!Object.prototype.hasOwnProperty.call(result, name)) return;\n const property = result[name];\n\n if (type === 'color' || type === 'array') {\n if (!Array.isArray(defaultValue)) return;\n if (property.length !== defaultValue?.length) {\n result[name] = defaultValue;\n return;\n }\n defaultValue.forEach((v, i) => {\n let value = property[i];\n value = Number.isFinite(value) ? clamp([min, max], value) : defaultValue[i] ?? min;\n if (value !== undefined) {\n property[i] = value;\n }\n });\n return;\n }\n\n if (type === 'checkbox') {\n result[name] = Boolean(property);\n return;\n }\n\n const value = Number.isFinite(property) ? clamp([min, max], property) : defaultValue ?? min;\n\n if (value !== undefined) {\n result[name] = value;\n }\n });\n return result;\n}\n"],"mappings":";;;;AAAA;AACA;;AAEA,OAAOA,OAAO,MAAM,SAAS;AAC7B,OAAOC,SAAS,MAAM,6BAA6B;AAInD,SACEC,uBAAuB,EACvBC,kCAAkC,EAClCC,sBAAsB,EACtBC,YAAY,EACZC,iBAAiB,EACjBC,iBAAiB,EACjBC,gBAAgB,QACX,sBAAsB;AAC7B,SAAQC,SAAS,QAAO,yBAAyB;AAEjD,SAAQC,QAAQ,QAAO,SAAS;AAChC,SAAQC,KAAK,QAAO,cAAc;AAClC,SAAQC,cAAc,QAAO,eAAe;;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AAIlE,KAAK,GAAG6D,QAAQ,CAACI,CAAC,CAAC;QACvBjE,KAAK,GAAGmE,MAAM,CAACC,QAAQ,CAACpE,KAAK,CAAC,GAAGrE,KAAK,CAAC,CAAC4H,GAAG,EAAEC,GAAG,CAAC,EAAExD,KAAK,CAAC,IAAAkE,eAAA,GAAGb,YAAY,CAACY,CAAC,CAAC,cAAAC,eAAA,cAAAA,eAAA,GAAIX,GAAG;QAClF,IAAIvD,KAAK,KAAKgD,SAAS,EAAE;UACvBa,QAAQ,CAACI,CAAC,CAAC,GAAGjE,KAAK;QACrB;MACF,CAAC,CAAC;MACF;IACF;IAEA,IAAI/C,IAAI,KAAK,UAAU,EAAE;MACvBiG,MAAM,CAACI,IAAI,CAAC,GAAGhH,OAAO,CAACuH,QAAQ,CAAC;MAChC;IACF;IAEA,IAAM7D,KAAK,GAAGmE,MAAM,CAACC,QAAQ,CAACP,QAAQ,CAAC,GAAGlI,KAAK,CAAC,CAAC4H,GAAG,EAAEC,GAAG,CAAC,EAAEK,QAAQ,CAAC,GAAGR,YAAY,aAAZA,YAAY,cAAZA,YAAY,GAAIE,GAAG;IAE3F,IAAIvD,KAAK,KAAKgD,SAAS,EAAE;MACvBE,MAAM,CAACI,IAAI,CAAC,GAAGtD,KAAK;IACtB;EACF,CAAC,CAAC;EACF,OAAOkD,MAAM;AACf","ignoreList":[]}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@kepler.gl/utils",
3
3
  "author": "Shan He <shan@uber.com>",
4
- "version": "3.3.0-alpha.23",
4
+ "version": "3.3.0-alpha.25",
5
5
  "description": "kepler.gl constants used by kepler.gl components, actions and reducers",
6
6
  "license": "MIT",
7
7
  "main": "dist/cjs/index.js",
@@ -29,9 +29,9 @@
29
29
  ],
30
30
  "dependencies": {
31
31
  "@deck.gl/core": "^9.4.1",
32
- "@kepler.gl/common-utils": "3.3.0-alpha.23",
33
- "@kepler.gl/constants": "3.3.0-alpha.23",
34
- "@kepler.gl/types": "3.3.0-alpha.23",
32
+ "@kepler.gl/common-utils": "3.3.0-alpha.25",
33
+ "@kepler.gl/constants": "3.3.0-alpha.25",
34
+ "@kepler.gl/types": "3.3.0-alpha.25",
35
35
  "@loaders.gl/gis": "^4.4.5",
36
36
  "@luma.gl/constants": "^9.4.2",
37
37
  "@luma.gl/core": "^9.4.2",