Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "renderer/utils"

Index

Variables

Const uniqueId

uniqueId: function = (function() {// side effect but just within the function itself, so good for the librarylet idCounter = 0;return (prefix: string) => `${prefix}${(idCounter++).toString(36)}`;})()

Type declaration

    • (prefix: string): string
    • Parameters

      • prefix: string

      Returns string

Functions

adaptDynamicColorToBgColor

  • adaptDynamicColorToBgColor(node: HTMLElement, bgColor: string, title: string, width: number): void
  • Adapts the text color for a given background color

    Parameters

    • node: HTMLElement

      the node containing the text

    • bgColor: string

      as #ff0000

    • title: string

      the title to render

    • width: number

      for which percentages of the cell this background applies (0..1)

    Returns void

adaptTextColorToBgColor

  • adaptTextColorToBgColor(bgColor: string): string
  • Adapts the text color for a given background color

    internal

    Parameters

    • bgColor: string

      as #ff0000

    Returns string

    returns black or white for best contrast

attr

  • attr<T>(node: T, attrs?: object, styles?: object, text?: undefined | string): T
  • utility function to sets attributes and styles in a nodes

    internal

    Type parameters

    • T: HTMLElement | SVGElement

    Parameters

    • node: T
    • Default value attrs: object = {}
      • [key: string]: any
    • Default value styles: object = {}
      • [key: string]: any
    • Optional text: undefined | string

    Returns T

forEach

  • forEach<T>(node: Element, selector: string, callback: function): void
  • for each item matching the selector execute the callback

    internal

    Type parameters

    • T: Element

    Parameters

    • node: Element
    • selector: string
    • callback: function
        • (d: T, i: number): void
        • Parameters

          • d: T
          • i: number

          Returns void

    Returns void

forEachChild

  • forEachChild<T>(node: Element, callback: function): void
  • internal

    Type parameters

    • T: Element

    Parameters

    • node: Element
    • callback: function
        • (d: T, i: number): void
        • Parameters

          • d: T
          • i: number

          Returns void

    Returns void

matchColumns

  • matchColumns(node: HTMLElement, columns: object[]): void
  • matches the columns and the dom nodes representing them

    internal

    Parameters

    • node: HTMLElement

      row

    • columns: object[]

      columns to check

    Returns void

noop

  • noop(): void

setText

  • setText<T>(node: T, text?: undefined | string): T
  • internal

    Type parameters

    • T: Node

    Parameters

    • node: T
    • Optional text: undefined | string

    Returns T

wideEnough

  • wideEnough(col: IArrayColumn<any>, length?: number): boolean

Object literals

Const noRenderer

noRenderer: object
internal

render

render: noop = noop

template

template: string = `<div></div>`

update

update: noop = noop