Skip to content

Commit 9d5b2fd

Browse files
authored
feat: add color blind friendly color pallets (#5063)
1 parent eb5f3d4 commit 9d5b2fd

File tree

5 files changed

+143
-10
lines changed

5 files changed

+143
-10
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@
166166
"@docsearch/react": "^3.0.0-alpha.37",
167167
"@influxdata/clockface": "^4.7.4",
168168
"@influxdata/flux-lsp-browser": "0.8.21",
169-
"@influxdata/giraffe": "^2.30.0",
169+
"@influxdata/giraffe": "^2.31.1",
170170
"@influxdata/influxdb-templates": "0.9.0",
171171
"@influxdata/react-custom-scrollbars": "4.3.8",
172172
"abortcontroller-polyfill": "^1.3.0",

src/shared/constants/graphColorPalettes.ts

Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -315,13 +315,133 @@ export const LINE_COLORS_SOLID_WHITE = [
315315
},
316316
]
317317

318+
export const LINE_COLORS_BLIND_DARK = [
319+
{
320+
type: COLOR_TYPE_SCALE,
321+
hex: '#000000',
322+
id: nanoid(),
323+
name: 'Color Blind Friendly - Dark',
324+
value: 0,
325+
},
326+
{
327+
type: COLOR_TYPE_SCALE,
328+
hex: '#E69F00',
329+
id: nanoid(),
330+
name: 'Color Blind Friendly - Dark',
331+
value: 0,
332+
},
333+
{
334+
type: COLOR_TYPE_SCALE,
335+
hex: '#56B4E9',
336+
id: nanoid(),
337+
name: 'Color Blind Friendly - Dark',
338+
value: 0,
339+
},
340+
{
341+
type: COLOR_TYPE_SCALE,
342+
hex: '#009E73',
343+
id: nanoid(),
344+
name: 'Color Blind Friendly - Dark',
345+
value: 0,
346+
},
347+
{
348+
type: COLOR_TYPE_SCALE,
349+
hex: '#F0E442',
350+
id: nanoid(),
351+
name: 'Color Blind Friendly - Dark',
352+
value: 0,
353+
},
354+
{
355+
type: COLOR_TYPE_SCALE,
356+
hex: '#0072B2',
357+
id: nanoid(),
358+
name: 'Color Blind Friendly - Dark',
359+
value: 0,
360+
},
361+
{
362+
type: COLOR_TYPE_SCALE,
363+
hex: '#D55E00',
364+
id: nanoid(),
365+
name: 'Color Blind Friendly - Dark',
366+
value: 0,
367+
},
368+
{
369+
type: COLOR_TYPE_SCALE,
370+
hex: '#CC79A7',
371+
id: nanoid(),
372+
name: 'Color Blind Friendly - Dark',
373+
value: 0,
374+
},
375+
]
376+
377+
export const LINE_COLORS_BLIND_LIGHT = [
378+
{
379+
type: COLOR_TYPE_SCALE,
380+
hex: '#FFFFFF',
381+
id: nanoid(),
382+
name: 'Color Blind Friendly - Light',
383+
value: 0,
384+
},
385+
{
386+
type: COLOR_TYPE_SCALE,
387+
hex: '#E69F00',
388+
id: nanoid(),
389+
name: 'Color Blind Friendly - Light',
390+
value: 0,
391+
},
392+
{
393+
type: COLOR_TYPE_SCALE,
394+
hex: '#56B4E9',
395+
id: nanoid(),
396+
name: 'Color Blind Friendly - Light',
397+
value: 0,
398+
},
399+
{
400+
type: COLOR_TYPE_SCALE,
401+
hex: '#009E73',
402+
id: nanoid(),
403+
name: 'Color Blind Friendly - Light',
404+
value: 0,
405+
},
406+
{
407+
type: COLOR_TYPE_SCALE,
408+
hex: '#F0E442',
409+
id: nanoid(),
410+
name: 'Color Blind Friendly - Light',
411+
value: 0,
412+
},
413+
{
414+
type: COLOR_TYPE_SCALE,
415+
hex: '#0072B2',
416+
id: nanoid(),
417+
name: 'Color Blind Friendly - Light',
418+
value: 0,
419+
},
420+
{
421+
type: COLOR_TYPE_SCALE,
422+
hex: '#D55E00',
423+
id: nanoid(),
424+
name: 'Color Blind Friendly - Light',
425+
value: 0,
426+
},
427+
{
428+
type: COLOR_TYPE_SCALE,
429+
hex: '#CC79A7',
430+
id: nanoid(),
431+
name: 'Color Blind Friendly - Light',
432+
value: 0,
433+
},
434+
]
435+
318436
export const DEFAULT_LINE_COLORS = LINE_COLORS_A
319437

320438
export const LINE_COLOR_SCALES = [
321439
LINE_COLORS_A,
322440
LINE_COLORS_B,
323441
LINE_COLORS_C,
324442
LINE_COLORS_D,
443+
LINE_COLORS_BLIND_LIGHT,
444+
LINE_COLORS_BLIND_DARK,
325445
LINE_COLORS_E,
326446
LINE_COLORS_F,
327447
LINE_COLORS_G,

src/shared/constants/index.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
import {
2-
Config,
3-
NINETEEN_EIGHTY_FOUR,
42
ATLANTIS,
5-
DO_ANDROIDS_DREAM,
6-
DELOREAN,
3+
COLOR_BLIND_FRIENDLY_DARK,
4+
COLOR_BLIND_FRIENDLY_LIGHT,
75
CTHULHU,
6+
Config,
7+
DELOREAN,
8+
DO_ANDROIDS_DREAM,
89
ECTOPLASM,
10+
NINETEEN_EIGHTY_FOUR,
911
T_MAX_400_FILM,
1012
} from '@influxdata/giraffe'
1113
import {InfluxColors} from '@influxdata/clockface'
@@ -146,6 +148,8 @@ export const GIRAFFE_COLOR_SCHEMES = [
146148
{name: 'Atlantis', colors: ATLANTIS},
147149
{name: 'Do Androids Dream of Electric Sheep?', colors: DO_ANDROIDS_DREAM},
148150
{name: 'Delorean', colors: DELOREAN},
151+
{name: 'Color Blind Friendly - Light', colors: COLOR_BLIND_FRIENDLY_LIGHT},
152+
{name: 'Color Blind Friendly - Dark', colors: COLOR_BLIND_FRIENDLY_DARK},
149153
{name: 'Cthulhu', colors: CTHULHU},
150154
{name: 'Ectoplasm', colors: ECTOPLASM},
151155
{name: 'T-MAX 400 Film', colors: T_MAX_400_FILM},

src/visualization/types/Heatmap/options.tsx

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
// Libraries
22
import React, {FC, ChangeEvent, useState} from 'react'
3-
import {VIRIDIS, MAGMA, INFERNO, PLASMA} from '@influxdata/giraffe'
3+
import {
4+
COLOR_BLIND_FRIENDLY_DARK,
5+
COLOR_BLIND_FRIENDLY_LIGHT,
6+
INFERNO,
7+
MAGMA,
8+
PLASMA,
9+
VIRIDIS,
10+
} from '@influxdata/giraffe'
411
import {
512
Form,
613
Grid,
@@ -33,6 +40,8 @@ const HEATMAP_COLOR_SCHEMES = [
3340
{name: 'Inferno', colors: INFERNO},
3441
{name: 'Viridis', colors: VIRIDIS},
3542
{name: 'Plasma', colors: PLASMA},
43+
{name: 'Color Blind Friendly - Light', colors: COLOR_BLIND_FRIENDLY_LIGHT},
44+
{name: 'Color Blind Friendly - Dark', colors: COLOR_BLIND_FRIENDLY_DARK},
3645
]
3746

3847
interface Props extends VisualizationOptionProps {

yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1471,10 +1471,10 @@
14711471
resolved "https://registry.yarnpkg.com/@influxdata/flux-lsp-browser/-/flux-lsp-browser-0.8.21.tgz#28b1ab5d2b9f3130a616628f8da95fc4b886dfc6"
14721472
integrity sha512-N/O9ZfePb7TjgVjecFekBkU5iIW2Ld1FPDE8iuirg5WQMdka9ZLvpCn0jcfUUD3C8mJyBt5gj5+VQe+oSgH49Q==
14731473

1474-
"@influxdata/giraffe@^2.30.0":
1475-
version "2.30.0"
1476-
resolved "https://registry.yarnpkg.com/@influxdata/giraffe/-/giraffe-2.30.0.tgz#c399ffaa32a696e2a8c94f377b3cc76123268b5b"
1477-
integrity sha512-3YZI3PGf//6JbKRYMVyNOlClWdlEmuxqib+D8p84A3W1XIGcgm1j2thx1HeSnAmELMYXv92ugKiDGLaVwYuCwA==
1474+
"@influxdata/giraffe@^2.31.1":
1475+
version "2.31.1"
1476+
resolved "https://registry.yarnpkg.com/@influxdata/giraffe/-/giraffe-2.31.1.tgz#c16211e93c392b612401d208950f0d01925efb74"
1477+
integrity sha512-DhJzm7e3Yk9pTE+y3g4qrcCbfDwMpduGKKmcR9mQjaErEnqLGCtyCgNi6Uo1qMppxRJ0CdZyHkIXV4D1oT8syg==
14781478
dependencies:
14791479
merge-images "^2.0.0"
14801480

0 commit comments

Comments
 (0)