Color Scales

We provide a few default color scales that can be used as-is. They are based off the color scales as implemented in d3-scale-chromatic.

Color scales can be applied to any variable of type quantitative, categorical, interval, .

Prop definition

<vgg-symbol
	:stroke="{ val: value, scale: { type: 'category10', domain: 'categorical' } }">

val is set to the value that the color scale will be mapped against. domain is set to the domain of val.

Categorical

category10

10 categorical colors

This is the default set of colors for categorical data.

accent

accent color scale

dark2

dark2 color scale

paired

paired color scale

pastel1

pastel1 color scale

pastel2

pastel2 color scale

set1

set1 color scale

set2

set2 color scale

set3

set3 color scale

Quantitative

brownBlue

brown blue color scale

purpleGreen

purple green color scale

pinkGreen

pink green color scale

purpleOrange

purple orange color scale

redBlue

red blue color scale

redGray

red gray color scale

redYellowBlue

red yellow blue color scale

redYellowGreen

red yellow green color scale

spectral

spectral color scale

blues

blues color scale

greens

greens color scale

greys

greys color scale

oranges

oranges color scale

purples

purples color scale

reds

reds color scale

viridis

viridis color scale

inferno

inferno color scale

magma

magma color scale

plasma

plasma color scale

warm

warm color scale

cool

cool color scale

cubehelixDefault

cubehelix default color scale

rainbow

rainbow color scale

sinebow

sinebow color scale

Custom Color Scales

It is possible to define a custom color scale by providing a range array to the scaling options instead of type. Elements of the array can be hexadecimal codes, RGB codes or color names. The input given to domain must be the domain of the input given to val.

Prop definition

<vgg-symbol
	:fill="{ val: value, scale: { range: ['#F8766D', '#7CAE00', '#00BFC4', '#C77CFF', 'orange'], domain: [ ... ] } }"
/>