plotter.js
function moving_maximum(array, n) {
  var nums = [];

  for (i in array) {
    if (_.isNumber(array[i])) {
      nums.push(array[i]);
      if (nums.length > n) {
	nums.splice(0,1); /* Remove the first element of the array */
      }
      /* Take the average of the n items in this array */
      var maximum = _.max(nums);
      array[i] = maximum;
    }
  }

  return array;
}
function moving_maximum(array, n) {
  var nums = [];

  for (i in array) {
    if (_.isNumber(array[i])) {
      nums.push(array[i]);
      if (nums.length > n) {
	nums.splice(0,1); /* Remove the first element of the array */
      }
      /* Take the average of the n items in this array */
      var maximum = _.max(nums);
      array[i] = maximum;
    }
  }

  return array;
}
function moving_maximum ( array , n ) { var nums = [ ] ; for ( i in array ) { if ( _ . isNumber ( array [ i ] ) ) { nums . push ( array [ i ] ) ; if ( nums . length > n ) { nums . splice ( 0 , 1 ) ; /* Remove the first element of the array */ } /* Take the average of the n items in this array */ var maximum = _ . max ( nums ) ; array [ i ] = maximum ; } } return array ; }
Performs a n-point maximum on array.
Performs a n - point maximum on array .