Skip to content

Commit d2f53b4

Browse files
committed
Add titles to color palettes, restore original type
1 parent fe7b19f commit d2f53b4

2 files changed

Lines changed: 20 additions & 1 deletion

File tree

x-pack/platform/plugins/shared/maps/public/classes/styles/color_palettes.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ const YELLOW = 'rgb(256, 256, 0)';
3737
const RED = 'rgb(256, 0, 0)';
3838
const HEATMAP_PALETTE = [ROYAL_BLUE, CYAN, LIME, YELLOW, RED];
3939

40-
type COLOR_PALETTE = Omit<EuiColorPalettePickerPaletteProps, 'title'> & {
40+
type COLOR_PALETTE = EuiColorPalettePickerPaletteProps & {
4141
getPalette: (steps: number) => string[];
4242
};
4343

@@ -49,6 +49,7 @@ function getColorBlindPalette(steps: number) {
4949

5050
const COLOR_PALETTES: COLOR_PALETTE[] = [
5151
{
52+
title: 'Blues',
5253
value: 'Blues',
5354
getPalette: (steps: number) => {
5455
return euiPaletteCool(steps);
@@ -57,6 +58,7 @@ const COLOR_PALETTES: COLOR_PALETTE[] = [
5758
type: 'gradient',
5859
},
5960
{
61+
title: 'Greens',
6062
value: 'Greens',
6163
getPalette: (steps: number) => {
6264
return euiPaletteGreen(steps);
@@ -65,6 +67,7 @@ const COLOR_PALETTES: COLOR_PALETTE[] = [
6567
type: 'gradient',
6668
},
6769
{
70+
title: 'Greys',
6871
value: 'Greys',
6972
getPalette: (steps: number) => {
7073
return euiPaletteGray(steps);
@@ -73,6 +76,7 @@ const COLOR_PALETTES: COLOR_PALETTE[] = [
7376
type: 'gradient',
7477
},
7578
{
79+
title: 'Reds',
7680
value: 'Reds',
7781
getPalette: (steps: number) => {
7882
return euiPaletteRed(steps);
@@ -81,6 +85,7 @@ const COLOR_PALETTES: COLOR_PALETTE[] = [
8185
type: 'gradient',
8286
},
8387
{
88+
title: 'Yellow to Red',
8489
value: 'Yellow to Red',
8590
getPalette: (steps: number) => {
8691
return euiPaletteWarm(steps);
@@ -89,6 +94,7 @@ const COLOR_PALETTES: COLOR_PALETTE[] = [
8994
type: 'gradient',
9095
},
9196
{
97+
title: 'Green to Red',
9298
value: 'Green to Red',
9399
getPalette: (steps: number) => {
94100
return euiPaletteForStatus(steps);
@@ -97,6 +103,7 @@ const COLOR_PALETTES: COLOR_PALETTE[] = [
97103
type: 'gradient',
98104
},
99105
{
106+
title: 'Blue to Red',
100107
value: 'Blue to Red',
101108
getPalette: (steps: number) => {
102109
return euiPaletteForTemperature(steps);
@@ -105,6 +112,7 @@ const COLOR_PALETTES: COLOR_PALETTE[] = [
105112
type: 'gradient',
106113
},
107114
{
115+
title: 'Heatmap',
108116
value: DEFAULT_HEATMAP_COLOR_RAMP_NAME,
109117
getPalette: (steps: number) => {
110118
return colorPaletteGenerator(HEATMAP_PALETTE, steps, true, true);
@@ -113,18 +121,21 @@ const COLOR_PALETTES: COLOR_PALETTE[] = [
113121
type: 'gradient',
114122
},
115123
{
124+
title: 'Color Blind',
116125
value: 'palette_0',
117126
getPalette: getColorBlindPalette,
118127
palette: euiPaletteColorBlind(),
119128
type: 'fixed',
120129
},
121130
{
131+
title: 'Color Blind (20)',
122132
value: 'palette_20',
123133
getPalette: getColorBlindPalette,
124134
palette: euiPaletteColorBlind({ rotations: 2 }),
125135
type: 'fixed',
126136
},
127137
{
138+
title: 'Color Blind (30)',
128139
value: 'palette_30',
129140
getPalette: getColorBlindPalette,
130141
palette: euiPaletteColorBlind({ rotations: 3 }),

x-pack/platform/plugins/shared/maps/public/classes/styles/heatmap/components/__snapshots__/heatmap_style_editor.test.tsx.snap

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)