How to use the d3-scale.scaleCategory10 function in d3-scale

To help you get started, we’ve selected a few d3-scale examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github react-d3 / react-d3-basic / src / commonProps.jsx View on Github external
height: height,
  margins: margins,
  x: (d) => {return +d;},
  xScale: 'linear',
  yScale: 'linear',
  showXGrid: true,
  showYGrid: true,
  showLegend: true
}

export const pieProps = {
  width: width,
  height: height,
  margins: margins,
  innerRadius: 0,
  categoricalColors: D3Scale.scaleCategory10(),
  pieSort: D3Array.descending
}
github react-d3 / react-d3-shape / src / commonProps.jsx View on Github external
width: width,
  height: height,
  margins: margins,
  y: (d) => {return +d;},
  xScale: 'linear',
  yScale: 'linear',
  showXGrid: true,
  showYGrid: true
}

export const pieProps = {
  width: width,
  height: height,
  margins: margins,
  innerRadius: 0,
  categoricalColors: D3Scale.scaleCategory10(),
  pieSort: () => {},
  pieTextShow: true
}
github react-d3 / react-d3-core / src / legend.jsx View on Github external
_series(props) {
    const {
      chartSeries,
      categoricalColors
    } = props;

    const colors = categoricalColors || D3Scale.scaleCategory10();

    return chartSeries.map(({ name, color, field }, i) => ({
      color: color || colors(i),
      name: name || field,
      field,
    }));
  }