import type { MapLib, MapRef } from 'react-map-gl/mapbox-legacy'; import type { BaseMapLibraryType } from '@kepler.gl/constants'; import type { DatabaseAdapter } from './application-config-types'; /** * Represents a custom SVG icon that can be used in the icon layer. * The mesh describes the icon's geometry as triangulated SVG paths. * * Important: Triangle cells must use counter-clockwise (CCW) winding order. * Positions should be in the range [-1, 1] on both axes. */ export type SvgIcon = { /** Unique identifier for the icon, used as the value in the data's icon column */ id: string; /** Triangulated SVG path geometry */ mesh: { /** Triangle cell indices referencing positions (CCW winding order) */ cells: [number, number, number][]; /** Vertex positions [x, y, z] in range [-1, 1] */ positions: [number, number, number][]; }; }; export type MapLibInstance = MapLib; export type GetMapRef = ReturnType; export type BaseMapLibraryConfig = { getMapLib: () => Promise; mapLibAttributionCssClass: string; mapLibCssClass: string; mapLibName: string; mapLibUrl: string; }; /** * A mechanism to override default Kepler values/settings so that we * without having to make application-specific changes to the kepler repo. */ /** * Controls which Redux actions are suppressed by the dev-mode Redux logger. * Mirrors the `log.level` convention used by luma.gl / deck.gl. * * - `0` — log every action (no filtering) * - `1` — suppress the highest-frequency UI noise: * MOUSE_MOVE, LAYER_HOVER, SET_MAP_BOUNDARY, SET_LOADING_INDICATOR, * SET_LOADING_PROGRESS * - `2` — suppress everything in level 1 plus map/layer update chatter: * LOAD_MAP_STYLES, UPDATE_MAP, LAYER_VISUAL_CHANGE, * ON_MAP_CLICK, FILTER_CHANGE, MAP_LOAD_STARTED * * Effects by context: * - **redux-logger** (console output): only active when `NODE_ENV === 'local'` (i.e. `yarn start`) * - **Redux DevTools** (`actionsBlacklist`): active whenever the browser extension is present, * regardless of `NODE_ENV` * * Default: `1` * * @example * ```ts * initApplicationConfig({ reduxLogLevel: 2 }); // quieter dev console * initApplicationConfig({ reduxLogLevel: 0 }); // see every action * ``` */ export type ReduxLogLevel = 0 | 1 | 2; /** Built-in file formats that can be listed in {@link KeplerApplicationConfig.acceptedFileFormats}. */ export type KeplerAcceptedFileFormat = 'csv' | 'tsv' | 'dsv' | 'json' | 'geojson' | 'ndjson' | 'jsonl' | 'geojsonl' | 'ndgeojson' | 'ldgeojson' | 'kml' | 'gpx' | 'tcx' | 'arrow' | 'feather' | 'parquet' | 'shp' | 'shapefile' | 'zip' | 'dbf' | 'shx' | 'prj' | 'cpg' | 'xlsx' | 'xls' | 'xlsm' | 'xlsb' | 'excel' | 'fgb' | 'flatgeobuf'; export type KeplerApplicationConfig = { /** Default name of export HTML file, can be overridden by user */ defaultHtmlName?: string; defaultImageName?: string; defaultJsonName?: string; defaultDataName?: string; defaultExportJsonSettings?: { hasData?: boolean; }; baseMapLibraryConfig?: Record; plugins?: any[]; table?: any; database?: DatabaseAdapter | null; useArrowProgressiveLoading?: boolean; showReleaseBanner?: boolean; useOnFilteredItemsChange?: boolean; cdnUrl?: string; enableRasterTileLayer?: boolean; /** Whether to use Titiler v0.21 API endpoints instead of v0.11 */ rasterServerUseLatestTitiler?: boolean; /** An array of URLs to shards of the raster tile server to be used by the raster tile layer. */ rasterServerUrls?: string[]; /** If true then try to fetch quantized elevation meshes from raster servers */ rasterServerSupportsElevation?: boolean; /** How many times to retry a request if case of rasterServerServerErrorsToRetry errors */ rasterServerMaxRetries?: number; /** How long between retries */ rasterServerRetryDelay?: number; /** An array of HTTP status codes that should be retried when encountered. */ rasterServerServerErrorsToRetry?: number[]; /** Maximum number of simultaneous requests per raster server. 0 - no limit */ rasterServerMaxPerServerRequests?: number; /** Whether to show the server input field in the raster tile layer setup form */ rasterServerShowServerInput?: boolean; enableWMSLayer?: boolean; enableFlowLayer?: boolean; enableBitmapLayer?: boolean; enableA5Layer?: boolean; enableGeohashLayer?: boolean; enableFlowFieldLayer?: boolean; /** Whether to show example URLs in tileset setup forms (vector tile, raster tile, WMS, 3D tile) */ showInlineTilesetExamples?: boolean; /** Whether to apply fix for uglify error in dom-to-image (should be true for webpack builds, false for Vite) */ escapeXhtmlForWebpack?: boolean; /** Maximum pitch angle in degrees. deck.gl defaults to 60; set higher (up to 85) for elevated perspectives. * Note: values above 60 may cause rendering artifacts with some basemap tile providers. */ maxPitch?: number; /** Whether to enable the annotations feature. Enabled by default. */ enableAnnotations?: boolean; /** * Whether to enable extended Draw on Map sketch tools: Point, Line, Copy all, * Convert to Layer, and Edit Properties. * Polygon and rectangle drawing remain available when this is disabled. Enabled by default. */ enableDrawOnMapSketches?: boolean; /** Whether to show the map navigation control (zoom buttons and compass). Enabled by default. */ enableMapNavigationControl?: boolean; /** Whether to show the map scale bar at the bottom-left of the map. Enabled by default. */ enableMapScale?: boolean; /** * Fit the map to a dataset when the layer type dropdown gives a manually * added layer its first type. The layer already has a dataset (chosen from * Add Layer). Programmatic `layerTypeChange`, saved configs, and later type * changes do not move the map. * Enabled by default. Disable with {@link initApplicationConfig}. * * @example * ``` * initApplicationConfig({enableFitBoundsOnManualLayer: false}); * ``` */ enableFitBoundsOnManualLayer?: boolean; /** Whether to enable the swipe compare mode in split map view. Enabled by default. */ enableSwipeMode?: boolean; /** Whether to show the option to switch to the globe view. Enabled by default. */ enableGlobeView?: boolean; /** Whether to enable the layer groups feature. Enabled by default. */ enableLayerGroups?: boolean; /** * Named UI themes to cycle (`dark`, `light`, `space`, `base`). * Empty (default): dark theme, no switcher. * One theme: that theme is used, no switcher. * Two or more: first is the default, a map control cycles the list. */ themes?: string[]; /** Whether to show column statistics in the data table modal. Enabled by default. */ enableColumnStats?: boolean; /** Group-by, attribute join, and simple spatial join UI on local datasets. Enabled by default. */ enableDatasetOps?: boolean; /** * Whether to show the charts map-control panel (big number, bar, line, * heatmap, pivot table, tooltip charts, and chart cross-filters). * Enabled by default. Disable with {@link initApplicationConfig}. */ enableChartsPanel?: boolean; /** * Master switch for power-user JSON editors. When false, every section editor is hidden. * Defaults to true; each section also has its own flag. * * @example * ``` * initApplicationConfig({ * enableViewportJsonEditor: true, * enableLayerJsonEditor: false * }); * ``` */ enableJsonEditors?: boolean; /** Layer panel `{ }` JSON editor. Enabled by default. */ enableLayerJsonEditor?: boolean; /** Filter panel `{ }` JSON editor. Enabled by default. */ enableFilterJsonEditor?: boolean; /** Effect panel `{ }` JSON editor. Enabled by default. */ enableEffectJsonEditor?: boolean; /** * Viewport JSON editor map-control button. Disabled by default because it adds an extra * map control. */ enableViewportJsonEditor?: boolean; /** Animation / time-filter playback `{ }` JSON editor. Enabled by default. */ enableAnimationJsonEditor?: boolean; /** Charts panel `{ }` JSON editor. Enabled by default. */ enableChartJsonEditor?: boolean; /** * Show a format dropdown next to the remote dataset URL field (Auto / CSV / GeoJSON / JSON / Arrow / Parquet). * Useful for extensionless URLs such as Azure SAS blobs. Disabled by default. */ enableRemoteFileFormatSelector?: boolean; /** * Warn in the Add Data list when a dataset has at least this many rows. * `false` shows no warning. The warning waits until the row count is known. * * @example * ``` * initApplicationConfig({largeDatasetWarningRows: 1_000_000}); * initApplicationConfig({largeDatasetWarningRows: false}); * ``` */ largeDatasetWarningRows?: false | number; /** * Warn in the Add Data list when a file is at least this many bytes. * `false` shows no file-size warning. Either this or {@link largeDatasetWarningRows} * can show the same tag. * * @example * ``` * initApplicationConfig({largeDatasetWarningBytes: 50 * 1024 * 1024}); * initApplicationConfig({largeDatasetWarningBytes: false}); * ``` */ largeDatasetWarningBytes?: false | number; /** * File formats Kepler may load from drag-and-drop, the file picker, and remote URLs. * Values are format ids or extensions (`csv`, `geojson`, `kml`, `shp`, `xlsx`, `fgb`, …). * When omitted or `null`, every built-in format is accepted. * * @example * ``` * initApplicationConfig({acceptedFileFormats: ['csv', 'geojson', 'parquet']}); * ``` */ acceptedFileFormats?: KeplerAcceptedFileFormat[] | null; /** * Custom SVG icons to be made available in the icon layer. * These icons will be merged with the default icons fetched from CDN. * Each icon must have a unique `id` and a `mesh` describing its triangulated geometry. * * @example * ``` * initApplicationConfig({ * customIcons: [ * { * id: 'my-custom-marker', * mesh: { * cells: [[0, 1, 2], [2, 3, 0]], * positions: [[0, 1, 0], [1, -1, 0], [-1, -1, 0], [0, 0, 0]] * } * } * ] * }); * ``` */ customIcons?: SvgIcon[]; /** * URL to a remote JSON file containing custom SVG icons. * The JSON file should have the format: `{ "svgIcons": [{ id, mesh: { cells, positions } }, ...] }` * Icons from this URL will be merged with default CDN icons and inline `customIcons`. * * @example * ``` * initApplicationConfig({ * customIconUrl: 'https://my-server.com/my-icons.json' * }); * ``` */ customIconUrl?: string; /** Controls Redux action logging verbosity in dev mode. See {@link ReduxLogLevel}. */ reduxLogLevel?: ReduxLogLevel; /** * If an Arrow/Parquet table has more record batches than this, they are * compacted into a single batch. The default is `1`, so any table with more * than one record batch is compacted. Deck.gl picking supports at most 255 * pickable leaf layers, and GeoJSON adds fill/stroke/point sublayers per * batch, so a higher cap still overruns picking. Compacting copies the table. * Progressive Arrow loading skips compaction on intermediate batches and * compacts the completed file once. Set a very large number to never compact. * * @example * ``` * initApplicationConfig({maxArrowBatches: 64}); * ``` */ maxArrowBatches?: number; }; export declare const getApplicationConfig: () => Required; export declare function initApplicationConfig(appConfig?: KeplerApplicationConfig): void;