src/charts/stacked-area.js
function formatOrder(totals) {
            let order = Object.keys(totals)
                .sort((a, b) => {
                    if (totals[a] > totals[b]) return -1;
                    if (totals[a] === totals[b]) return 0;

                    return 1;
                });

            let otherIndex = order.indexOf('Other');

            if (otherIndex >= 0) {
                let other = order.splice(otherIndex, 1);

                order = order.concat(other);
            }

            return order;
        }
function formatOrder(totals) {
            let order = Object.keys(totals)
                .sort((a, b) => {
                    if (totals[a] > totals[b]) return -1;
                    if (totals[a] === totals[b]) return 0;

                    return 1;
                });

            let otherIndex = order.indexOf('Other');

            if (otherIndex >= 0) {
                let other = order.splice(otherIndex, 1);

                order = order.concat(other);
            }

            return order;
        }
function formatOrder ( totals ) { let order = Object . keys ( totals ) . sort ( ( a , b ) => { if ( totals [ a ] > totals [ b ] ) return - 1 ; if ( totals [ a ] === totals [ b ] ) return 0 ; return 1 ; } ) ; let otherIndex = order . indexOf ( 'Other' ) ; if ( otherIndex >= 0 ) { let other = order . splice ( otherIndex , 1 ) ; order = order . concat ( other ) ; } return order ; }
Takes an object with all topics as keys and their aggregate totals as values,
sorts them into a list by descending total value and
moves "Other" to the end
@param  {Object} totals  Keys of all the topics and their corresponding totals
@return {Array}          List of topic names in aggregate order
Takes an object with all topics as keys and their aggregate totals as values sorts them into a list by descending total value and moves Other to the end