Replace hardcoded default colors with defaults in setupColors.js (#8510)

This commit is contained in:
Ville Brofeldt 2019-11-07 20:01:59 +02:00 committed by GitHub
parent ec476fc67e
commit 397e1e3d40
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

View File

@ -375,7 +375,7 @@ export const controls = {
choices: () => sequentialSchemeRegistry
.values()
.map(value => [value.id, value.label]),
default: 'blue_white_yellow',
default: sequentialSchemeRegistry.getDefaultKey(),
clearable: false,
description: '',
renderTrigger: true,
@ -2066,7 +2066,7 @@ export const controls = {
color_scheme: {
type: 'ColorSchemeControl',
label: t('Color Scheme'),
default: 'bnbColors',
default: categoricalSchemeRegistry.getDefaultKey(),
renderTrigger: true,
choices: () => categoricalSchemeRegistry.keys().map(s => ([s, s])),
description: t('The color scheme for rendering chart'),

View File

@ -40,4 +40,5 @@ export default function setupColors() {
sequentialSchemeRegistry.registerValue(scheme.id, scheme);
});
});
sequentialSchemeRegistry.setDefaultKey('blue_white_yellow');
}