Ensure colors in line graph palettes have unique IDs

pull/3122/head
Alex P 2018-04-03 21:14:34 -07:00
parent 94e39de288
commit 30163ab656
1 changed files with 23 additions and 22 deletions

View File

@ -1,4 +1,5 @@
import chroma from 'chroma-js' import chroma from 'chroma-js'
import uuid from 'uuid'
const COLOR_TYPE_SCALE = 'scale' const COLOR_TYPE_SCALE = 'scale'
@ -7,21 +8,21 @@ export const LINE_COLORS_A = [
{ {
type: COLOR_TYPE_SCALE, type: COLOR_TYPE_SCALE,
hex: '#31C0F6', hex: '#31C0F6',
id: '0', id: uuid.v4(),
name: 'Nineteen Eighty Four', name: 'Nineteen Eighty Four',
value: '0', value: '0',
}, },
{ {
type: COLOR_TYPE_SCALE, type: COLOR_TYPE_SCALE,
hex: '#A500A5', hex: '#A500A5',
id: '0', id: uuid.v4(),
name: 'Nineteen Eighty Four', name: 'Nineteen Eighty Four',
value: '0', value: '0',
}, },
{ {
type: COLOR_TYPE_SCALE, type: COLOR_TYPE_SCALE,
hex: '#FF7E27', hex: '#FF7E27',
id: '0', id: uuid.v4(),
name: 'Nineteen Eighty Four', name: 'Nineteen Eighty Four',
value: '0', value: '0',
}, },
@ -31,21 +32,21 @@ export const LINE_COLORS_B = [
{ {
type: COLOR_TYPE_SCALE, type: COLOR_TYPE_SCALE,
hex: '#74D495', hex: '#74D495',
id: '1', id: uuid.v4(),
name: 'Atlantis', name: 'Atlantis',
value: '0', value: '0',
}, },
{ {
type: COLOR_TYPE_SCALE, type: COLOR_TYPE_SCALE,
hex: '#3F3FBA', hex: '#3F3FBA',
id: '1', id: uuid.v4(),
name: 'Atlantis', name: 'Atlantis',
value: '0', value: '0',
}, },
{ {
type: COLOR_TYPE_SCALE, type: COLOR_TYPE_SCALE,
hex: '#FF4D9E', hex: '#FF4D9E',
id: '1', id: uuid.v4(),
name: 'Atlantis', name: 'Atlantis',
value: '0', value: '0',
}, },
@ -55,21 +56,21 @@ export const LINE_COLORS_C = [
{ {
type: COLOR_TYPE_SCALE, type: COLOR_TYPE_SCALE,
hex: '#8F8AF4', hex: '#8F8AF4',
id: '1', id: uuid.v4(),
name: 'Do Androids Dream of Electric Sheep?', name: 'Do Androids Dream of Electric Sheep?',
value: '0', value: '0',
}, },
{ {
type: COLOR_TYPE_SCALE, type: COLOR_TYPE_SCALE,
hex: '#A51414', hex: '#A51414',
id: '1', id: uuid.v4(),
name: 'Do Androids Dream of Electric Sheep?', name: 'Do Androids Dream of Electric Sheep?',
value: '0', value: '0',
}, },
{ {
type: COLOR_TYPE_SCALE, type: COLOR_TYPE_SCALE,
hex: '#F4CF31', hex: '#F4CF31',
id: '1', id: uuid.v4(),
name: 'Do Androids Dream of Electric Sheep?', name: 'Do Androids Dream of Electric Sheep?',
value: '0', value: '0',
}, },
@ -79,21 +80,21 @@ export const LINE_COLORS_D = [
{ {
type: COLOR_TYPE_SCALE, type: COLOR_TYPE_SCALE,
hex: '#FD7A5D', hex: '#FD7A5D',
id: '1', id: uuid.v4(),
name: 'Delorean', name: 'Delorean',
value: '0', value: '0',
}, },
{ {
type: COLOR_TYPE_SCALE, type: COLOR_TYPE_SCALE,
hex: '#5F1CF2', hex: '#5F1CF2',
id: '1', id: uuid.v4(),
name: 'Delorean', name: 'Delorean',
value: '0', value: '0',
}, },
{ {
type: COLOR_TYPE_SCALE, type: COLOR_TYPE_SCALE,
hex: '#4CE09A', hex: '#4CE09A',
id: '1', id: uuid.v4(),
name: 'Delorean', name: 'Delorean',
value: '0', value: '0',
}, },
@ -103,21 +104,21 @@ export const LINE_COLORS_E = [
{ {
type: COLOR_TYPE_SCALE, type: COLOR_TYPE_SCALE,
hex: '#FDC44F', hex: '#FDC44F',
id: '1', id: uuid.v4(),
name: 'Cthulhu', name: 'Cthulhu',
value: '0', value: '0',
}, },
{ {
type: COLOR_TYPE_SCALE, type: COLOR_TYPE_SCALE,
hex: '#007C76', hex: '#007C76',
id: '1', id: uuid.v4(),
name: 'Cthulhu', name: 'Cthulhu',
value: '0', value: '0',
}, },
{ {
type: COLOR_TYPE_SCALE, type: COLOR_TYPE_SCALE,
hex: '#8983FF', hex: '#8983FF',
id: '1', id: uuid.v4(),
name: 'Cthulhu', name: 'Cthulhu',
value: '0', value: '0',
}, },
@ -127,21 +128,21 @@ export const LINE_COLORS_F = [
{ {
type: COLOR_TYPE_SCALE, type: COLOR_TYPE_SCALE,
hex: '#DA6FF1', hex: '#DA6FF1',
id: '1', id: uuid.v4(),
name: 'Ectoplasm', name: 'Ectoplasm',
value: '0', value: '0',
}, },
{ {
type: COLOR_TYPE_SCALE, type: COLOR_TYPE_SCALE,
hex: '#00717A', hex: '#00717A',
id: '1', id: uuid.v4(),
name: 'Ectoplasm', name: 'Ectoplasm',
value: '0', value: '0',
}, },
{ {
type: COLOR_TYPE_SCALE, type: COLOR_TYPE_SCALE,
hex: '#ACFF76', hex: '#ACFF76',
id: '1', id: uuid.v4(),
name: 'Ectoplasm', name: 'Ectoplasm',
value: '0', value: '0',
}, },
@ -151,21 +152,21 @@ export const LINE_COLORS_G = [
{ {
type: COLOR_TYPE_SCALE, type: COLOR_TYPE_SCALE,
hex: '#F6F6F8', hex: '#F6F6F8',
id: '1', id: uuid.v4(),
name: 'T-Max 400 Film', name: 'T-Max 400 Film',
value: '0', value: '0',
}, },
{ {
type: COLOR_TYPE_SCALE, type: COLOR_TYPE_SCALE,
hex: '#A4A8B6', hex: '#A4A8B6',
id: '1', id: uuid.v4(),
name: 'T-Max 400 Film', name: 'T-Max 400 Film',
value: '0', value: '0',
}, },
{ {
type: COLOR_TYPE_SCALE, type: COLOR_TYPE_SCALE,
hex: '#545667', hex: '#545667',
id: '1', id: uuid.v4(),
name: 'T-Max 400 Film', name: 'T-Max 400 Film',
value: '0', value: '0',
}, },
@ -175,7 +176,7 @@ export const LINE_COLORS_RULE_GRAPH = [
{ {
type: COLOR_TYPE_SCALE, type: COLOR_TYPE_SCALE,
hex: '#4ED8A0', hex: '#4ED8A0',
id: '1', id: uuid.v4(),
name: 'Rainforest', name: 'Rainforest',
value: '0', value: '0',
}, },