Options
All
  • Public
  • Public/Protected
  • All
Menu

Module Tools

Index

Variables

Const clone

clone: any = lodashCloneDeep

Const debounce

debounce: any = lodashDebounce

Const merge

merge: any = lodashMerge

Const removeArrayDuplicates

removeArrayDuplicates: any = lodashUnique

Functions

arrayDifferences

  • arrayDifferences(oldArray: any[], newArray: any[]): object
  • Get the difference between two arrays' items

    export

    Parameters

    • oldArray: any[]
    • newArray: any[]

    Returns object

    The items missing in newArray from oldArray, and items added to newArray compared to oldArray

    • added: undefined[]
    • missing: undefined[]

capitalizeFirstLetter

  • capitalizeFirstLetter(string: any): any
  • Capitalizes first letter of a string

    export

    Parameters

    • string: any

      the string whose first letter you'd like to capitalize

    Returns any

    The input string with its first letter capitalized

convertValueToPercentage

  • convertValueToPercentage(item: any, fullData: any): string | number
  • Get the percentage of a datapoint compared to the entire data-set. Returns 1 significant digit if percentage is less than 1%.

    export

    Parameters

    • item: any
    • fullData: any

    Returns string | number

    The percentage in the form of a number

getDimensions

  • getDimensions(el: any): object
  • Get width & height of an element

    export

    Parameters

    • el: any

      element to get dimensions from

    Returns object

    an object containing the width and height of el

    • height: number
    • width: number

getDuplicateValues

  • getDuplicateValues(arr: any): any[]
  • Lists out the duplicated keys in an array of data

    export

    Parameters

    • arr: any

    Returns any[]

    A list of the duplicated keys in data

Const getProperty

  • getProperty(object: any, ...propPath: any[]): any
  • Parameters

    • object: any
    • Rest ...propPath: any[]

    Returns any

getTranformOffsets

  • getTranformOffsets(string: any): object
  • Gets x and y coordinates from a HTML transform attribute

    export

    Parameters

    • string: any

      the transform attribute string ie. transform(x,y)

    Returns object

    Returns an object with x and y offsets of the transform

    • x: number
    • y: number

getTranslationValues

  • getTranslationValues(elementRef: HTMLElement): object
  • Returns an elements's x and y translations from attribute transform

    Parameters

    • elementRef: HTMLElement

    Returns object

    an object containing the x and y translations or null

    • tx: string
    • ty: string

moveToFront

  • moveToFront(element: any): any
  • In D3, moves an element to the front of the canvas

    export

    Parameters

    • element: any

    Returns any

    The function to be used by D3 to push element to the top of the canvas

Generated using TypeDoc