kepler.gl 3.1.9 → 3.1.10

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 (66) 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/plot-container.d.ts +1 -0
  22. package/src/components/dist/plot-container.js +7 -4
  23. package/src/components/dist/side-panel/layer-manager.d.ts +1 -0
  24. package/src/components/dist/side-panel/layer-manager.js +5 -3
  25. package/src/components/dist/side-panel/layer-panel/color-scale-selector.js +16 -9
  26. package/src/components/package.json +16 -16
  27. package/src/components/src/common/link-renderer.tsx +7 -2
  28. package/src/components/src/index.ts +8 -0
  29. package/src/components/src/map-container.tsx +4 -0
  30. package/src/components/src/plot-container.tsx +9 -3
  31. package/src/components/src/side-panel/layer-manager.tsx +4 -2
  32. package/src/components/src/side-panel/layer-panel/color-scale-selector.tsx +22 -9
  33. package/src/constants/dist/default-settings.js +2 -2
  34. package/src/constants/node_modules/.cache/terser-webpack-plugin/content-v2/sha512/e4/a7/04d0f645deb094cab21e70c2457f3b87750bee1dfea9b3ad1d4f746ae10ff013d960af8a46b1f87a10409989d6a352c21e29a8784a161a84f83a310955e2 +1 -0
  35. package/src/constants/node_modules/.cache/terser-webpack-plugin/index-v5/b2/5f/6daa692cacd1234803d6a5abefef0c49aae2d1403e4d8e53140088950a04 +2 -0
  36. package/src/constants/package.json +2 -2
  37. package/src/constants/umd/keplergl.min.js +1 -1
  38. package/src/deckgl-arrow-layers/package.json +2 -2
  39. package/src/deckgl-layers/package.json +4 -4
  40. package/src/duckdb/dist/index.d.ts +1 -0
  41. package/src/duckdb/dist/index.js +24 -2
  42. package/src/duckdb/dist/processors/data-processor.d.ts +8 -0
  43. package/src/duckdb/dist/processors/data-processor.js +23 -1
  44. package/src/duckdb/package.json +6 -6
  45. package/src/duckdb/src/index.ts +5 -0
  46. package/src/duckdb/src/processors/data-processor.ts +25 -1
  47. package/src/effects/package.json +5 -5
  48. package/src/layers/package.json +9 -9
  49. package/src/localization/package.json +1 -1
  50. package/src/processors/package.json +7 -7
  51. package/src/reducers/package.json +16 -16
  52. package/src/schemas/package.json +7 -7
  53. package/src/styles/node_modules/.cache/terser-webpack-plugin/content-v2/sha512/41/e3/d873c0efff87c4438d34d09be942ff6877947926c2309949e1eea8a58722c9ebf1e9451b44f62996d3590f398318e2fd17f19613445810226c8354b7d746 +1 -0
  54. package/src/styles/node_modules/.cache/terser-webpack-plugin/index-v5/9d/95/efc8c9f0bdd09b105646cf5e34b067e621726ceeb296771ff7da9e2e03b4 +2 -0
  55. package/src/styles/package.json +2 -2
  56. package/src/styles/umd/keplergl.min.js +1 -1
  57. package/src/table/package.json +5 -5
  58. package/src/tasks/package.json +2 -2
  59. package/src/types/package.json +1 -1
  60. package/src/utils/dist/data-scale-utils.js +35 -16
  61. package/src/utils/dist/data-utils.d.ts +1 -0
  62. package/src/utils/dist/data-utils.js +2 -1
  63. package/src/utils/package.json +4 -4
  64. package/src/utils/src/data-scale-utils.ts +34 -21
  65. package/src/utils/src/data-utils.ts +1 -0
  66. package/umd/keplergl.min.js +1027 -1027
@@ -468,6 +468,14 @@ export {
468
468
  VisConfigSwitchFactory,
469
469
  appInjector
470
470
  };
471
+ export {
472
+ DROPPABLE_MAP_CONTAINER_TYPE,
473
+ SORTABLE_LAYER_TYPE,
474
+ SORTABLE_EFFECT_TYPE,
475
+ SORTABLE_SIDE_PANEL_TYPE,
476
+ DND_MODIFIERS,
477
+ DND_EMPTY_MODIFIERS
478
+ } from './common/dnd-layer-items';
471
479
 
472
480
  // Individual Component from Dependency Tree
473
481
  export const TimeRangeSlider = appInjector.get(TimeRangeSliderFactory);
@@ -359,6 +359,9 @@ export interface MapContainerProps {
359
359
  onDeckRender?: (deckProps: Record<string, unknown>) => Record<string, unknown> | null;
360
360
  onDeckAfterRender?: (deckProps: Record<string, unknown>) => any;
361
361
  };
362
+
363
+ // Optional: override legend header logo in map controls (used by image export)
364
+ logoComponent?: React.FC | React.ReactNode;
362
365
  }
363
366
 
364
367
  export default function MapContainerFactory(
@@ -1126,6 +1129,7 @@ export default function MapContainerFactory(
1126
1129
  mapControls={mapControls}
1127
1130
  readOnly={this.props.readOnly}
1128
1131
  scale={mapState.scale || 1}
1132
+ logoComponent={this.props.logoComponent}
1129
1133
  top={
1130
1134
  interactionConfig.geocoder && interactionConfig.geocoder.enabled
1131
1135
  ? theme.mapControlTop
@@ -91,6 +91,9 @@ interface PlotContainerProps {
91
91
 
92
92
  // Flags
93
93
  enableErrorNotification?: boolean;
94
+
95
+ // Optional: override legend header logo during export
96
+ logoComponent?: React.ReactNode;
94
97
  }
95
98
 
96
99
  export default function PlotContainerFactory(
@@ -117,7 +120,8 @@ export default function PlotContainerFactory(
117
120
  addNotification,
118
121
 
119
122
  // Flags
120
- enableErrorNotification
123
+ enableErrorNotification,
124
+ logoComponent
121
125
  }: PlotContainerProps) {
122
126
  const plottingAreaRef = useRef<HTMLDivElement>(null);
123
127
  const [plotEffects] = useState<Effect[]>(() =>
@@ -288,9 +292,11 @@ export default function PlotContainerFactory(
288
292
  visState: {
289
293
  ...mapFields.visState,
290
294
  effects: plotEffects
291
- }
295
+ },
296
+ // allow overriding the legend panel logo in export
297
+ logoComponent
292
298
  }),
293
- [mapFields, scaledMapStyle, newMapState, legend, onMapRender, plotEffects]
299
+ [mapFields, scaledMapStyle, newMapState, legend, onMapRender, plotEffects, logoComponent]
294
300
  );
295
301
 
296
302
  const isSplit = splitMaps.length > 1;
@@ -54,6 +54,7 @@ type LayerManagerProps = {
54
54
  updateTableColor: ActionHandler<typeof VisStateActions.updateTableColor>;
55
55
  panelListView: PanelListView;
56
56
  panelMetadata: SidePanelItem;
57
+ showDeleteDataset?: boolean;
57
58
  } & WrappedComponentProps;
58
59
 
59
60
  export const LayerBlendingSelector = React.memo(
@@ -165,6 +166,7 @@ function LayerManagerFactory(
165
166
  layerBlending,
166
167
  overlayBlending,
167
168
  showAddDataModal,
169
+ showDeleteDataset = true,
168
170
  updateTableColor,
169
171
  showDatasetTable,
170
172
  removeDataset,
@@ -216,7 +218,7 @@ function LayerManagerFactory(
216
218
  showDatasetTable={showDatasetTable}
217
219
  updateTableColor={updateTableColor}
218
220
  removeDataset={removeDataset}
219
- showDeleteDataset
221
+ showDeleteDataset={showDeleteDataset}
220
222
  showDatasetList={!isSortByDatasetMode}
221
223
  showAddDataModal={showAddDataModal}
222
224
  />
@@ -242,7 +244,7 @@ function LayerManagerFactory(
242
244
  uiStateActions={uiStateActions}
243
245
  visStateActions={visStateActions}
244
246
  mapStateActions={mapStateActions}
245
- showDeleteDataset
247
+ showDeleteDataset={showDeleteDataset}
246
248
  />
247
249
  ) : (
248
250
  <LayerList
@@ -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 => {