Skip to main content Link Menu Expand (external link) Document Search Copy Copied

scale

Control your data colors

Documention for this option is still work in progress, and is incomplete

type scaleOptions = {
  as: 'color' | 'opacity',
  type: 'threshold',
  domain: number[],
  scheme: string,
  range: string[] | d3-scale-chromatic
};

as

Specify the type of color type

as: 'color' | 'opacity',

type

type: 'threshold',

domain

domain: number[],

scheme

Set a color scheme.

scheme: string,

Support all schemes from d3-scale-chromatic. Just use any scheme name without the scheme prefix.

range, which allow more advanced scheme customization, will take precedence if set.

range

Define a range of colors, instead of using one the predefined scheme.

range: string[] | d3-scale-chromatic

Accepts an array of colors, a color scheme, or an color interpolator.