@carto/kepler.gl 0.0.71-alpha.2 → 0.0.71-alpha.3
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/dist/components/side-panel/layer-panel/layer-configurator.js +8 -3
- package/dist/constants/default-settings.js +7 -4
- package/dist/layers/base-layer.js +2 -2
- package/dist/utils/custom-scales.js +28 -0
- package/package.json +2 -2
- package/src/components/side-panel/layer-panel/layer-configurator.js +11 -2
- package/src/constants/default-settings.js +5 -2
- package/src/layers/base-layer.js +1 -1
- package/src/utils/custom-scales.js +20 -0
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.scaleIdentity = scaleIdentity;
|
|
7
|
+
|
|
8
|
+
function scaleIdentity() {
|
|
9
|
+
var unknown;
|
|
10
|
+
|
|
11
|
+
function scale(x) {
|
|
12
|
+
return x === null ? unknown : x;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
scale.invert = scale;
|
|
16
|
+
scale.domain = scale.range = scaleIdentity;
|
|
17
|
+
|
|
18
|
+
scale.unknown = function (u) {
|
|
19
|
+
if (u) {
|
|
20
|
+
unknown = u;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
return scale;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
return scale;
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy91dGlscy9jdXN0b20tc2NhbGVzLmpzIl0sIm5hbWVzIjpbInNjYWxlSWRlbnRpdHkiLCJ1bmtub3duIiwic2NhbGUiLCJ4IiwiaW52ZXJ0IiwiZG9tYWluIiwicmFuZ2UiLCJ1Il0sIm1hcHBpbmdzIjoiOzs7Ozs7O0FBQU8sU0FBU0EsYUFBVCxHQUF5QjtBQUM5QixNQUFJQyxPQUFKOztBQUNBLFdBQVNDLEtBQVQsQ0FBZUMsQ0FBZixFQUFrQjtBQUNoQixXQUFPQSxDQUFDLEtBQUssSUFBTixHQUFhRixPQUFiLEdBQXVCRSxDQUE5QjtBQUNEOztBQUVERCxFQUFBQSxLQUFLLENBQUNFLE1BQU4sR0FBZUYsS0FBZjtBQUVBQSxFQUFBQSxLQUFLLENBQUNHLE1BQU4sR0FBZUgsS0FBSyxDQUFDSSxLQUFOLEdBQWNOLGFBQTdCOztBQUVBRSxFQUFBQSxLQUFLLENBQUNELE9BQU4sR0FBZ0IsVUFBQU0sQ0FBQyxFQUFJO0FBQ25CLFFBQUlBLENBQUosRUFBTztBQUNMTixNQUFBQSxPQUFPLEdBQUdNLENBQVY7QUFDRDs7QUFFRCxXQUFPTCxLQUFQO0FBQ0QsR0FORDs7QUFRQSxTQUFPQSxLQUFQO0FBQ0QiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgZnVuY3Rpb24gc2NhbGVJZGVudGl0eSgpIHtcbiAgbGV0IHVua25vd247XG4gIGZ1bmN0aW9uIHNjYWxlKHgpIHtcbiAgICByZXR1cm4geCA9PT0gbnVsbCA/IHVua25vd24gOiB4O1xuICB9XG5cbiAgc2NhbGUuaW52ZXJ0ID0gc2NhbGU7XG5cbiAgc2NhbGUuZG9tYWluID0gc2NhbGUucmFuZ2UgPSBzY2FsZUlkZW50aXR5O1xuXG4gIHNjYWxlLnVua25vd24gPSB1ID0+IHtcbiAgICBpZiAodSkge1xuICAgICAgdW5rbm93biA9IHU7XG4gICAgfVxuXG4gICAgcmV0dXJuIHNjYWxlO1xuICB9O1xuXG4gIHJldHVybiBzY2FsZTtcbn1cbiJdfQ==
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@carto/kepler.gl",
|
|
3
3
|
"author": "CARTO",
|
|
4
4
|
"homepage": "https://github.com/CartoDB/carto-kepler#readme",
|
|
5
|
-
"version": "0.0.71-alpha.
|
|
5
|
+
"version": "0.0.71-alpha.3",
|
|
6
6
|
"description": "kepler.gl is a webgl based application to visualize large scale location data in the browser",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"main": "dist/index.js",
|
|
@@ -136,7 +136,7 @@
|
|
|
136
136
|
"react-redux": "^7.1.3",
|
|
137
137
|
"react-sortable-hoc": "^1.8.3",
|
|
138
138
|
"react-tooltip": "^4.2.10",
|
|
139
|
-
"react-virtualized": "
|
|
139
|
+
"react-virtualized": "git+https://git@github.com/remorses/react-virtualized-fixed-import.git#9.22.3",
|
|
140
140
|
"react-vis": "^1.8.0",
|
|
141
141
|
"redux": "^4.0.5",
|
|
142
142
|
"redux-actions": "^2.2.1",
|
|
@@ -41,7 +41,11 @@ import TextLabelPanelFactory from './text-label-panel';
|
|
|
41
41
|
|
|
42
42
|
import {capitalizeFirstLetter} from 'utils/utils';
|
|
43
43
|
|
|
44
|
-
import {
|
|
44
|
+
import {
|
|
45
|
+
CHANNEL_SCALES,
|
|
46
|
+
CHANNEL_SCALE_SUPPORTED_FIELDS,
|
|
47
|
+
SCALE_TYPES
|
|
48
|
+
} from 'constants/default-settings';
|
|
45
49
|
import {LAYER_TYPES} from 'layers/types';
|
|
46
50
|
import {injectIntl} from 'react-intl';
|
|
47
51
|
import ColorDimensionScaleSelectorFactory from './color-dimension-scale-selector';
|
|
@@ -1139,6 +1143,7 @@ export function LayerColorRangeSelectorFactory(ColorSelector) {
|
|
|
1139
1143
|
onChange,
|
|
1140
1144
|
property = 'colorRange',
|
|
1141
1145
|
field = 'colorField',
|
|
1146
|
+
scale = 'colorScale',
|
|
1142
1147
|
setColorUI,
|
|
1143
1148
|
fields
|
|
1144
1149
|
} = this.props;
|
|
@@ -1154,6 +1159,9 @@ export function LayerColorRangeSelectorFactory(ColorSelector) {
|
|
|
1154
1159
|
selectedColor: layer.config.visConfig[property],
|
|
1155
1160
|
isRange: true,
|
|
1156
1161
|
setColor: colorRange => {
|
|
1162
|
+
layer.updateLayerConfig({
|
|
1163
|
+
[scale]: SCALE_TYPES.ordinal
|
|
1164
|
+
});
|
|
1157
1165
|
const {colorMap} = layer.config.visConfig[property];
|
|
1158
1166
|
const colorRangeUpdated = colorMap
|
|
1159
1167
|
? layer.updateColorMap(property, colorMap, colorRange)
|
|
@@ -1170,7 +1178,8 @@ export function LayerColorRangeSelectorFactory(ColorSelector) {
|
|
|
1170
1178
|
...layer.config[field],
|
|
1171
1179
|
colorColumn: colorColumn?.name,
|
|
1172
1180
|
colorColumnIdx: colorColumn?.fieldIdx
|
|
1173
|
-
}
|
|
1181
|
+
},
|
|
1182
|
+
[scale]: SCALE_TYPES.identity
|
|
1174
1183
|
});
|
|
1175
1184
|
|
|
1176
1185
|
onChange({[property]: hexColorCustomPalette});
|
|
@@ -45,6 +45,7 @@ import {
|
|
|
45
45
|
import {getHTMLMapModeTileUrl} from 'utils/utils';
|
|
46
46
|
import {TOOLTIP_FORMAT_TYPES} from './tooltip';
|
|
47
47
|
import {LAYER_TYPES} from 'layers/types';
|
|
48
|
+
import {scaleIdentity} from 'utils/custom-scales';
|
|
48
49
|
|
|
49
50
|
export const ACTION_PREFIX = '@@kepler.gl/';
|
|
50
51
|
export const CLOUDFRONT = 'https://d1a3f4spazzrp4.cloudfront.net/kepler.gl';
|
|
@@ -310,7 +311,8 @@ export const SCALE_TYPES = keyMirror({
|
|
|
310
311
|
point: null,
|
|
311
312
|
custom: null,
|
|
312
313
|
// UI-only type, resolving as custom
|
|
313
|
-
logarithmic: null
|
|
314
|
+
logarithmic: null,
|
|
315
|
+
identity: null
|
|
314
316
|
});
|
|
315
317
|
|
|
316
318
|
export const SCALE_FUNC = {
|
|
@@ -321,7 +323,8 @@ export const SCALE_FUNC = {
|
|
|
321
323
|
[SCALE_TYPES.sqrt]: scaleSqrt,
|
|
322
324
|
[SCALE_TYPES.log]: scaleLog,
|
|
323
325
|
[SCALE_TYPES.point]: scalePoint,
|
|
324
|
-
[SCALE_TYPES.custom]: scaleThreshold
|
|
326
|
+
[SCALE_TYPES.custom]: scaleThreshold,
|
|
327
|
+
[SCALE_TYPES.identity]: scaleIdentity
|
|
325
328
|
};
|
|
326
329
|
|
|
327
330
|
export const ALL_FIELD_TYPES = keyMirror({
|
package/src/layers/base-layer.js
CHANGED
|
@@ -1195,7 +1195,7 @@ class Layer {
|
|
|
1195
1195
|
validateScale(channel) {
|
|
1196
1196
|
const visualChannel = this.visualChannels[channel];
|
|
1197
1197
|
const {scale} = visualChannel;
|
|
1198
|
-
if (!scale) {
|
|
1198
|
+
if (!scale || this.config[scale] === SCALE_TYPES.identity) {
|
|
1199
1199
|
// visualChannel doesn't have scale
|
|
1200
1200
|
return;
|
|
1201
1201
|
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export function scaleIdentity() {
|
|
2
|
+
let unknown;
|
|
3
|
+
function scale(x) {
|
|
4
|
+
return x === null ? unknown : x;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
scale.invert = scale;
|
|
8
|
+
|
|
9
|
+
scale.domain = scale.range = scaleIdentity;
|
|
10
|
+
|
|
11
|
+
scale.unknown = u => {
|
|
12
|
+
if (u) {
|
|
13
|
+
unknown = u;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
return scale;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
return scale;
|
|
20
|
+
}
|