Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "internal/math"

Index

Functions

computeHist

computeStats

  • computeStats<T>(arr: T[], acc: function, missing: function, range?: [number, number], bins?: undefined | number): IStatistics
  • computes the simple statistics of an array using d3 histogram

    internal

    Type parameters

    • T

    Parameters

    • arr: T[]

      the data array

    • acc: function

      accessor function

        • (row: T): number
        • Parameters

          • row: T

          Returns number

    • missing: function

      accessor if the value is missing

        • (row: T): boolean
        • Parameters

          • row: T

          Returns boolean

    • Optional range: [number, number]

      the total value range

    • Optional bins: undefined | number

      the number of bins

    Returns IStatistics

getNumberOfBins

  • getNumberOfBins(length: number): number

round

  • round(v: number, precision?: number): number
  • round to the given commas similar to d3.round

    internal

    Parameters

    • v: number
    • Default value precision: number = 0

    Returns number

similar

  • similar(a: number, b: number, delta?: number): boolean
  • compares two number whether they are similar up to delta

    internal

    Parameters

    • a: number

      first numbre

    • b: number

      second number

    • Default value delta: number = 0.5

    Returns boolean

    a and b are similar