Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface INumericStats<T>

Type Parameters

  • T

Hierarchy

Index

Properties

count: number

number of items in the array

depth: number

in case of nested arrays what is the max nested depth

flatCount: number

number of items in the array

flatItems: readonly T[]

the items in this stats

flatMissing: number

number of missing items in the array

hist: readonly Readonly<IBin<T>>[]

histogram

items: readonly (T | Set<T> | (readonly T[]))[]

the items in this stats

max: T

maximum value in the array

maxBin: IBin<T>

maximal items in a bin

median: T

median value in the array

min: T

minimal value in the array

missing: number

number of missing items in the array

Methods

  • [toPrimitive](hint: "default"): string
  • [toPrimitive](hint: "string"): string
  • [toPrimitive](hint: "number"): number
  • [toPrimitive](hint: string): string | number
  • Converts a Stats object to a string.

    Parameters

    • hint: "default"

    Returns string

  • Converts a Stats object to a string.

    Parameters

    • hint: "string"

    Returns string

  • Converts a Stats object to a number.

    Parameters

    • hint: "number"

    Returns number

  • Converts a Stats object to a string or number.

    throws

    {TypeError} If 'hint' was given something other than "number", "string", or "default".

    Parameters

    • hint: string

      The strings "number", "string", or "default" to specify what primitive to return.

    Returns string | number

    A number if 'hint' was "number", a string if 'hint' was "string" or "default".

  • color(v: T): string
  • converts a given (normalized) value to a color

    Parameters

    • v: T

    Returns string

  • format(v: T): string
  • converts the given value to a label

    Parameters

    • v: T

    Returns string

  • invert(v: number): T
  • invert operation given a number between 0 and 1 convert it back

    Parameters

    • v: number

    Returns T

  • scale(v: T): number
  • converts the given value to a value between 0 and 1

    Parameters

    • v: T

    Returns number

Generated using TypeDoc