Sha256: 8be9728ac9470279edfd8b3b502706c2978cc8780c928c2b0fdfee0fd16ad080

Contents?: true

Size: 379 Bytes

Versions: 1

Compression:

Stored size: 379 Bytes

Contents

import "../math/number";

d3.mean = function(array, f) {
  var s = 0,
      n = array.length,
      a,
      i = -1,
      j = n;
  if (arguments.length === 1) {
    while (++i < n) if (d3_numeric(a = d3_number(array[i]))) s += a; else --j;
  } else {
    while (++i < n) if (d3_numeric(a = d3_number(f.call(array, array[i], i)))) s += a; else --j;
  }
  if (j) return s / j;
};

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
mdarray-sol-0.1.0-java node_modules/dc/node_modules/d3/src/arrays/mean.js