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.
- package/README.md +21 -21
- package/dist/src/components/src/common/link-renderer.d.ts +6 -2
- package/dist/src/components/src/index.d.ts +1 -0
- package/dist/src/components/src/map-container.d.ts +1 -0
- package/dist/src/components/src/plot-container.d.ts +1 -0
- package/dist/src/components/src/side-panel/layer-manager.d.ts +1 -0
- package/dist/src/duckdb/src/index.d.ts +1 -0
- package/dist/src/duckdb/src/processors/data-processor.d.ts +8 -0
- package/dist/src/utils/src/data-utils.d.ts +1 -0
- package/package.json +2 -2
- package/src/actions/package.json +8 -8
- package/src/ai-assistant/package.json +7 -7
- package/src/cloud-providers/package.json +2 -2
- package/src/common-utils/package.json +3 -3
- package/src/components/dist/common/link-renderer.d.ts +6 -2
- package/src/components/dist/common/link-renderer.js +1 -1
- package/src/components/dist/index.d.ts +1 -0
- package/src/components/dist/index.js +44 -1
- package/src/components/dist/map-container.d.ts +1 -0
- package/src/components/dist/map-container.js +2 -1
- package/src/components/dist/plot-container.d.ts +1 -0
- package/src/components/dist/plot-container.js +7 -4
- package/src/components/dist/side-panel/layer-manager.d.ts +1 -0
- package/src/components/dist/side-panel/layer-manager.js +5 -3
- package/src/components/dist/side-panel/layer-panel/color-scale-selector.js +16 -9
- package/src/components/package.json +16 -16
- package/src/components/src/common/link-renderer.tsx +7 -2
- package/src/components/src/index.ts +8 -0
- package/src/components/src/map-container.tsx +4 -0
- package/src/components/src/plot-container.tsx +9 -3
- package/src/components/src/side-panel/layer-manager.tsx +4 -2
- package/src/components/src/side-panel/layer-panel/color-scale-selector.tsx +22 -9
- package/src/constants/dist/default-settings.js +2 -2
- package/src/constants/node_modules/.cache/terser-webpack-plugin/content-v2/sha512/e4/a7/04d0f645deb094cab21e70c2457f3b87750bee1dfea9b3ad1d4f746ae10ff013d960af8a46b1f87a10409989d6a352c21e29a8784a161a84f83a310955e2 +1 -0
- package/src/constants/node_modules/.cache/terser-webpack-plugin/index-v5/b2/5f/6daa692cacd1234803d6a5abefef0c49aae2d1403e4d8e53140088950a04 +2 -0
- package/src/constants/package.json +2 -2
- package/src/constants/umd/keplergl.min.js +1 -1
- package/src/deckgl-arrow-layers/package.json +2 -2
- package/src/deckgl-layers/package.json +4 -4
- package/src/duckdb/dist/index.d.ts +1 -0
- package/src/duckdb/dist/index.js +24 -2
- package/src/duckdb/dist/processors/data-processor.d.ts +8 -0
- package/src/duckdb/dist/processors/data-processor.js +23 -1
- package/src/duckdb/package.json +6 -6
- package/src/duckdb/src/index.ts +5 -0
- package/src/duckdb/src/processors/data-processor.ts +25 -1
- package/src/effects/package.json +5 -5
- package/src/layers/package.json +9 -9
- package/src/localization/package.json +1 -1
- package/src/processors/package.json +7 -7
- package/src/reducers/package.json +16 -16
- package/src/schemas/package.json +7 -7
- package/src/styles/node_modules/.cache/terser-webpack-plugin/content-v2/sha512/41/e3/d873c0efff87c4438d34d09be942ff6877947926c2309949e1eea8a58722c9ebf1e9451b44f62996d3590f398318e2fd17f19613445810226c8354b7d746 +1 -0
- package/src/styles/node_modules/.cache/terser-webpack-plugin/index-v5/9d/95/efc8c9f0bdd09b105646cf5e34b067e621726ceeb296771ff7da9e2e03b4 +2 -0
- package/src/styles/package.json +2 -2
- package/src/styles/umd/keplergl.min.js +1 -1
- package/src/table/package.json +5 -5
- package/src/tasks/package.json +2 -2
- package/src/types/package.json +1 -1
- package/src/utils/dist/data-scale-utils.js +35 -16
- package/src/utils/dist/data-utils.d.ts +1 -0
- package/src/utils/dist/data-utils.js +2 -1
- package/src/utils/package.json +4 -4
- package/src/utils/src/data-scale-utils.ts +34 -21
- package/src/utils/src/data-utils.ts +1 -0
- package/umd/keplergl.min.js +1027 -1027
package/src/utils/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kepler.gl/utils",
|
|
3
3
|
"author": "Shan He <shan@uber.com>",
|
|
4
|
-
"version": "3.1.
|
|
4
|
+
"version": "3.1.10",
|
|
5
5
|
"description": "kepler.gl constants used by kepler.gl components, actions and reducers",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"main": "dist/index.js",
|
|
@@ -31,9 +31,9 @@
|
|
|
31
31
|
],
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@deck.gl/core": "^8.9.27",
|
|
34
|
-
"@kepler.gl/common-utils": "3.1.
|
|
35
|
-
"@kepler.gl/constants": "3.1.
|
|
36
|
-
"@kepler.gl/types": "3.1.
|
|
34
|
+
"@kepler.gl/common-utils": "3.1.10",
|
|
35
|
+
"@kepler.gl/constants": "3.1.10",
|
|
36
|
+
"@kepler.gl/types": "3.1.10",
|
|
37
37
|
"@loaders.gl/arrow": "^4.3.2",
|
|
38
38
|
"@luma.gl/constants": "^8.5.20",
|
|
39
39
|
"@luma.gl/core": "^8.5.20",
|
|
@@ -382,31 +382,44 @@ export function getCategoricalColorMap(
|
|
|
382
382
|
colors: string[],
|
|
383
383
|
domain: (string | number | string[] | number[] | null)[]
|
|
384
384
|
): any {
|
|
385
|
-
|
|
386
|
-
const
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
for (let i = 0; i < uniqueValues.length; ++i) {
|
|
391
|
-
if (i < colors.length) {
|
|
392
|
-
colorToUniqueValues[colors[i]] = uniqueValues[i];
|
|
393
|
-
} else {
|
|
394
|
-
colorToUniqueValues[lastColor] = [
|
|
395
|
-
...(Array.isArray(colorToUniqueValues[lastColor])
|
|
396
|
-
? colorToUniqueValues[lastColor]
|
|
397
|
-
: [colorToUniqueValues[lastColor]]),
|
|
398
|
-
uniqueValues[i]
|
|
399
|
-
];
|
|
400
|
-
}
|
|
385
|
+
const uniqueValues = unique(domain).sort();
|
|
386
|
+
const colorMap = colors.map(color => [null, color]);
|
|
387
|
+
|
|
388
|
+
if (colors.length === 0 || uniqueValues.length === 0) {
|
|
389
|
+
return colorMap;
|
|
401
390
|
}
|
|
402
391
|
|
|
403
|
-
const
|
|
404
|
-
|
|
405
|
-
|
|
392
|
+
const lastIndex = colors.length - 1;
|
|
393
|
+
const assignCount = Math.min(lastIndex, uniqueValues.length);
|
|
394
|
+
|
|
395
|
+
// Assign first values one-to-one up to the penultimate color (if any)
|
|
396
|
+
for (let i = 0; i < assignCount; i++) {
|
|
397
|
+
// @ts-ignore tuple
|
|
398
|
+
colorMap[i][0] = uniqueValues[i];
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
if (uniqueValues.length > colors.length) {
|
|
402
|
+
// Aggregate the rest (including the value that would have gone to last color)
|
|
403
|
+
// Build aggregated array incrementally to match legacy behavior
|
|
404
|
+
const aggregatedValues: any[] = [];
|
|
405
|
+
for (let i = lastIndex; i < uniqueValues.length; i++) {
|
|
406
|
+
const value = uniqueValues[i];
|
|
407
|
+
if (Array.isArray(value)) {
|
|
408
|
+
// Spread array elements to match legacy flattening behavior
|
|
409
|
+
aggregatedValues.push(...(value as any[]));
|
|
410
|
+
} else {
|
|
411
|
+
aggregatedValues.push(value);
|
|
412
|
+
}
|
|
406
413
|
}
|
|
407
|
-
|
|
408
|
-
|
|
414
|
+
// @ts-ignore tuple
|
|
415
|
+
colorMap[lastIndex][0] = aggregatedValues;
|
|
416
|
+
} else if (uniqueValues.length === colors.length) {
|
|
417
|
+
// Exactly one per color
|
|
418
|
+
// @ts-ignore tuple
|
|
419
|
+
colorMap[lastIndex][0] = uniqueValues[lastIndex];
|
|
420
|
+
}
|
|
409
421
|
|
|
422
|
+
// @ts-ignore tuple
|
|
410
423
|
return colorMap;
|
|
411
424
|
}
|
|
412
425
|
|