kepler.gl 3.1.9 → 3.2.0

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 (98) hide show
  1. package/README.md +21 -21
  2. package/dist/src/components/src/common/link-renderer.d.ts +6 -2
  3. package/dist/src/components/src/index.d.ts +1 -0
  4. package/dist/src/components/src/map-container.d.ts +1 -0
  5. package/dist/src/components/src/plot-container.d.ts +1 -0
  6. package/dist/src/components/src/side-panel/layer-manager.d.ts +1 -0
  7. package/dist/src/duckdb/src/index.d.ts +1 -0
  8. package/dist/src/duckdb/src/processors/data-processor.d.ts +8 -0
  9. package/dist/src/utils/src/data-utils.d.ts +1 -0
  10. package/package.json +2 -2
  11. package/src/actions/package.json +8 -8
  12. package/src/ai-assistant/package.json +7 -7
  13. package/src/cloud-providers/package.json +2 -2
  14. package/src/common-utils/package.json +3 -3
  15. package/src/components/dist/common/link-renderer.d.ts +6 -2
  16. package/src/components/dist/common/link-renderer.js +1 -1
  17. package/src/components/dist/index.d.ts +1 -0
  18. package/src/components/dist/index.js +44 -1
  19. package/src/components/dist/map-container.d.ts +1 -0
  20. package/src/components/dist/map-container.js +2 -1
  21. package/src/components/dist/modal-container.js +3 -3
  22. package/src/components/dist/modals/tilesets-modals/tileset-raster-form.js +38 -9
  23. package/src/components/dist/plot-container.d.ts +1 -0
  24. package/src/components/dist/plot-container.js +7 -4
  25. package/src/components/dist/side-panel/layer-manager.d.ts +1 -0
  26. package/src/components/dist/side-panel/layer-manager.js +5 -3
  27. package/src/components/dist/side-panel/layer-panel/color-scale-selector.js +16 -9
  28. package/src/components/dist/side-panel/layer-panel/raster-tile-layer-configurator.js +3 -3
  29. package/src/components/package.json +16 -16
  30. package/src/components/src/common/link-renderer.tsx +7 -2
  31. package/src/components/src/index.ts +8 -0
  32. package/src/components/src/map-container.tsx +4 -0
  33. package/src/components/src/modal-container.tsx +6 -2
  34. package/src/components/src/modals/tilesets-modals/tileset-raster-form.tsx +60 -4
  35. package/src/components/src/plot-container.tsx +9 -3
  36. package/src/components/src/side-panel/layer-manager.tsx +4 -2
  37. package/src/components/src/side-panel/layer-panel/color-scale-selector.tsx +22 -9
  38. package/src/components/src/side-panel/layer-panel/raster-tile-layer-configurator.tsx +2 -1
  39. package/src/constants/dist/default-settings.js +1 -1
  40. package/src/constants/node_modules/.cache/terser-webpack-plugin/content-v2/sha512/56/48/71c2c5381c01c063c164e15fa04b4b1f3faae02e6727f2f2daf483e15205feca68334bad721af0c6f31abb20b56d60504623838127764aab6883912e7f71 +1 -0
  41. package/src/constants/node_modules/.cache/terser-webpack-plugin/content-v2/sha512/e4/a7/04d0f645deb094cab21e70c2457f3b87750bee1dfea9b3ad1d4f746ae10ff013d960af8a46b1f87a10409989d6a352c21e29a8784a161a84f83a310955e2 +1 -0
  42. package/src/constants/node_modules/.cache/terser-webpack-plugin/index-v5/b2/5f/6daa692cacd1234803d6a5abefef0c49aae2d1403e4d8e53140088950a04 +2 -0
  43. package/src/constants/node_modules/.cache/terser-webpack-plugin/index-v5/bf/88/ea60c7619185516464a4ae21f51394966047bfdf190a5463de651c61931c +2 -0
  44. package/src/constants/package.json +2 -2
  45. package/src/constants/umd/keplergl.min.js +1 -1
  46. package/src/deckgl-arrow-layers/package.json +2 -2
  47. package/src/deckgl-layers/package.json +4 -4
  48. package/src/duckdb/dist/index.d.ts +1 -0
  49. package/src/duckdb/dist/index.js +24 -2
  50. package/src/duckdb/dist/processors/data-processor.d.ts +8 -0
  51. package/src/duckdb/dist/processors/data-processor.js +23 -1
  52. package/src/duckdb/package.json +6 -6
  53. package/src/duckdb/src/index.ts +5 -0
  54. package/src/duckdb/src/processors/data-processor.ts +25 -1
  55. package/src/effects/package.json +5 -5
  56. package/src/layers/dist/raster-tile/gpu-utils.d.ts +11 -10
  57. package/src/layers/dist/raster-tile/gpu-utils.js +7 -6
  58. package/src/layers/dist/raster-tile/image.d.ts +4 -0
  59. package/src/layers/dist/raster-tile/image.js +30 -16
  60. package/src/layers/dist/raster-tile/raster-tile-layer.d.ts +4 -0
  61. package/src/layers/dist/raster-tile/raster-tile-layer.js +18 -6
  62. package/src/layers/dist/raster-tile/request-throttle.d.ts +1 -1
  63. package/src/layers/dist/raster-tile/request-throttle.js +17 -16
  64. package/src/layers/dist/raster-tile/types.d.ts +16 -0
  65. package/src/layers/dist/raster-tile/types.js +1 -1
  66. package/src/layers/dist/raster-tile/url.d.ts +1 -1
  67. package/src/layers/dist/raster-tile/url.js +5 -4
  68. package/src/layers/package.json +9 -9
  69. package/src/layers/src/raster-tile/gpu-utils.ts +96 -78
  70. package/src/layers/src/raster-tile/image.ts +35 -9
  71. package/src/layers/src/raster-tile/raster-tile-layer.ts +23 -5
  72. package/src/layers/src/raster-tile/request-throttle.ts +10 -5
  73. package/src/layers/src/raster-tile/types.ts +19 -1
  74. package/src/layers/src/raster-tile/url.ts +10 -3
  75. package/src/localization/package.json +1 -1
  76. package/src/processors/package.json +7 -7
  77. package/src/reducers/package.json +16 -16
  78. package/src/schemas/package.json +7 -7
  79. package/src/styles/node_modules/.cache/terser-webpack-plugin/content-v2/sha512/21/4a/50f77069dbf70c6792dd82d4e149375a888e25ddddd3209e2db013be62091f79082291fa06eb518cccb111b09a778e2946c1fb7a27bb6e32f72da0ccf250 +1 -0
  80. package/src/styles/node_modules/.cache/terser-webpack-plugin/content-v2/sha512/41/e3/d873c0efff87c4438d34d09be942ff6877947926c2309949e1eea8a58722c9ebf1e9451b44f62996d3590f398318e2fd17f19613445810226c8354b7d746 +1 -0
  81. package/src/styles/node_modules/.cache/terser-webpack-plugin/index-v5/9d/95/efc8c9f0bdd09b105646cf5e34b067e621726ceeb296771ff7da9e2e03b4 +2 -0
  82. package/src/styles/node_modules/.cache/terser-webpack-plugin/index-v5/c5/b6/9c4bdb089acc30ac8a16a6b9b93898757537f7017b2f725ddb832b4614d6 +2 -0
  83. package/src/styles/package.json +2 -2
  84. package/src/styles/umd/keplergl.min.js +1 -1
  85. package/src/table/dist/tileset/vector-tile-utils.js +9 -5
  86. package/src/table/package.json +5 -5
  87. package/src/table/src/tileset/vector-tile-utils.ts +9 -6
  88. package/src/tasks/package.json +2 -2
  89. package/src/types/package.json +1 -1
  90. package/src/utils/dist/application-config.js +5 -5
  91. package/src/utils/dist/data-scale-utils.js +35 -16
  92. package/src/utils/dist/data-utils.d.ts +1 -0
  93. package/src/utils/dist/data-utils.js +2 -1
  94. package/src/utils/package.json +4 -4
  95. package/src/utils/src/application-config.ts +4 -6
  96. package/src/utils/src/data-scale-utils.ts +34 -21
  97. package/src/utils/src/data-utils.ts +1 -0
  98. package/umd/keplergl.min.js +1240 -1220
@@ -13,6 +13,7 @@ import {
13
13
  getLegendOfScale,
14
14
  initCustomPaletteByCustomScale,
15
15
  histogramFromValues,
16
+ histogramFromOrdinal,
16
17
  histogramFromThreshold,
17
18
  getHistogramDomain,
18
19
  hasColorMap
@@ -176,8 +177,17 @@ function ColorScaleSelectorFactory(
176
177
  : idx => dataset.dataContainer.rowAsArray(idx);
177
178
  }, [dataset, field]);
178
179
 
180
+ const ordinalDomain = useMemo(() => {
181
+ return layer.config[layer.visualChannels[channelKey].domain] || [];
182
+ }, [channelKey, layer.config, layer.visualChannels]);
183
+
179
184
  // aggregatedBins should be the raw data
180
185
  const allBins = useMemo(() => {
186
+ if (field?.type === ALL_FIELD_TYPES.string) {
187
+ // Use ordinal bins for string columns, as d3 could potentially generate invalid numeric bins, and crash
188
+ return histogramFromOrdinal(ordinalDomain, dataset.allIndexes, fieldValueAccessor);
189
+ }
190
+
181
191
  if (aggregatedBins) {
182
192
  return histogramFromValues(
183
193
  Object.values(aggregatedBins).map(bin => bin.i),
@@ -188,16 +198,12 @@ function ColorScaleSelectorFactory(
188
198
  return columnStats?.bins
189
199
  ? columnStats?.bins
190
200
  : histogramFromValues(dataset.allIndexes, HISTOGRAM_BINS, fieldValueAccessor);
191
- }, [aggregatedBins, columnStats, dataset, fieldValueAccessor]);
201
+ }, [aggregatedBins, columnStats, dataset, fieldValueAccessor, field?.type, ordinalDomain]);
192
202
 
193
203
  const histogramDomain = useMemo(() => {
194
204
  return getHistogramDomain({aggregatedBins, columnStats, dataset, fieldValueAccessor});
195
205
  }, [dataset, fieldValueAccessor, aggregatedBins, columnStats]);
196
206
 
197
- const ordinalDomain = useMemo(() => {
198
- return layer.config[layer.visualChannels[channelKey].domain] || [];
199
- }, [channelKey, layer.config, layer.visualChannels]);
200
-
201
207
  const isFiltered = aggregatedBins
202
208
  ? false
203
209
  : dataset.filteredIndexForDomain.length !== dataset.allIndexes.length;
@@ -207,16 +213,23 @@ function ColorScaleSelectorFactory(
207
213
  if (!isFiltered) {
208
214
  return allBins;
209
215
  }
210
- // get threholds
216
+ if (field?.type === ALL_FIELD_TYPES.string) {
217
+ return histogramFromOrdinal(
218
+ ordinalDomain as any,
219
+ dataset.filteredIndexForDomain,
220
+ fieldValueAccessor
221
+ );
222
+ }
223
+ // numeric thresholds
211
224
  const filterEmptyBins = false;
212
- const threholds = allBins.map(b => b.x0);
225
+ const thresholds = allBins.map(b => b.x0);
213
226
  return histogramFromThreshold(
214
- threholds,
227
+ thresholds,
215
228
  dataset.filteredIndexForDomain,
216
229
  fieldValueAccessor,
217
230
  filterEmptyBins
218
231
  );
219
- }, [dataset, fieldValueAccessor, allBins, isFiltered]);
232
+ }, [dataset, fieldValueAccessor, allBins, isFiltered, field?.type, ordinalDomain]);
220
233
 
221
234
  const onSelectScale = useCallback(
222
235
  val => {
@@ -336,7 +336,8 @@ function RasterTileLayerConfiguratorFactory(
336
336
 
337
337
  const elevationUI = (
338
338
  <>
339
- {getApplicationConfig().rasterServerSupportsElevation &&
339
+ {(stac.rasterServerSupportsElevation ??
340
+ getApplicationConfig().rasterServerSupportsElevation) &&
340
341
  stac.rasterTileServerUrls?.length && (
341
342
  <LayerConfigGroup
342
343
  {...(layer.visConfigSettings.enableTerrain || {label: 'layer.color'})}
@@ -101,7 +101,7 @@ var KEPLER_GL_NAME = exports.KEPLER_GL_NAME = 'kepler.gl';
101
101
  // Since we are injecting this during the build process with babel
102
102
  // while developing VERSION is not defined, we capture the exception and return
103
103
  // an empty string which will allow us to retrieve the latest umd version
104
- var KEPLER_GL_VERSION = exports.KEPLER_GL_VERSION = "3.1.9";
104
+ var KEPLER_GL_VERSION = exports.KEPLER_GL_VERSION = "3.2.0";
105
105
  var KEPLER_GL_WEBSITE = exports.KEPLER_GL_WEBSITE = 'http://kepler.gl/';
106
106
  var DIMENSIONS = exports.DIMENSIONS = {
107
107
  sidePanel: {