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
  • Parameters

    • node: HTMLElement
    • bgColor: string
    • title: string
    • width: number

    Returns void

adaptTextColorToBgColor

  • adaptTextColorToBgColor(bgColor: string): string
  • Parameters

    • bgColor: string

    Returns string

    returns black or white for best contrast

attr

  • attr<T>(node: T, attrs?: object, styles?: object, text: undefined | string): T
  • 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

exampleText

forEach

  • forEach<T>(node: Element, selector: string, callback: function): void
  • 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
  • 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

noop

  • noop(): void

setText

  • setText<T>(node: T, text: undefined | string): T
  • 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

render

render: noop = noop

template

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

update

update: noop = noop