Skip to content

Kepler.gl is a powerful open source geospatial analysis tool for large-scale data sets.

[Bug] Fixed bug when reversing color schema (#1296)

Giuseppe Macrì42acc1cf0056
diff --git a/src/reducers/vis-state-updaters.js b/src/reducers/vis-state-updaters.js
index c7078e872..772961e26 100644
--- a/src/reducers/vis-state-updaters.js
+++ b/src/reducers/vis-state-updaters.js
@@ -652,6 +652,9 @@ export const addFilterUpdater = (state, action) =>
*/
export const layerColorUIChangeUpdater = (state, {oldLayer, prop, newConfig}) => {
const newLayer = oldLayer.updateLayerColorUI(prop, newConfig);
+ if (prop === 'colorRange') {
+ return layerVisConfigChangeUpdater(state, {oldLayer, newVisConfig: newLayer.config.visConfig});
+ }
return {
...state,
layers: state.layers.map(l => (l.id === oldLayer.id ? newLayer : l))