package.src.order.ascending.js Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of d3-shape Show documentation
Show all versions of d3-shape Show documentation
Graphical primitives for visualization, such as lines and areas.
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;
}