Skip to content

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

[bug] Sort color steps (#241)

Shan Hebcb9387270fb
diff --git a/examples/demo-app/src/app.js b/examples/demo-app/src/app.js
index 8e7db9771..7f15e75ff 100644
--- a/examples/demo-app/src/app.js
+++ b/examples/demo-app/src/app.js
@@ -79,7 +79,7 @@ class App extends Component {
componentDidMount() {
// delay 2s to show the banner
- /* disable show banners
+ /* disable show banners
if (!window.localStorage.getItem('kgHideBanner')) {
window.setTimeout(this._showBanner, 3000);
}
diff --git a/src/components/side-panel/layer-panel/color-range-selector.js b/src/components/side-panel/layer-panel/color-range-selector.js
index a3679d68f..4b7134664 100644
--- a/src/components/side-panel/layer-panel/color-range-selector.js
+++ b/src/components/side-panel/layer-panel/color-range-selector.js
@@ -29,9 +29,10 @@ import Switch from 'components/common/switch';
import ColorPalette from './color-palette';
import {COLOR_RANGES} from 'constants/color-ranges';
+import {numberSort} from 'utils/data-utils';
const ALL_TYPES = uniq(COLOR_RANGES.map(c => c.type).concat(['all']));
-const ALL_STEPS = uniq(COLOR_RANGES.map(d => d.colors.length));
+const ALL_STEPS = uniq(COLOR_RANGES.map(d => d.colors.length)).sort(numberSort);
const StyledColorConfig = styled.div`
padding: 12px 12px 0 12px;