All Downloads are FREE. Search and download functionalities are using the official Maven repository.

package.src.order.ascending.js Maven / Gradle / Ivy

There is a newer version: 3.2.0
Show newest version
import none from "./none";

export default function(series) {
  var sums = series.map(sum);
  return none(series).sort(function(a, b) { return sums[a] - sums[b]; });
}

export function sum(series) {
  var s = 0, i = -1, n = series.length, v;
  while (++i < n) if (v = +series[i][1]) s += v;
  return s;
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy