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'
|
||||
|
||||
import locales from '/src/i18n/locales'
|
||||
import { unhyphenate } from '/src/utils'
|
||||
|
||||
// Language specific options
|
||||
const setDefaults = (lang, store) => {
|
||||
|
|
@ -132,11 +133,9 @@ const Settings = () => {
|
|||
id="colormap"
|
||||
options={{
|
||||
'crabfit': t('options.colormap.classic'),
|
||||
...Object.fromEntries(Object.keys(maps).map(palette => [
|
||||
...Object.fromEntries(Object.keys(maps).sort().map(palette => [
|
||||
palette,
|
||||
palette.split('-')
|
||||
.map(w => w[0].toLocaleUpperCase() + w.substring(1).toLocaleLowerCase())
|
||||
.join(' '),
|
||||
unhyphenate(palette)
|
||||
])),
|
||||
}}
|
||||
small
|
||||
|
|
|
|||
|
|
@ -30,3 +30,8 @@ export const detect_browser = () => {
|
|||
if (isFirefox) return 'firefox'
|
||||
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