d3-array

array methods built-in to JavaScript

  • array.pop => popped element

  • array.push => array.length

  • array.reverse => change the array

  • array.shift => shifted element

  • array.unshift => array.length

  • array.sort => change the array

  • array.splice => change the array

  • array.concat => new Array

  • array.join => new String

  • array.slice => new Array

  • array.indexOf => number

  • array.lastIndexOf => number

  • array.fitler => new Array

  • array.forEach => undefined

  • array.every => boolean

  • array.map => new Array

  • array.some => boolean

  • array.reduce =>

  • array.reduceRight =>

yarn add d3-array

Statistics

  • d3.min(array[, accessor])

    • Mininum value using natural order
    • Return undefined if the array is empty
    • An optional accessor function may be specified, which is equivalent to calling array.map(accessor) before computing the minumum value.
  • d3.max(array[, accessor])

    • Return maximum value
    • Return undefined. if the array is empty
  • d3.extent(array[, accessor])

    • Return minumum and maximum value in the given array.
    • Return [undefined, undefined] if the array is empty
  • d3.sum(array[, accessor])

    • Return the sum of the given array of numbers.
    • Return 0 if the array is empty.
    • ignores undefined and NaN values.
  • d3.mean(array[, accessor])

    • Return the mean of the given array of numbers.
    • Return undefined if the array is empty.
    • Ignore undefined and NaN.
  • d3.median(array[, accessor]) -

-