@carto/kepler.gl 0.0.72-alpha.1 → 0.0.72-alpha.2
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/hex-column-config.js +7 -3
- package/dist/components/side-panel/layer-panel/layer-configurator.js +9 -3
- package/dist/constants/default-settings.js +1 -1
- package/dist/layers/base-layer.js +4 -4
- package/package.json +1 -1
- package/src/components/side-panel/layer-panel/hex-column-config.js +3 -2
- package/src/components/side-panel/layer-panel/layer-configurator.js +6 -1
- package/src/layers/base-layer.js +3 -3
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.72-alpha.
|
|
5
|
+
"version": "0.0.72-alpha.2",
|
|
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",
|
|
@@ -3,6 +3,7 @@ import PropTypes from 'prop-types';
|
|
|
3
3
|
import {PanelLabel} from 'components/common/styled-components';
|
|
4
4
|
import {FormattedMessage} from 'localization';
|
|
5
5
|
import React, {Component} from 'react';
|
|
6
|
+
import {ALL_FIELD_TYPES} from 'constants/default-settings';
|
|
6
7
|
|
|
7
8
|
export function HexColumnConfigFactory() {
|
|
8
9
|
class HexColumnConfig extends Component {
|
|
@@ -26,11 +27,11 @@ export function HexColumnConfigFactory() {
|
|
|
26
27
|
</div>
|
|
27
28
|
<div>
|
|
28
29
|
<FieldSelector
|
|
29
|
-
fields={fields}
|
|
30
|
+
fields={fields.filter(f => f.type === ALL_FIELD_TYPES.string)}
|
|
30
31
|
value={value}
|
|
31
32
|
placeholder={''}
|
|
32
33
|
onSelect={onSelectColumn}
|
|
33
|
-
erasable
|
|
34
|
+
erasable={false}
|
|
34
35
|
onFocus={() => null}
|
|
35
36
|
onBlur={() => null}
|
|
36
37
|
/>
|
|
@@ -51,7 +51,7 @@ import {injectIntl} from 'react-intl';
|
|
|
51
51
|
import ColorDimensionScaleSelectorFactory from './color-dimension-scale-selector';
|
|
52
52
|
import ColorSelectorFactory from './color-selector';
|
|
53
53
|
import LayerAggregationResolutionFactory from './layer-aggregation-resolution';
|
|
54
|
-
import {hexColorCustomPalette} from 'constants/color-ranges';
|
|
54
|
+
import {DEFAULT_COLOR_RANGE, hexColorCustomPalette} from 'constants/color-ranges';
|
|
55
55
|
|
|
56
56
|
const StyledLayerConfigurator = styled.div.attrs({
|
|
57
57
|
className: 'layer-panel__config'
|
|
@@ -1246,6 +1246,11 @@ export function ChannelByValueSelectorFactory(VisConfigByFieldSelector) {
|
|
|
1246
1246
|
if (visRange?.colorMap) {
|
|
1247
1247
|
onChangeVisConfig({[range]: {...visRange, colorMap: undefined}});
|
|
1248
1248
|
}
|
|
1249
|
+
if (!val) {
|
|
1250
|
+
// Clean everything and comeback to default behaviour
|
|
1251
|
+
onChange({[field]: null}, key);
|
|
1252
|
+
onChangeVisConfig({[range]: DEFAULT_COLOR_RANGE});
|
|
1253
|
+
}
|
|
1249
1254
|
onChange(
|
|
1250
1255
|
{
|
|
1251
1256
|
[field]: val,
|
package/src/layers/base-layer.js
CHANGED
|
@@ -1064,7 +1064,7 @@ class Layer {
|
|
|
1064
1064
|
}
|
|
1065
1065
|
|
|
1066
1066
|
updateLayerLegend(settings) {
|
|
1067
|
-
this.legendSettings =
|
|
1067
|
+
this.legendSettings = settings;
|
|
1068
1068
|
}
|
|
1069
1069
|
|
|
1070
1070
|
getDataUpdateTriggers({filteredIndex, id, allData}) {
|
|
@@ -1286,7 +1286,7 @@ class Layer {
|
|
|
1286
1286
|
const channelConfig = this.config.visConfig[channel.range];
|
|
1287
1287
|
const field = this.config[channel.field];
|
|
1288
1288
|
|
|
1289
|
-
if (channelConfig?.type === hexColor) {
|
|
1289
|
+
if (channelConfig?.type === hexColor && field?.colorColumn) {
|
|
1290
1290
|
const dataSetField = dataset.fields.find(f => f.name === field.colorColumn);
|
|
1291
1291
|
const colors = dataset
|
|
1292
1292
|
.getColumnLayerDomain(dataSetField, SCALE_TYPES.ordinal)
|
|
@@ -1311,7 +1311,7 @@ class Layer {
|
|
|
1311
1311
|
const channelConfig = this.config.visConfig[range];
|
|
1312
1312
|
const field = this.config[channelField];
|
|
1313
1313
|
|
|
1314
|
-
if (channelConfig?.type === hexColor) {
|
|
1314
|
+
if (channelConfig?.type === hexColor && field?.colorColumn) {
|
|
1315
1315
|
const dataSetField = dataset.fields.find(f => f.name === field.colorColumn);
|
|
1316
1316
|
const legend = dataset.calculateLegend(field, dataSetField);
|
|
1317
1317
|
legends[channel] = legend;
|