src/charts/legend.js
function cleanData(data) {
            hasQuantities = data.filter(hasQuantity).length === data.length;

            return data
                .reduce((acc, d) => {
                    if (d.quantity !== undefined && d.quantity !== null) {
                        d.quantity = +d.quantity;
                    }
                    d.name = String(d.name);
                    d.id = +d.id;

                    return [...acc, d];
                }, []);
        }
function cleanData(data) {
            hasQuantities = data.filter(hasQuantity).length === data.length;

            return data
                .reduce((acc, d) => {
                    if (d.quantity !== undefined && d.quantity !== null) {
                        d.quantity = +d.quantity;
                    }
                    d.name = String(d.name);
                    d.id = +d.id;

                    return [...acc, d];
                }, []);
        }
function cleanData ( data ) { hasQuantities = data . filter ( hasQuantity ) . length === data . length ; return data . reduce ( ( acc , d ) => { if ( d . quantity !== undefined && d . quantity !== null ) { d . quantity = + d . quantity ; } d . name = String ( d . name ) ; d . id = + d . id ; return [ ... acc , d ] ; } , [ ] ) ; }
Makes sure the types of the data are right and checks if it has quantities
@param {LegendChartData} data
@private
Makes sure the types of the data are right and checks if it has quantities