src/charts/grouped-bar.js
function prepareData(data) {
            groups = uniq(data.map((d) => getGroup(d)));
            transformedData = d3Collection.nest()
                .key(getName)
                .rollup(function (values) {
                    let ret = {};

                    values.forEach((entry) => {
                        if (entry && entry[groupLabel]) {
                            ret[entry[groupLabel]] = getValue(entry);
                        }
                    });
                    //for tooltip
                    ret.values = values;
                    return ret;
                })
                .entries(data)
                .map(function (data) {
                    return assign({}, {
                        total: d3Array.sum(d3Array.permute(data.value, groups)),
                        key: data.key
                    }, data.value);
                });
        }
function prepareData(data) {
            groups = uniq(data.map((d) => getGroup(d)));
            transformedData = d3Collection.nest()
                .key(getName)
                .rollup(function (values) {
                    let ret = {};

                    values.forEach((entry) => {
                        if (entry && entry[groupLabel]) {
                            ret[entry[groupLabel]] = getValue(entry);
                        }
                    });
                    //for tooltip
                    ret.values = values;
                    return ret;
                })
                .entries(data)
                .map(function (data) {
                    return assign({}, {
                        total: d3Array.sum(d3Array.permute(data.value, groups)),
                        key: data.key
                    }, data.value);
                });
        }
function prepareData ( data ) { groups = uniq ( data . map ( ( d ) => getGroup ( d ) ) ) ; transformedData = d3Collection . nest ( ) . key ( getName ) . rollup ( function ( values ) { let ret = { } ; values . forEach ( ( entry ) => { if ( entry && entry [ groupLabel ] ) { ret [ entry [ groupLabel ] ] = getValue ( entry ) ; } } ) ; //for tooltip ret . values = values ; return ret ; } ) . entries ( data ) . map ( function ( data ) { return assign ( { } , { total : d3Array . sum ( d3Array . permute ( data . value , groups ) ) , key : data . key } , data . value ) ; } ) ; }
Prepare data for create chart.
@private
Prepare data for create chart .