src/charts/stacked-area.js
/**
         * Creates the x, y and color scales of the chart
         * @private
         */
Creates the x, y and color scales of the chart
@private
Creates the x y and color scales of the chart @private
function buildScales() {
            xScale = d3Scale.scaleTime()
                .domain(d3Array.extent(data, ({date}) => date))
                .rangeRound([0, chartWidth]);
            yScale = d3Scale.scaleLinear()
                .domain([0, getMaxValueByDate()])
                .rangeRound([chartHeight, 0])
                .nice();
            colorScale = d3Scale.scaleOrdinal()
                .range(colorSchema)
                .domain(data.map(getName));
            let range = colorScale.range();
            categoryColorMap = colorScale
                .domain()
                .reduce((memo, item, i) => {
                    memo[item] = range[i];
                    return memo;
                }, {});
        }
function buildScales ( ) { xScale = d3Scale . scaleTime ( ) . domain ( d3Array . extent ( data , ( { date } ) => date ) ) . rangeRound ( [ 0 , chartWidth ] ) ; yScale = d3Scale . scaleLinear ( ) . domain ( [ 0 , getMaxValueByDate ( ) ] ) . rangeRound ( [ chartHeight , 0 ] ) . nice ( ) ; colorScale = d3Scale . scaleOrdinal ( ) . range ( colorSchema ) . domain ( data . map ( getName ) ) ; let range = colorScale . range ( ) ; categoryColorMap = colorScale . domain ( ) . reduce ( ( memo , item , i ) => { memo [ item ] = range [ i ] ; return memo ; } , { } ) ; }
Creates the x, y and color scales of the chart
 @private
Creates the x y and color scales of the chart @private