Merge pull request #243 from giraugh/main
Sort heat-map colour options alphabetically
This commit is contained in:
commit
264d18881c
|
|
@ -17,6 +17,7 @@ import {
|
||||||
} from './Settings.styles'
|
} from './Settings.styles'
|
||||||
|
|
||||||
import locales from '/src/i18n/locales'
|
import locales from '/src/i18n/locales'
|
||||||
|
import { unhyphenate } from '/src/utils'
|
||||||
|
|
||||||
// Language specific options
|
// Language specific options
|
||||||
const setDefaults = (lang, store) => {
|
const setDefaults = (lang, store) => {
|
||||||
|
|
@ -132,11 +133,9 @@ const Settings = () => {
|
||||||
id="colormap"
|
id="colormap"
|
||||||
options={{
|
options={{
|
||||||
'crabfit': t('options.colormap.classic'),
|
'crabfit': t('options.colormap.classic'),
|
||||||
...Object.fromEntries(Object.keys(maps).map(palette => [
|
...Object.fromEntries(Object.keys(maps).sort().map(palette => [
|
||||||
palette,
|
palette,
|
||||||
palette.split('-')
|
unhyphenate(palette)
|
||||||
.map(w => w[0].toLocaleUpperCase() + w.substring(1).toLocaleLowerCase())
|
|
||||||
.join(' '),
|
|
||||||
])),
|
])),
|
||||||
}}
|
}}
|
||||||
small
|
small
|
||||||
|
|
|
||||||
|
|
@ -30,3 +30,8 @@ export const detect_browser = () => {
|
||||||
if (isFirefox) return 'firefox'
|
if (isFirefox) return 'firefox'
|
||||||
if (isOpera) return 'opera'
|
if (isOpera) return 'opera'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const unhyphenate = s =>
|
||||||
|
s.split('-')
|
||||||
|
.map(w => w[0].toLocaleUpperCase() + w.substring(1).toLocaleLowerCase())
|
||||||
|
.join(' ')
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue