[enh] Use d3 functions to compute max, mean, sum...