@kepler.gl/utils 3.3.0-alpha.2 → 3.3.0-alpha.20

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.
Files changed (167) hide show
  1. package/dist/application-config.d.ts +179 -0
  2. package/dist/arrow-data-container.d.ts +55 -2
  3. package/dist/camera-tour.d.ts +11 -0
  4. package/dist/camera-utils.d.ts +5 -0
  5. package/dist/cjs/aggregation.js +84 -0
  6. package/dist/cjs/application-config-types.js +6 -0
  7. package/dist/cjs/application-config.js +177 -0
  8. package/dist/cjs/arrow-data-container.js +1152 -0
  9. package/dist/cjs/browser-utils.js +17 -0
  10. package/dist/cjs/camera-tour.js +99 -0
  11. package/dist/cjs/camera-utils.js +64 -0
  12. package/dist/cjs/color-utils.js +462 -0
  13. package/dist/cjs/column-statistics.js +115 -0
  14. package/dist/cjs/data-container-interface.js +6 -0
  15. package/dist/cjs/data-container-utils.js +76 -0
  16. package/dist/cjs/data-row.js +110 -0
  17. package/dist/cjs/data-scale-utils.js +634 -0
  18. package/dist/cjs/data-utils.js +538 -0
  19. package/dist/cjs/dataset-utils.js +356 -0
  20. package/dist/cjs/dom-to-image.js +433 -0
  21. package/dist/cjs/dom-utils.js +349 -0
  22. package/dist/cjs/editor-feature-utils.js +177 -0
  23. package/dist/cjs/effect-utils.js +340 -0
  24. package/dist/cjs/export-map-html.js +112 -0
  25. package/dist/cjs/export-utils.js +318 -0
  26. package/dist/cjs/extract-dataset-utils.js +218 -0
  27. package/dist/cjs/filter-utils.js +1749 -0
  28. package/dist/cjs/format.js +38 -0
  29. package/dist/cjs/gl-utils.js +118 -0
  30. package/dist/{index.js → cjs/index.js} +384 -10
  31. package/dist/cjs/indexed-data-container.js +214 -0
  32. package/dist/cjs/jenks.js +156 -0
  33. package/dist/cjs/locale-utils.js +39 -0
  34. package/dist/cjs/map-info-utils.js +41 -0
  35. package/dist/cjs/map-style-utils/mapbox-gl-style-editor.js +198 -0
  36. package/dist/cjs/map-style-utils/mapbox-utils.js +155 -0
  37. package/dist/cjs/map-utils.js +76 -0
  38. package/dist/cjs/mapbox-utils.js +19 -0
  39. package/dist/cjs/notifications-utils.js +69 -0
  40. package/dist/cjs/observe-dimensions.js +136 -0
  41. package/dist/cjs/plot.js +1502 -0
  42. package/dist/cjs/position-utils.js +29 -0
  43. package/dist/cjs/projection-utils.js +141 -0
  44. package/dist/cjs/quick-insertion-sort.js +132 -0
  45. package/dist/cjs/row-data-container.js +291 -0
  46. package/dist/cjs/slider-scale-utils.js +138 -0
  47. package/dist/cjs/split-map-utils.js +117 -0
  48. package/dist/cjs/strings.js +16 -0
  49. package/dist/cjs/theme-utils.js +46 -0
  50. package/dist/cjs/time.js +321 -0
  51. package/dist/cjs/types.js +6 -0
  52. package/dist/cjs/utils.js +224 -0
  53. package/dist/column-statistics.d.ts +54 -0
  54. package/dist/data-container-interface.d.ts +16 -1
  55. package/dist/data-container-utils.d.ts +2 -1
  56. package/dist/data-scale-utils.d.ts +5 -0
  57. package/dist/data-utils.d.ts +3 -3
  58. package/dist/dataset-utils.d.ts +11 -28
  59. package/dist/editor-feature-utils.d.ts +30 -0
  60. package/dist/esm/aggregation.js +75 -0
  61. package/dist/esm/application-config-types.js +3 -0
  62. package/dist/esm/application-config.js +166 -0
  63. package/dist/esm/arrow-data-container.js +1136 -0
  64. package/dist/esm/browser-utils.js +11 -0
  65. package/dist/esm/camera-tour.js +92 -0
  66. package/dist/esm/camera-utils.js +56 -0
  67. package/dist/esm/color-utils.js +435 -0
  68. package/dist/esm/column-statistics.js +105 -0
  69. package/dist/esm/data-container-interface.js +3 -0
  70. package/dist/esm/data-container-utils.js +68 -0
  71. package/dist/esm/data-row.js +106 -0
  72. package/dist/esm/data-scale-utils.js +602 -0
  73. package/dist/esm/data-utils.js +504 -0
  74. package/dist/esm/dataset-utils.js +347 -0
  75. package/dist/esm/dom-to-image.js +426 -0
  76. package/dist/esm/dom-utils.js +323 -0
  77. package/dist/esm/editor-feature-utils.js +164 -0
  78. package/dist/esm/effect-utils.js +333 -0
  79. package/dist/esm/export-map-html.js +107 -0
  80. package/dist/esm/export-utils.js +297 -0
  81. package/dist/esm/extract-dataset-utils.js +206 -0
  82. package/dist/esm/filter-utils.js +1688 -0
  83. package/dist/esm/format.js +31 -0
  84. package/dist/esm/gl-utils.js +113 -0
  85. package/dist/esm/index.js +55 -0
  86. package/dist/esm/indexed-data-container.js +210 -0
  87. package/dist/esm/jenks.js +149 -0
  88. package/dist/esm/locale-utils.js +36 -0
  89. package/dist/esm/map-info-utils.js +35 -0
  90. package/dist/esm/map-style-utils/mapbox-gl-style-editor.js +188 -0
  91. package/dist/esm/map-style-utils/mapbox-utils.js +144 -0
  92. package/dist/esm/map-utils.js +72 -0
  93. package/dist/esm/mapbox-utils.js +13 -0
  94. package/dist/esm/notifications-utils.js +63 -0
  95. package/dist/esm/observe-dimensions.js +128 -0
  96. package/dist/esm/plot.js +1460 -0
  97. package/dist/esm/position-utils.js +22 -0
  98. package/dist/esm/projection-utils.js +131 -0
  99. package/dist/{quick-insertion-sort.js → esm/quick-insertion-sort.js} +4 -11
  100. package/dist/esm/row-data-container.js +286 -0
  101. package/dist/esm/slider-scale-utils.js +129 -0
  102. package/dist/esm/split-map-utils.js +109 -0
  103. package/dist/esm/strings.js +10 -0
  104. package/dist/esm/theme-utils.js +38 -0
  105. package/dist/esm/time.js +308 -0
  106. package/dist/esm/types.js +3 -0
  107. package/dist/esm/utils.js +203 -0
  108. package/dist/export-map-html.d.ts +5 -0
  109. package/dist/export-utils.d.ts +31 -3
  110. package/dist/extract-dataset-utils.d.ts +79 -0
  111. package/dist/filter-utils.d.ts +56 -7
  112. package/dist/index.d.ts +20 -9
  113. package/dist/jenks.d.ts +5 -0
  114. package/dist/map-info-utils.d.ts +11 -1
  115. package/dist/map-style-utils/mapbox-gl-style-editor.d.ts +11 -10
  116. package/dist/map-style-utils/mapbox-utils.d.ts +29 -1
  117. package/dist/plot.d.ts +187 -21
  118. package/dist/projection-utils.d.ts +6 -4
  119. package/dist/row-data-container.d.ts +19 -0
  120. package/dist/split-map-utils.d.ts +7 -0
  121. package/dist/theme-utils.d.ts +8 -0
  122. package/dist/time.d.ts +3 -3
  123. package/dist/types.d.ts +2 -0
  124. package/package.json +29 -22
  125. package/dist/aggregation.js +0 -84
  126. package/dist/application-config-types.js +0 -6
  127. package/dist/application-config.js +0 -113
  128. package/dist/arrow-data-container.js +0 -398
  129. package/dist/browser-utils.js +0 -17
  130. package/dist/color-utils.js +0 -462
  131. package/dist/data-container-interface.js +0 -6
  132. package/dist/data-container-utils.js +0 -75
  133. package/dist/data-row.js +0 -110
  134. package/dist/data-scale-utils.js +0 -620
  135. package/dist/data-utils.js +0 -532
  136. package/dist/dataset-utils.js +0 -330
  137. package/dist/dom-to-image.js +0 -433
  138. package/dist/dom-utils.js +0 -349
  139. package/dist/effect-utils.js +0 -318
  140. package/dist/export-map-html.js +0 -38
  141. package/dist/export-utils.js +0 -203
  142. package/dist/filter-utils.js +0 -1274
  143. package/dist/format.js +0 -38
  144. package/dist/gl-utils.js +0 -118
  145. package/dist/indexed-data-container.js +0 -214
  146. package/dist/locale-utils.js +0 -39
  147. package/dist/map-info-utils.js +0 -14
  148. package/dist/map-style-utils/mapbox-gl-style-editor.js +0 -194
  149. package/dist/map-style-utils/mapbox-utils.js +0 -107
  150. package/dist/map-utils.js +0 -72
  151. package/dist/mapbox-utils.js +0 -19
  152. package/dist/noop.d.ts +0 -1
  153. package/dist/noop.js +0 -13
  154. package/dist/notifications-utils.js +0 -69
  155. package/dist/observe-dimensions.js +0 -136
  156. package/dist/plot.js +0 -637
  157. package/dist/position-utils.js +0 -26
  158. package/dist/projection-utils.js +0 -91
  159. package/dist/row-data-container.js +0 -206
  160. package/dist/searcher-utils.d.ts +0 -1
  161. package/dist/searcher-utils.js +0 -25
  162. package/dist/slider-scale-utils.js +0 -138
  163. package/dist/split-map-utils.js +0 -99
  164. package/dist/strings.js +0 -16
  165. package/dist/time.js +0 -325
  166. package/dist/types.js +0 -6
  167. package/dist/utils.js +0 -224
@@ -16,17 +16,45 @@ export declare function calculateExportImageSize({ mapW, mapH, ratio, resolution
16
16
  } | null;
17
17
  export declare function convertToPng(sourceElem: HTMLElement, options: any): Promise<any>;
18
18
  export declare function dataURItoBlob(dataURI: string): Blob;
19
+ /**
20
+ * Turn a user-entered export name into a safe basename.
21
+ * Empty input falls back to `fallback`. Known extensions are stripped so the
22
+ * caller can add the format-specific suffix.
23
+ */
24
+ export declare function getExportFileNameBase(name: string | undefined, fallback: string): string;
25
+ /**
26
+ * Resolve a download filename with the given extension.
27
+ */
28
+ export declare function getExportFileName(name: string | undefined, fallback: string, extension: string): string;
19
29
  export declare function downloadFile(fileBlob: Blob, fileName: string): void;
20
30
  /**
21
31
  * Whether color is rgb
22
32
  * @returns
23
33
  */
24
34
  export declare function exportImage(uiStateExportImage: ExportImage, filename?: string): void;
25
- export declare function exportToJsonString(data: any): any;
26
- export declare function getMapJSON(state: any, options?: {
35
+ export declare function exportToJsonString(data: any): string;
36
+ /**
37
+ * Remove access tokens stored on layer datasets. The tileset URL and the rest
38
+ * of the metadata stay so the map can be reopened and a new key entered.
39
+ */
40
+ export declare function omitLayerApiKeys<T>(mapToSave: T): T;
41
+ type MapJsonOptions = {
27
42
  hasData?: boolean;
28
- }): any;
43
+ /** When false, access tokens stored on layer datasets are removed. */
44
+ includeLayerApiKeys?: boolean;
45
+ /** Optional application name to preserve in exported JSON metadata. */
46
+ appName?: string;
47
+ /** Optional application website to preserve in exported JSON metadata. */
48
+ appWebsite?: string;
49
+ /** Optional application icon URL to preserve in exported JSON metadata. */
50
+ appIcon?: string;
51
+ /** Optional application name color to preserve in exported JSON metadata. */
52
+ appNameColor?: string;
53
+ };
54
+ export declare function getMapJSON(state: any, options?: MapJsonOptions): any;
29
55
  export declare function exportJson(state: any, options?: any): void;
56
+ /** Prefer a non-empty user token, otherwise use the configured export token. */
57
+ export declare function resolveMapboxTokenForExport(userMapboxToken: string | null | undefined, exportMapboxAccessToken: string | null | undefined): string | undefined;
30
58
  export declare function exportHtml(state: any, options: any): void;
31
59
  export declare function exportMap(state: any, options?: {
32
60
  hasData?: boolean;
@@ -0,0 +1,79 @@
1
+ import { Feature, ProtoDatasetField } from '@kepler.gl/types';
2
+ import { DataContainerInterface } from './data-container-interface';
3
+ export type ExtractableDataset = {
4
+ type?: string;
5
+ disableDataOperation?: boolean;
6
+ fields: Array<{
7
+ name: string;
8
+ type: string;
9
+ format?: string;
10
+ analyzerType?: string;
11
+ displayName?: string;
12
+ }>;
13
+ dataContainer: DataContainerInterface;
14
+ filteredIndex?: number[];
15
+ filteredIdxCPU?: number[];
16
+ allIndexes?: number[];
17
+ };
18
+ export type ExtractableLayer = {
19
+ type?: string | null;
20
+ config: {
21
+ dataId: string | null;
22
+ label?: string;
23
+ isVisible?: boolean;
24
+ uniqueIdField?: string;
25
+ };
26
+ tileDataset?: {
27
+ getTiles?: () => readonly any[];
28
+ };
29
+ [key: string]: any;
30
+ };
31
+ export type ExtractedTable = {
32
+ kind: 'table';
33
+ fields: ProtoDatasetField[];
34
+ rows: any[][];
35
+ rowCount: number;
36
+ };
37
+ export type ExtractedGeojson = {
38
+ kind: 'geojson';
39
+ features: Array<{
40
+ type: 'Feature';
41
+ id?: string | number;
42
+ geometry: any;
43
+ properties?: Record<string, any> | null;
44
+ }>;
45
+ rowCount: number;
46
+ };
47
+ export type ExtractResult = ExtractedTable | ExtractedGeojson;
48
+ /**
49
+ * Tiled raster/WMS/3D sources have no copyable rows. Vector tiles are extractable
50
+ * from the layer's loaded tile cache, not from dataset.rows.
51
+ */
52
+ export declare function isExtractableDataset(dataset?: ExtractableDataset | null): boolean;
53
+ export declare function isVectorTileExtractLayer(layer?: ExtractableLayer | null): boolean;
54
+ export declare function isRasterTileExtractLayer(layer?: ExtractableLayer | null): boolean;
55
+ export declare function isExtractableLayer(layer: ExtractableLayer, datasets: Record<string, ExtractableDataset | undefined>): boolean;
56
+ /**
57
+ * Copy GeoJSON features from currently loaded vector tiles that intersect a drawing.
58
+ * Coverage is the current viewport/zoom tile cache, not the full tileset.
59
+ */
60
+ export declare function extractVectorTileFeaturesInsideFeature({ layer, feature }: {
61
+ layer: ExtractableLayer;
62
+ feature: Feature | null;
63
+ }): ExtractedGeojson | null;
64
+ export declare function extractRasterInsideFeature({ layer, feature }: {
65
+ layer: ExtractableLayer;
66
+ feature: Feature | null;
67
+ }): ExtractedGeojson | null;
68
+ /**
69
+ * Copy in-memory rows whose geometry falls inside a drawn polygon.
70
+ * Existing table filters (range/select/time), including GPU-backed ones via
71
+ * `filteredIdxCPU`, are applied; the polygon clip is extra.
72
+ * Vector tiles use currently loaded viewport tiles instead of dataset.rows.
73
+ * Raster tiles report whether any loaded pixels fall inside the drawing.
74
+ */
75
+ export declare function extractRowsInsideFeature({ layer, dataset, feature }: {
76
+ layer: ExtractableLayer;
77
+ dataset: ExtractableDataset;
78
+ feature: Feature | null;
79
+ }): ExtractResult | null;
@@ -14,7 +14,7 @@ export type FilterResult = {
14
14
  };
15
15
  export type FilterChanged = {
16
16
  [key in keyof FilterRecord]: {
17
- [key: string]: 'added' | 'deleted' | 'name_changed' | 'value_changed' | 'dataId_changed';
17
+ [key: string]: 'added' | 'deleted' | 'name_changed' | 'value_changed' | 'dataId_changed' | 'inverted_changed';
18
18
  } | null;
19
19
  };
20
20
  export type dataValueAccessor = (data: {
@@ -28,6 +28,7 @@ export declare const FILTER_UPDATER_PROPS: {
28
28
  dataId: "dataId";
29
29
  name: "name";
30
30
  layerId: "layerId";
31
+ endName: "endName";
31
32
  };
32
33
  export declare const FILTER_COMPONENTS: {
33
34
  select: string;
@@ -58,6 +59,23 @@ export declare const DEFAULT_FILTER_STRUCTURE: {
58
59
  };
59
60
  export declare const FILTER_ID_LENGTH = 4;
60
61
  export declare const LAYER_FILTERS: "polygon"[];
62
+ /**
63
+ * True when a timeRange filter has an end timestamp field for the given dataset.
64
+ * Features stay visible while the playback window overlaps [start, end].
65
+ */
66
+ export declare function isTimeIntervalFilter(filter: Filter, datasetIdx?: number): boolean;
67
+ /**
68
+ * Numeric interval playback uses half-open histogram bins. GPU range filters
69
+ * are inclusive and use Float32 precision, so exact bin membership must use
70
+ * the CPU path while this mode is active.
71
+ */
72
+ export declare function isNumericIntervalFilter(filter: Filter): boolean;
73
+ /**
74
+ * Interval overlap: feature [start, end] intersects window [w0, w1].
75
+ * A null/undefined end means the feature is still active (open-ended).
76
+ * Inverted intervals (end < start) are treated as invalid and hidden.
77
+ */
78
+ export declare function timeWindowOverlapsInterval(start: number | null | undefined, end: number | null | undefined, window: [number, number]): boolean;
61
79
  /**
62
80
  * Generates a filter with a dataset id as dataId
63
81
  */
@@ -119,7 +137,16 @@ export declare function validateFilterWithData<K extends KeplerTableModel<K, L>,
119
137
  export declare function getFilterProps(field: Field, fieldDomain: FieldDomain): Partial<Filter> & {
120
138
  fieldType: string;
121
139
  };
140
+ /**
141
+ * Returns whether two field types can share the same filter value and domain.
142
+ */
143
+ export declare function areFilterFieldTypesCompatible(fieldType?: string | null, candidateFieldType?: string | null): boolean;
122
144
  export declare const getPolygonFilterFunctor: (layer: any, filter: any, dataContainer: any) => (data: any) => any;
145
+ /**
146
+ * Compute the polygon-filtered indexes for each layer on a dataset. Keeping this
147
+ * independent of KeplerTable lets filter plots work with custom table classes.
148
+ */
149
+ export declare function computePolygonFilteredIndexByLayer(filters: Filter[], layers: any[], dataId: string, dataContainer: DataContainerInterface, baseFilteredIndex: number[]): Record<string, number[]>;
123
150
  /**
124
151
  * Check if a GeoJSON feature filter can be applied to a layer
125
152
  */
@@ -146,6 +173,12 @@ export declare function getFilterFunction<L extends {
146
173
  };
147
174
  id: string;
148
175
  }>(field: Field | null, dataId: string, filter: Filter, layers: L[], dataContainer: DataContainerInterface): filterFunction;
176
+ /**
177
+ * Range and time filters normally run on the GPU, which can only keep values
178
+ * inside a range. An inverted filter has to run on the CPU instead.
179
+ */
180
+ export declare function filterTypeUsesGpu(type: Filter['type']): boolean;
181
+ export declare function disableGpuIfInverted<T extends Filter>(filter: T): T;
149
182
  export declare function updateFilterDataId(dataId: string | string[]): FilterBase<LineChart>;
150
183
  export declare function filterDataByFilterTypes({ dynamicDomainFilters, cpuFilters, filterFuncs }: {
151
184
  dynamicDomainFilters: Filter[] | null;
@@ -154,6 +187,14 @@ export declare function filterDataByFilterTypes({ dynamicDomainFilters, cpuFilte
154
187
  [key: string]: filterFunction;
155
188
  };
156
189
  }, dataContainer: DataContainerInterface): FilterResult;
190
+ /**
191
+ * Histogram bins must not include the filter being plotted. GPU filters are
192
+ * already absent from filteredIndex. An inverted filter is on the CPU, so
193
+ * rebuild the index from the other CPU filters.
194
+ */
195
+ export declare function getPlotBaseIndexByDataId(datasets: {
196
+ [id: string]: any;
197
+ }, filter: Filter, layers?: any[]): Record<string, number[]> | undefined;
157
198
  /**
158
199
  * Get a record of filters based on domain type and gpu / cpu
159
200
  */
@@ -163,9 +204,9 @@ export declare function getFilterRecord(dataId: string, filters: Filter[], opt?:
163
204
  */
164
205
  export declare function diffFilters(filterRecord: FilterRecord, oldFilterRecord?: FilterRecord | Record<string, never>): FilterChanged;
165
206
  /**
166
- * Call by parsing filters from URL
167
- * Check if value of filter within filter domain, if not adjust it to match
168
- * filter domain
207
+ * Adjust a saved filter value to the current domain. Preserve explicit boolean
208
+ * predicates even when their value is absent from the domain, so restoring or
209
+ * updating a dataset does not select the opposite rows.
169
210
  *
170
211
  * @returns value - adjusted value to match filter or null to remove filter
171
212
  */
@@ -196,9 +237,9 @@ export declare function getTimestampFieldDomain(dataContainer: DataContainerInte
196
237
  export declare function formatNumberByStep(val: number, step: number, bound: 'floor' | 'ceil'): number;
197
238
  export declare function isInRange(val: any, domain: number[]): boolean;
198
239
  /**
199
- * Determines whether a point is within the provided polygon
240
+ * Determines whether a point is inside or on the boundary of the provided polygon
200
241
  *
201
- * @param point as input search [lat, lng]
242
+ * @param point as input search [lng, lat]
202
243
  * @param polygon Points must be within these (Multi)Polygon(s)
203
244
  * @return {boolean}
204
245
  */
@@ -220,7 +261,7 @@ export declare function getColumnFilterProps<K extends KeplerTableModel<K, L>, L
220
261
  } | Record<string, any>;
221
262
  export declare function updateFilterPlot<K extends KeplerTableModel<K, any>>(datasets: {
222
263
  [id: string]: K;
223
- }, filter: Filter, dataId?: string | undefined): Filter;
264
+ }, filter: Filter, dataId?: string | undefined, layers?: any[]): Filter;
224
265
  /**
225
266
  *
226
267
  * @param datasetIds list of dataset ids to be filtered
@@ -253,6 +294,14 @@ export declare function applyFilterFieldName<K extends KeplerTableModel<K, L>, L
253
294
  filter: Filter | null;
254
295
  dataset: K;
255
296
  };
297
+ /**
298
+ * Set or clear the optional end timestamp field on a timeRange filter.
299
+ * When set, animation uses interval overlap instead of a single timestamp.
300
+ */
301
+ export declare function applyTimeFilterEndFieldName<K extends KeplerTableModel<K, L>, L>(filter: Filter, datasets: Record<string, K>, datasetId: string, fieldName: string | null | undefined, filterDatasetIndex?: number): {
302
+ filter: Filter | null;
303
+ dataset: K;
304
+ };
256
305
  /**
257
306
  * Merge the domains of a filter in case it applies to multiple datasets
258
307
  */
package/dist/index.d.ts CHANGED
@@ -1,22 +1,26 @@
1
+ export { getCameraSnapshot, normalizeCameraBookmarks } from './camera-utils';
2
+ export { normalizeCameraTour, getCameraTourDuration, evaluateCameraTour } from './camera-tour';
1
3
  export { colorMaybeToRGB, colorRangeBackwardCompatibility, createLinearGradient, hasColorMap, hexToRgb, isHexColor, isRgbColor, normalizeColor, reverseColorRange, rgbToHex, addCustomPaletteColor, removeCustomPaletteColor, sortCustomPaletteColor, updateCustomPaletteColor, updateColorRangeBySelectedPalette, paletteIsSteps, paletteIsType, paletteIsColorBlindSafe, updateColorRangeByMatchingPalette, updateCustomColorRangeByColorUI, initializeCustomPalette } from './color-utils';
2
4
  export { errorNotification } from './notifications-utils';
3
5
  export { createNotification, exportImageError, successNotification } from './notifications-utils';
4
6
  export { setStyleSheetBaseHref } from './dom-utils';
5
7
  export { default as domtoimage } from './dom-to-image';
6
8
  export { getFrequency, getMode, aggregate } from './aggregation';
7
- export { adjustValueToAnimationWindow, getBinThresholds, histogramFromThreshold, histogramFromValues, histogramFromDomain, histogramFromOrdinal, runGpuFilterForPlot, updateTimeFilterPlotType } from './plot';
9
+ export { ColumnStatsType, NUMERIC_BIN_COUNT, collectColumnValues, computeColumnStats, getColumnStatistics } from './column-statistics';
10
+ export type { ColumnStats, NumericColumnStats, CategoricalColumnStats, TimeColumnStats, Quantile } from './column-statistics';
11
+ export { adjustValueToAnimationWindow, getBinThresholds, getNumericBinThresholds, getNumericPlotInterval, getNumericRangeMinimum, nextDown, nextUp, getFilterBinThresholds, intervalBinFromMarks, histogramFromThreshold, histogramFromValues, histogramFromDomain, histogramFromOrdinal, histogramFromTimeIntervals, mergePolygonLayerIndexes, runGpuFilterForPlot, updateTimeFilterPlotType, getLineChart, mergePlotGroupBy, lineChartSeriesLegend, defaultPlotGroupColorRange, PLOT_GROUP_OTHERS_NAME, PLOT_NUM_GROUPS_ALL, PLOT_NUM_GROUPS_OPTIONS, DEFAULT_PLOT_NUM_GROUPS, MAX_PLOT_NUM_GROUPS } from './plot';
8
12
  export * from './data-utils';
9
13
  export type { FieldFormatter } from './data-utils';
10
14
  export * from './strings';
11
- export { SAMPLE_TIMELINE, TIMELINE_MODES, TIME_INTERVALS_ORDERED, LayerToFilterTimeInterval, TileTimeInterval, getTimelineFromAnimationConfig, getTimelineFromFilter, filterIntervalOptions } from './time';
15
+ export { SAMPLE_TIMELINE, TIMELINE_MODES, TIME_INTERVALS_ORDERED, LayerToFilterTimeInterval, LayerTimeInterval, getTimelineFromAnimationConfig, getTimelineFromFilter, filterIntervalOptions } from './time';
12
16
  export { maybeHexToGeo, getPositionFromHexValue } from './position-utils';
13
- export { datasetColorMaker, findDefaultColorField, getFieldFormatLabels, getFormatLabels, validateInputData } from './dataset-utils';
17
+ export { datasetColorMaker, findDefaultColorField, findDefaultColorFieldWithValues, getFieldFormatLabels, getFormatLabels, validateInputData } from './dataset-utils';
14
18
  export { exportMapToHTML } from './export-map-html';
15
- export { calculateExportImageSize, convertToPng, dataURItoBlob, downloadFile, exportHtml, exportImage, exportJson, exportMap, exportToJsonString, default as exporters, getMapJSON, getScaleFromImageSize, isMSEdge } from './export-utils';
19
+ export { calculateExportImageSize, convertToPng, dataURItoBlob, downloadFile, exportHtml, exportImage, exportJson, exportMap, exportToJsonString, default as exporters, getExportFileName, getExportFileNameBase, getMapJSON, getScaleFromImageSize, isMSEdge, omitLayerApiKeys } from './export-utils';
16
20
  export { getFormatValue, getDefaultTimeFormat } from './format';
17
21
  export { getLayerBlendingParameters, patchDeckRendererForPostProcessing } from './gl-utils';
18
22
  export { flattenMessages, mergeMessages } from './locale-utils';
19
- export { isValidMapInfo } from './map-info-utils';
23
+ export { isValidMapInfo, optionalMapInfo, optionalMapText } from './map-info-utils';
20
24
  export { editBottomMapStyle, editTopMapStyle, getDefaultLayerGroupVisibility, getStyleDownloadUrl, getStyleImageIcon, mergeLayerGroupVisibility, scaleMapStyleByResolution } from './map-style-utils/mapbox-gl-style-editor';
21
25
  export { validateToken } from './mapbox-utils';
22
26
  export { default as useDimensions, observeDimensions, unobserveDimensions } from './observe-dimensions';
@@ -26,21 +30,28 @@ export * from './projection-utils';
26
30
  export * from './split-map-utils';
27
31
  export * from './utils';
28
32
  export { computeDeckEffects, fixEffectOrder, reorderEffectOrder, validateEffectParameters } from './effect-utils';
29
- export { isStyleUsingMapboxTiles, isStyleUsingOpenStreetMapTiles, mapHasOpenStreetMapAttribution, getBaseMapLibrary, transformRequest } from './map-style-utils/mapbox-utils';
33
+ export { isStyleUsingMapboxTiles, isStyleUsingOpenStreetMapTiles, mapHasOpenStreetMapAttribution, getBaseMapAttributions, getBaseMapLibrary, transformRequest } from './map-style-utils/mapbox-utils';
34
+ export type { AttributionMapLike } from './map-style-utils/mapbox-utils';
30
35
  export * from './map-utils';
31
- export { ArrowDataContainer, arrowDataTypeToAnalyzerDataType, arrowDataTypeToFieldType, isArrowTable, isArrowFixedSizeList, isArrowStruct, isArrowVector } from './arrow-data-container';
36
+ export { ArrowDataContainer, createArrowVector, convertStructToFixedSizeList, compactArrowTable, arrowDataTypeToAnalyzerDataType, arrowDataTypeToFieldType, isArrowTable, isArrowFixedSizeList, isArrowStruct, isArrowVector } from './arrow-data-container';
32
37
  export type { DataContainerInterface } from './data-container-interface';
33
38
  export { DataForm, createDataContainer, createIndexedDataContainer, getSampleData as getSampleContainerData } from './data-container-utils';
34
39
  export * from './filter-utils';
35
40
  export type { FilterChanged, FilterResult, dataValueAccessor } from './filter-utils';
36
- export { colorMapToColorBreaks, colorBreaksToColorMap, getLayerColorScale, getLegendOfScale, getLinearDomain, getLogDomain, getOrdinalDomain, getQuantileDomain, getScaleFunction, getVisualChannelScaleByZoom, initializeLayerColorMap, isNumericColorBreaks, isDomainStops, isDomainQuantile, getDomainStepsbyZoom, getThresholdsFromQuantiles, getQuantLabelFormat, getHistogramDomain, getQuantLegends, getCategoricalColorMap, getCategoricalColorScale, initCustomPaletteByCustomScale, colorMapToCategoricalColorBreaks, resetCategoricalColorMapByIndex, selectRestCategoricalColorMapByIndex, removeCategoricalValueFromColorMap, addCategoricalValuesToColorMap } from './data-scale-utils';
41
+ export * from './editor-feature-utils';
42
+ export type { EditorFeatureCollection } from './editor-feature-utils';
43
+ export { extractRowsInsideFeature, extractVectorTileFeaturesInsideFeature, extractRasterInsideFeature, isExtractableDataset, isExtractableLayer, isRasterTileExtractLayer, isVectorTileExtractLayer } from './extract-dataset-utils';
44
+ export type { ExtractableDataset, ExtractableLayer, ExtractedGeojson, ExtractedTable, ExtractResult } from './extract-dataset-utils';
45
+ export { colorMapToColorBreaks, colorBreaksToColorMap, getLayerColorScale, getLegendOfScale, getJenksDomain, getLinearDomain, getLogDomain, getOrdinalDomain, getQuantileDomain, getScaleFunction, getVisualChannelScaleByZoom, initializeLayerColorMap, isNumericColorBreaks, isDomainStops, isDomainQuantile, getDomainStepsbyZoom, getThresholdsFromQuantiles, getQuantLabelFormat, getHistogramDomain, getQuantLegends, getCategoricalColorMap, getCategoricalColorScale, initCustomPaletteByCustomScale, colorMapToCategoricalColorBreaks, resetCategoricalColorMapByIndex, selectRestCategoricalColorMapByIndex, removeCategoricalValueFromColorMap, addCategoricalValuesToColorMap } from './data-scale-utils';
37
46
  export type { ColorBreak, ColorBreakOrdinal, DomainQuantiles, DomainStops } from './data-scale-utils';
38
47
  export { DataRow } from './data-row';
39
48
  export { getApplicationConfig, initApplicationConfig } from './application-config';
40
- export type { KeplerApplicationConfig, BaseMapLibraryConfig, MapLibInstance, GetMapRef, SvgIcon } from './application-config';
49
+ export { getConfiguredThemes, shouldShowThemeSwitcher, getDefaultUiTheme, getNextUiTheme } from './theme-utils';
50
+ export type { KeplerApplicationConfig, KeplerAcceptedFileFormat, BaseMapLibraryConfig, MapLibInstance, GetMapRef, SvgIcon, ReduxLogLevel } from './application-config';
41
51
  export type { DatabaseAdapter, DatabaseConnection } from './application-config-types';
42
52
  export { isAppleDevice } from './browser-utils';
43
53
  export { default as quickInsertionSort } from './quick-insertion-sort';
54
+ export { default as naturalBreaks } from './jenks';
44
55
  export type { KeplerTableModel } from './types';
45
56
  export { valueToPosition, positionToValue, createSliderScale } from './slider-scale-utils';
46
57
  export type { SliderScaleConfig } from './slider-scale-utils';
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Permutation-based Jenks natural breaks.
3
+ * Returns k-1 thresholds for a d3 threshold scale (or fewer when unique values < k).
4
+ */
5
+ export default function naturalBreaks(data: number[], k: number): number[];
@@ -1 +1,11 @@
1
- export declare function isValidMapInfo(mapInfo: any): any;
1
+ /** Keep a name or description only when it has visible text. Blank stays unset. */
2
+ export declare function optionalMapText(value: unknown): string | undefined;
3
+ /** Title and description to persist. Omitted when both are unset. */
4
+ export declare function optionalMapInfo(info?: {
5
+ title?: unknown;
6
+ description?: unknown;
7
+ } | null): {
8
+ title?: string;
9
+ description?: string;
10
+ } | undefined;
11
+ export declare function isValidMapInfo(mapInfo: any): boolean;
@@ -2,6 +2,14 @@ import { BaseMapStyle, LayerGroup, MapState } from '@kepler.gl/types';
2
2
  export declare function getDefaultLayerGroupVisibility({ layerGroups }: {
3
3
  layerGroups: LayerGroup[];
4
4
  }): {};
5
+ type EditMapStyleArgs = {
6
+ id?: string;
7
+ mapStyle: BaseMapStyle;
8
+ visibleLayerGroups: {
9
+ [id: string]: LayerGroup | boolean;
10
+ } | false;
11
+ };
12
+ type EditMapStyle = (args: EditMapStyleArgs) => object;
5
13
  /**
6
14
  * Edit preset map style to keep only visible layers
7
15
  *
@@ -9,15 +17,7 @@ export declare function getDefaultLayerGroupVisibility({ layerGroups }: {
9
17
  * @param visibleLayerGroups - visible layers of top map
10
18
  * @returns top map style
11
19
  */
12
- export declare const editTopMapStyle: (({ mapStyle, visibleLayerGroups }: {
13
- id?: string;
14
- mapStyle: BaseMapStyle;
15
- visibleLayerGroups: {
16
- [id: string]: LayerGroup | boolean;
17
- } | false;
18
- }) => {
19
- layers: any;
20
- }) & import("lodash").MemoizedFunction;
20
+ export declare const editTopMapStyle: EditMapStyle;
21
21
  /**
22
22
  * Edit preset map style to filter out invisible layers
23
23
  *
@@ -25,7 +25,7 @@ export declare const editTopMapStyle: (({ mapStyle, visibleLayerGroups }: {
25
25
  * @param {Object} visibleLayerGroups - visible layers of bottom map
26
26
  * @returns {Object} bottom map style
27
27
  */
28
- export declare const editBottomMapStyle: (({ id, mapStyle, visibleLayerGroups }: any) => any) & import("lodash").MemoizedFunction;
28
+ export declare const editBottomMapStyle: EditMapStyle;
29
29
  export declare function getStyleDownloadUrl(styleUrl: any, accessToken: any, mapboxApiUrl: any): any;
30
30
  /**
31
31
  * Generate static map image from style Url to be used as icon
@@ -54,3 +54,4 @@ export declare function scaleMapStyleByResolution(mapboxStyle: any, scale: any):
54
54
  * @return {Object} mergedLayerGroups
55
55
  */
56
56
  export declare function mergeLayerGroupVisibility(defaultLayerGroup: any, currentLayerGroup: any): any;
57
+ export {};
@@ -6,13 +6,41 @@ import { BaseMapLibraryType } from '@kepler.gl/constants';
6
6
  */
7
7
  export declare function isStyleUsingMapboxTiles(mapStyle: any): boolean;
8
8
  export declare function isStyleUsingOpenStreetMapTiles(mapStyle: any): boolean;
9
+ /**
10
+ * Minimal structural contract for the MapLibre/Mapbox map instance used by the
11
+ * attribution helpers below. Only the members actually read are declared;
12
+ * everything is optional because these helpers may be called before the map is
13
+ * fully initialized (guarded by optional chaining + try/catch at runtime).
14
+ *
15
+ * `getSource` returns `any` on purpose: the concrete MapLibre/Mapbox source
16
+ * union (GeoJSONSource, VectorSource, …) is not structurally assignable to a
17
+ * `{attribution?}` shape, and we only ever read an optional `attribution`
18
+ * string off it. Declaring the two getters still catches passing a non-map.
19
+ */
20
+ export interface AttributionMapLike {
21
+ getStyle?: () => {
22
+ sources?: Record<string, unknown>;
23
+ } | undefined | null;
24
+ getSource?: (id: string) => any;
25
+ }
9
26
  /**
10
27
  * Checks resolved map sources for OpenStreetMap attribution.
11
28
  * CARTO basemaps don't have attribution in the raw style JSON;
12
29
  * it only appears after MapLibre resolves the TileJSON.
13
30
  * Uses map.getSource() to access the resolved source with TileJSON metadata.
14
31
  */
15
- export declare function mapHasOpenStreetMapAttribution(map: any): boolean;
32
+ export declare function mapHasOpenStreetMapAttribution(map?: AttributionMapLike | null): boolean;
33
+ /**
34
+ * Collects the attribution strings declared by the resolved map sources.
35
+ * Custom basemap styles (e.g. OpenFreeMap, OpenMapTiles) declare their own
36
+ * attribution in the source's TileJSON, which only becomes available after
37
+ * MapLibre resolves it. Unlike {@link mapHasOpenStreetMapAttribution}, this
38
+ * preserves the full attribution text instead of collapsing it to a boolean,
39
+ * so custom attributions are not lost.
40
+ * @param map the resolved MapLibre/Mapbox map instance
41
+ * @returns de-duplicated list of attribution HTML strings, order preserved
42
+ */
43
+ export declare function getBaseMapAttributions(map?: AttributionMapLike | null): string[];
16
44
  /**
17
45
  * Transform mapbox protocol so can be used with maplibre
18
46
  * @param mapboxKey mapbox api key