• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

keplergl / kepler.gl / 22361650031

24 Feb 2026 05:09PM UTC coverage: 61.612% (-0.2%) from 61.806%
22361650031

Pull #3219

github

web-flow
Merge 1d9b34cb5 into cc33b0c8f
Pull Request #3219: Update kepler-jupyter to use kepler.gl v3.2.0

6382 of 12288 branches covered (51.94%)

Branch coverage included in aggregate %.

13078 of 19297 relevant lines covered (67.77%)

81.44 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

62.5
/src/utils/src/application-config.ts
1
// SPDX-License-Identifier: MIT
2
// Copyright contributors to the kepler.gl project
3

4
import {MapLib, MapRef} from 'react-map-gl';
5

6
import {KEPLER_UNFOLDED_BUCKET} from '@kepler.gl/constants';
7
import type {BaseMapLibraryType} from '@kepler.gl/constants';
8

9
import type {DatabaseAdapter} from './application-config-types';
10

11
/**
12
 * Detect if running with webpack build tool
13
 */
14
function isWebpackBuild(): boolean {
15
  // @ts-ignore - __webpack_require__ is injected by webpack at runtime
16
  return typeof __webpack_require__ !== 'undefined';
15✔
17
}
18

19
export type MapLibInstance = MapLib<any>;
20
export type GetMapRef = ReturnType<MapRef['getMap']>;
21

22
export type BaseMapLibraryConfig = {
23
  getMapLib: () => Promise<MapLibInstance>;
24
  mapLibAttributionCssClass: string;
25
  mapLibCssClass: string;
26
  mapLibName: string;
27
  mapLibUrl: string;
28
};
29

30
/**
31
 * A mechanism to override default Kepler values/settings so that we
32
 * without having to make application-specific changes to the kepler repo.
33
 */
34
export type KeplerApplicationConfig = {
35
  /** Default name of export HTML file, can be overridden by user */
36
  defaultHtmlName?: string;
37
  defaultImageName?: string;
38
  defaultJsonName?: string;
39
  defaultDataName?: string;
40
  defaultExportJsonSettings?: {
41
    hasData?: boolean;
42
  };
43
  baseMapLibraryConfig?: Record<BaseMapLibraryType, BaseMapLibraryConfig>;
44
  plugins?: any[];
45
  // KeplerTable alternative
46
  // TODO improve typing by exporting KeplerTable interface to @kepler.gl/types
47
  table?: any;
48
  database?: DatabaseAdapter | null;
49

50
  // Disable progressive loading for arrow files
51
  useArrowProgressiveLoading?: boolean;
52
  // Show built-in banner associated with the current version of Kepler.gl
53
  showReleaseBanner?: boolean;
54
  // Use the onFilteredItemsChange callback for DataFilterExtension.
55
  // Enabling this option may cause performance issues when dealing with a large number of layers or sublayers,
56
  // especially if large Arrow files are split into relatively small batches (should be fixed in the future).
57
  useOnFilteredItemsChange?: boolean;
58

59
  // A URL to the CDN where the kepler.gl assets are hosted.
60
  cdnUrl?: string;
61

62
  // Raster Tile layer config
63
  // Raster Tile layer is under development and not ready for production use. Disabled by default.
64
  enableRasterTileLayer?: boolean;
65
  /** Whether to use Titiler v0.21 API endpoints instead of v0.11 */
66
  rasterServerUseLatestTitiler?: boolean;
67
  /** An array of URLs to shards of the raster tile server to be used by the raster tile layer. */
68
  rasterServerUrls?: string[];
69
  /** If true then try to fetch quantized elevation meshes from raster servers */
70
  rasterServerSupportsElevation?: boolean;
71
  /** How many times to retry a request if case of rasterServerServerErrorsToRetry errors */
72
  rasterServerMaxRetries?: number;
73
  /** How long between retries */
74
  rasterServerRetryDelay?: number;
75
  /** An array of HTTP status codes that should be retried when encountered. */
76
  rasterServerServerErrorsToRetry?: number[];
77
  /** Maximum number of simultaneous requests per raster server. 0 - no limit */
78
  rasterServerMaxPerServerRequests?: number;
79
  /** Whether to show the server input field in the raster tile layer setup form */
80
  rasterServerShowServerInput?: boolean;
81

82
  // WMS layer config -- Experimental
83
  // WMS layer is under development and not ready for production use. Disabled by default.
84
  enableWMSLayer?: boolean;
85

86
  // Image export config
87
  /** Whether to apply fix for uglify error in dom-to-image (should be true for webpack builds, false for Vite) */
88
  escapeXhtmlForWebpack?: boolean;
89
};
90

91
const DEFAULT_APPLICATION_CONFIG: Required<KeplerApplicationConfig> = {
15✔
92
  defaultHtmlName: 'kepler.gl.html',
93
  defaultImageName: 'kepler.gl.png',
94
  defaultJsonName: 'kepler.gl.json',
95
  defaultDataName: 'kepler.gl',
96
  defaultExportJsonSettings: {
97
    hasData: true
98
  },
99

100
  baseMapLibraryConfig: {
101
    maplibre: {
102
      getMapLib: () => import('maplibre-gl'),
29✔
103
      mapLibCssClass: 'maplibregl',
104
      mapLibAttributionCssClass: 'maplibre-attribution-container',
105
      mapLibName: 'MapLibre',
106
      mapLibUrl: 'https://www.maplibre.org/'
107
    },
108
    mapbox: {
109
      getMapLib: () => import('mapbox-gl'),
×
110
      mapLibCssClass: 'mapboxgl',
111
      mapLibAttributionCssClass: 'mapbox-attribution-container',
112
      mapLibName: 'Mapbox',
113
      mapLibUrl: 'https://www.mapbox.com/'
114
    }
115
  },
116

117
  cdnUrl: KEPLER_UNFOLDED_BUCKET,
118

119
  plugins: [],
120
  // The default table class is KeplerTable.
121
  // TODO include KeplerTable here when the circular dependency with @kepler.gl/table and @kepler.gl/utils are resolved.
122
  table: null,
123
  database: null,
124

125
  useArrowProgressiveLoading: true,
126
  showReleaseBanner: true,
127
  useOnFilteredItemsChange: false,
128

129
  // Raster Tile layer config
130
  enableRasterTileLayer: true,
131
  rasterServerUseLatestTitiler: true,
132
  rasterServerShowServerInput: true,
133
  rasterServerUrls: [], // TODO: provide a default free server or leave blank
134
  rasterServerSupportsElevation: true,
135
  rasterServerMaxRetries: 1,
136
  rasterServerRetryDelay: 10000,
137
  rasterServerServerErrorsToRetry: [503],
138
  rasterServerMaxPerServerRequests: 0,
139

140
  // WMS layer config
141
  enableWMSLayer: true,
142

143
  // Image export config
144
  // Default to true for webpack builds, false for other build tools (e.g., Vite)
145
  escapeXhtmlForWebpack: isWebpackBuild()
146
};
147

148
const applicationConfig: Required<KeplerApplicationConfig> = DEFAULT_APPLICATION_CONFIG;
15✔
149

150
export const getApplicationConfig = (): Required<KeplerApplicationConfig> => applicationConfig;
353✔
151

152
export function initApplicationConfig(appConfig: KeplerApplicationConfig = {}) {
×
153
  Object.assign(applicationConfig, appConfig);
×
154
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc