Components Interactions Examples Tutorials API FAQ
Options
Menu

Module d3

Index

Type aliases

Primitive

Primitive: number | string | boolean

Administrivia: JavaScript primitive types, or "things that toString() predictably".

Variables

bisect

bisect: bisectRight

color

color: object

Type declaration

csv

csv: Dsv

event

event: Event

The current event's value. Use this variable in a handler registered with selection.on.

hcl

hcl: object

Type declaration

    • (h: number, c: number, l: number): Hcl
    • (color: string): Hcl
    • Parameters

      • h: number
      • c: number
      • l: number

      Returns Hcl

    • Parameters

      • color: string

      Returns Hcl

  • constructor: function
    • new __type(h: number, c: number, l: number): __type
    • new __type(color: string): __type

hsl

hsl: object

Type declaration

    • (h: number, s: number, l: number): Hsl
    • (color: string): Hsl
    • Parameters

      • h: number
      • s: number
      • l: number

      Returns Hsl

    • Parameters

      • color: string

      Returns Hsl

  • constructor: function
    • new __type(h: number, s: number, l: number): __type
    • new __type(color: string): __type

interpolators

interpolators: Array<function>

lab

lab: object

Type declaration

    • (l: number, a: number, b: number): Lab
    • (color: string): Lab
    • Parameters

      • l: number
      • a: number
      • b: number

      Returns Lab

    • Parameters

      • color: string

      Returns Lab

  • constructor: function
    • new __type(l: number, a: number, b: number): __type
    • new __type(color: string): __type

rgb

rgb: object

Type declaration

    • (r: number, g: number, b: number): Rgb
    • (color: string): Rgb
    • Parameters

      • r: number
      • g: number
      • b: number

      Returns Rgb

    • Parameters

      • color: string

      Returns Rgb

  • constructor: function
    • new __type(r: number, g: number, b: number): __type
    • new __type(color: string): __type

tsv

tsv: Dsv

version

version: string

The current version of D3.js.

Functions

ascending

bisectLeft

  • bisectLeft(array: number[], x: number, lo?: number, hi?: number): number
  • bisectLeft(array: string[], x: string, lo?: number, hi?: number): number
  • Parameters

    • array: number[]
    • x: number
    • Optional lo: number
    • Optional hi: number

    Returns number

  • Parameters

    • array: string[]
    • x: string
    • Optional lo: number
    • Optional hi: number

    Returns number

bisectRight

  • bisectRight<T>(array: T[], x: T, lo?: number, hi?: number): number
  • Type parameters

    • T

    Parameters

    • array: T[]
    • x: T
    • Optional lo: number
    • Optional hi: number

    Returns number

bisector

  • bisector<T, U>(accessor: function): object
  • bisector<T, U>(comparator: function): object
  • Type parameters

    • T

    • U

    Parameters

    • accessor: function
        • (x: T): U
        • Parameters

          • x: T

          Returns U

    Returns object

    • left: function
        • (array: T[], x: U, lo?: number, hi?: number): number
        • Parameters

          • array: T[]
          • x: U
          • Optional lo: number
          • Optional hi: number

          Returns number

    • right: function
        • (array: T[], x: U, lo?: number, hi?: number): number
        • Parameters

          • array: T[]
          • x: U
          • Optional lo: number
          • Optional hi: number

          Returns number

  • Type parameters

    • T

    • U

    Parameters

    • comparator: function
        • (a: T, b: U): number
        • Parameters

          • a: T
          • b: U

          Returns number

    Returns object

    • left: function
        • (array: T[], x: U, lo?: number, hi?: number): number
        • Parameters

          • array: T[]
          • x: U
          • Optional lo: number
          • Optional hi: number

          Returns number

    • right: function
        • (array: T[], x: U, lo?: number, hi?: number): number
        • Parameters

          • array: T[]
          • x: U
          • Optional lo: number
          • Optional hi: number

          Returns number

descending

deviation

  • deviation(array: number[]): number
  • deviation<T>(array: T[], accessor: function): number
  • Parameters

    • array: number[]

    Returns number

  • Type parameters

    • T

    Parameters

    • array: T[]
    • accessor: function
        • (datum: T, index: number): number
        • Parameters

          • datum: T
          • index: number

          Returns number

    Returns number

dispatch

  • dispatch(...names: string[]): Dispatch

dsv

  • dsv(delimiter: string, mimeType: string): Dsv

ease

  • ease(type: "linear"): function
  • ease(type: "linear-in"): function
  • ease(type: "linear-out"): function
  • ease(type: "linear-in-out"): function
  • ease(type: "linear-out-in"): function
  • ease(type: "poly", k: number): function
  • ease(type: "poly-in", k: number): function
  • ease(type: "poly-out", k: number): function
  • ease(type: "poly-in-out", k: number): function
  • ease(type: "poly-out-in", k: number): function
  • ease(type: "quad"): function
  • ease(type: "quad-in"): function
  • ease(type: "quad-out"): function
  • ease(type: "quad-in-out"): function
  • ease(type: "quad-out-in"): function
  • ease(type: "cubic"): function
  • ease(type: "cubic-in"): function
  • ease(type: "cubic-out"): function
  • ease(type: "cubic-in-out"): function
  • ease(type: "cubic-out-in"): function
  • ease(type: "sin"): function
  • ease(type: "sin-in"): function
  • ease(type: "sin-out"): function
  • ease(type: "sin-in-out"): function
  • ease(type: "sin-out-in"): function
  • ease(type: "circle"): function
  • ease(type: "circle-in"): function
  • ease(type: "circle-out"): function
  • ease(type: "circle-in-out"): function
  • ease(type: "circle-out-in"): function
  • ease(type: "elastic", a?: number, b?: number): function
  • ease(type: "elastic-in", a?: number, b?: number): function
  • ease(type: "elastic-out", a?: number, b?: number): function
  • ease(type: "elastic-in-out", a?: number, b?: number): function
  • ease(type: "elastic-out-in", a?: number, b?: number): function
  • ease(type: "back", s: number): function
  • ease(type: "back-in", s: number): function
  • ease(type: "back-out", s: number): function
  • ease(type: "back-in-out", s: number): function
  • ease(type: "back-out-in", s: number): function
  • ease(type: "bounce"): function
  • ease(type: "bounce-in"): function
  • ease(type: "bounce-out"): function
  • ease(type: "bounce-in-out"): function
  • ease(type: "bounce-out-in"): function
  • ease(type: string, ...args: any[]): function
  • Parameters

    • type: "linear"

    Returns function

      • (t: number): number
      • Parameters

        • t: number

        Returns number

  • Parameters

    • type: "linear-in"

    Returns function

      • (t: number): number
      • Parameters

        • t: number

        Returns number

  • Parameters

    • type: "linear-out"

    Returns function

      • (t: number): number
      • Parameters

        • t: number

        Returns number

  • Parameters

    • type: "linear-in-out"

    Returns function

      • (t: number): number
      • Parameters

        • t: number

        Returns number

  • Parameters

    • type: "linear-out-in"

    Returns function

      • (t: number): number
      • Parameters

        • t: number

        Returns number

  • Parameters

    • type: "poly"
    • k: number

    Returns function

      • (t: number): number
      • Parameters

        • t: number

        Returns number

  • Parameters

    • type: "poly-in"
    • k: number

    Returns function

      • (t: number): number
      • Parameters

        • t: number

        Returns number

  • Parameters

    • type: "poly-out"
    • k: number

    Returns function

      • (t: number): number
      • Parameters

        • t: number

        Returns number

  • Parameters

    • type: "poly-in-out"
    • k: number

    Returns function

      • (t: number): number
      • Parameters

        • t: number

        Returns number

  • Parameters

    • type: "poly-out-in"
    • k: number

    Returns function

      • (t: number): number
      • Parameters

        • t: number

        Returns number

  • Parameters

    • type: "quad"

    Returns function

      • (t: number): number
      • Parameters

        • t: number

        Returns number

  • Parameters

    • type: "quad-in"

    Returns function

      • (t: number): number
      • Parameters

        • t: number

        Returns number

  • Parameters

    • type: "quad-out"

    Returns function

      • (t: number): number
      • Parameters

        • t: number

        Returns number

  • Parameters

    • type: "quad-in-out"

    Returns function

      • (t: number): number
      • Parameters

        • t: number

        Returns number

  • Parameters

    • type: "quad-out-in"

    Returns function

      • (t: number): number
      • Parameters

        • t: number

        Returns number

  • Parameters

    • type: "cubic"

    Returns function

      • (t: number): number
      • Parameters

        • t: number

        Returns number

  • Parameters

    • type: "cubic-in"

    Returns function

      • (t: number): number
      • Parameters

        • t: number

        Returns number

  • Parameters

    • type: "cubic-out"

    Returns function

      • (t: number): number
      • Parameters

        • t: number

        Returns number

  • Parameters

    • type: "cubic-in-out"

    Returns function

      • (t: number): number
      • Parameters

        • t: number

        Returns number

  • Parameters

    • type: "cubic-out-in"

    Returns function

      • (t: number): number
      • Parameters

        • t: number

        Returns number

  • Parameters

    • type: "sin"

    Returns function

      • (t: number): number
      • Parameters

        • t: number

        Returns number

  • Parameters

    • type: "sin-in"

    Returns function

      • (t: number): number
      • Parameters

        • t: number

        Returns number

  • Parameters

    • type: "sin-out"

    Returns function

      • (t: number): number
      • Parameters

        • t: number

        Returns number

  • Parameters

    • type: "sin-in-out"

    Returns function

      • (t: number): number
      • Parameters

        • t: number

        Returns number

  • Parameters

    • type: "sin-out-in"

    Returns function

      • (t: number): number
      • Parameters

        • t: number

        Returns number

  • Parameters

    • type: "circle"

    Returns function

      • (t: number): number
      • Parameters

        • t: number

        Returns number

  • Parameters

    • type: "circle-in"

    Returns function

      • (t: number): number
      • Parameters

        • t: number

        Returns number

  • Parameters

    • type: "circle-out"

    Returns function

      • (t: number): number
      • Parameters

        • t: number

        Returns number

  • Parameters

    • type: "circle-in-out"

    Returns function

      • (t: number): number
      • Parameters

        • t: number

        Returns number

  • Parameters

    • type: "circle-out-in"

    Returns function

      • (t: number): number
      • Parameters

        • t: number

        Returns number

  • Parameters

    • type: "elastic"
    • Optional a: number
    • Optional b: number

    Returns function

      • (t: number): number
      • Parameters

        • t: number

        Returns number

  • Parameters

    • type: "elastic-in"
    • Optional a: number
    • Optional b: number

    Returns function

      • (t: number): number
      • Parameters

        • t: number

        Returns number

  • Parameters

    • type: "elastic-out"
    • Optional a: number
    • Optional b: number

    Returns function

      • (t: number): number
      • Parameters

        • t: number

        Returns number

  • Parameters

    • type: "elastic-in-out"
    • Optional a: number
    • Optional b: number

    Returns function

      • (t: number): number
      • Parameters

        • t: number

        Returns number

  • Parameters

    • type: "elastic-out-in"
    • Optional a: number
    • Optional b: number

    Returns function

      • (t: number): number
      • Parameters

        • t: number

        Returns number

  • Parameters

    • type: "back"
    • s: number

    Returns function

      • (t: number): number
      • Parameters

        • t: number

        Returns number

  • Parameters

    • type: "back-in"
    • s: number

    Returns function

      • (t: number): number
      • Parameters

        • t: number

        Returns number

  • Parameters

    • type: "back-out"
    • s: number

    Returns function

      • (t: number): number
      • Parameters

        • t: number

        Returns number

  • Parameters

    • type: "back-in-out"
    • s: number

    Returns function

      • (t: number): number
      • Parameters

        • t: number

        Returns number

  • Parameters

    • type: "back-out-in"
    • s: number

    Returns function

      • (t: number): number
      • Parameters

        • t: number

        Returns number

  • Parameters

    • type: "bounce"

    Returns function

      • (t: number): number
      • Parameters

        • t: number

        Returns number

  • Parameters

    • type: "bounce-in"

    Returns function

      • (t: number): number
      • Parameters

        • t: number

        Returns number

  • Parameters

    • type: "bounce-out"

    Returns function

      • (t: number): number
      • Parameters

        • t: number

        Returns number

  • Parameters

    • type: "bounce-in-out"

    Returns function

      • (t: number): number
      • Parameters

        • t: number

        Returns number

  • Parameters

    • type: "bounce-out-in"

    Returns function

      • (t: number): number
      • Parameters

        • t: number

        Returns number

  • Parameters

    • type: string
    • Rest ...args: any[]

    Returns function

      • (t: number): number
      • Parameters

        • t: number

        Returns number

entries

  • entries<T>(object: object): object[]
  • entries<T>(object: object): object[]
  • entries(object: Object): object[]
  • Returns an array of key-value pairs containing the property values of the specified object.

    Type parameters

    • T

    Parameters

    • object: object
      • [key: string]: T

    Returns object[]

    • key: string
    • value: T
  • Returns an array of key-value pairs containing the property values of the specified object.

    Type parameters

    • T

    Parameters

    • object: object
      • [key: number]: T

    Returns object[]

    • key: string
    • value: T
  • Returns an array of key-value pairs containing the property values of the specified object.

    Parameters

    • object: Object

    Returns object[]

    • key: string
    • value: any

extent

  • extent(array: number[]): [number, number]
  • extent(array: string[]): [string, string]
  • extent<T>(array: T[]): [T, T]
  • extent<T>(array: Array<T | Primitive>): [T | Primitive, T | Primitive]
  • extent<T>(array: T[], accessor: function): [number, number]
  • extent<T>(array: T[], accessor: function): [string, string]
  • extent<T, U>(array: U[], accessor: function): [U | Primitive, U | Primitive]
  • Return the min and max simultaneously.

    Parameters

    • array: number[]

    Returns [number, number]

  • Return the min and max simultaneously.

    Parameters

    • array: string[]

    Returns [string, string]

  • Return the min and max simultaneously.

    Type parameters

    Parameters

    • array: T[]

    Returns [T, T]

  • Return the min and max simultaneously.

    Type parameters

    Parameters

    Returns [T | Primitive, T | Primitive]

  • Return the min and max simultaneously.

    Type parameters

    • T

    Parameters

    • array: T[]
    • accessor: function
        • (datum: T, index: number): number
        • Parameters

          • datum: T
          • index: number

          Returns number

    Returns [number, number]

  • Return the min and max simultaneously.

    Type parameters

    • T

    Parameters

    • array: T[]
    • accessor: function
        • (datum: T, index: number): string
        • Parameters

          • datum: T
          • index: number

          Returns string

    Returns [string, string]

  • Return the min and max simultaneously.

    Type parameters

    Parameters

    • array: U[]
    • accessor: function
        • (datum: T, index: number): U
        • Parameters

          • datum: T
          • index: number

          Returns U

    Returns [U | Primitive, U | Primitive]

format

  • format(specifier: string): function
  • Parameters

    • specifier: string

    Returns function

      • (n: number): string
      • Parameters

        • n: number

        Returns string

formatPrefix

  • formatPrefix(value: number, precision?: number): FormatPrefix

functor

  • functor<T>(value: T): T
  • functor<T>(value: T): function

html

  • html(url: string, callback?: function): Xhr
  • Parameters

    • url: string
    • Optional callback: function
        • (err: any, data: DocumentFragment): void
        • Parameters

          • err: any
          • data: DocumentFragment

          Returns void

    Returns Xhr

interpolate

  • interpolate(a: number, b: number): function
  • interpolate(a: string, b: string): function
  • interpolate(a: string | Color, b: Color): function
  • interpolate(a: Array<string | Color>, b: Color[]): function
  • interpolate<Range, Output>(a: Range[], b: Output[]): function
  • interpolate<Range, Output>(a: Range[], b: Range[]): function
  • interpolate(a: object, b: object): function
  • interpolate<Range, Output>(a: object, b: object): function
  • interpolate<Range, Output>(a: object, b: object): function
  • Parameters

    • a: number
    • b: number

    Returns function

      • (t: number): number
      • Parameters

        • t: number

        Returns number

  • Parameters

    • a: string
    • b: string

    Returns function

      • (t: number): string
      • Parameters

        • t: number

        Returns string

  • Parameters

    Returns function

      • (t: number): string
      • Parameters

        • t: number

        Returns string

  • Parameters

    Returns function

      • (t: number): string
      • Parameters

        • t: number

        Returns string

  • Type parameters

    • Range

    • Output

    Parameters

    • a: Range[]
    • b: Output[]

    Returns function

      • (t: number): Output[]
      • Parameters

        • t: number

        Returns Output[]

  • Type parameters

    • Range

    • Output

    Parameters

    • a: Range[]
    • b: Range[]

    Returns function

      • (t: number): Output[]
      • Parameters

        • t: number

        Returns Output[]

  • Parameters

    • a: object
      • [key: string]: string | Color
    • b: object

    Returns function

      • (t: number): object
      • Parameters

        • t: number

        Returns object

        • [key: string]: string
  • Type parameters

    • Range

    • Output

    Parameters

    • a: object
      • [key: string]: Range
    • b: object
      • [key: string]: Output

    Returns function

      • (t: number): object
      • Parameters

        • t: number

        Returns object

        • [key: string]: Output
  • Type parameters

    • Range

    • Output

    Parameters

    • a: object
      • [key: string]: Range
    • b: object
      • [key: string]: Range

    Returns function

      • (t: number): object
      • Parameters

        • t: number

        Returns object

        • [key: string]: Output

interpolateArray

  • interpolateArray(a: Array<string | Color>, b: Color[]): function
  • interpolateArray<Range, Output>(a: Range[], b: Range[]): function
  • interpolateArray<Range, Output>(a: Range[], b: Output[]): function
  • Parameters

    Returns function

      • (t: number): string[]
      • Parameters

        • t: number

        Returns string[]

  • Type parameters

    • Range

    • Output

    Parameters

    • a: Range[]
    • b: Range[]

    Returns function

      • (t: number): Output[]
      • Parameters

        • t: number

        Returns Output[]

  • Type parameters

    • Range

    • Output

    Parameters

    • a: Range[]
    • b: Output[]

    Returns function

      • (t: number): Output[]
      • Parameters

        • t: number

        Returns Output[]

interpolateHcl

  • interpolateHcl(a: string | Color, b: string | Color): function

interpolateHsl

  • interpolateHsl(a: string | Color, b: string | Color): function

interpolateLab

  • interpolateLab(a: string | Color, b: string | Color): function

interpolateNumber

  • interpolateNumber(a: number, b: number): function
  • Parameters

    • a: number
    • b: number

    Returns function

      • (t: number): number
      • Parameters

        • t: number

        Returns number

interpolateObject

  • interpolateObject(a: object, b: object): function
  • interpolateObject<Range, Output>(a: object, b: object): function
  • interpolateObject<Range, Output>(a: object, b: object): function
  • Parameters

    • a: object
      • [key: string]: string | Color
    • b: object

    Returns function

      • (t: number): object
      • Parameters

        • t: number

        Returns object

        • [key: string]: string
  • Type parameters

    • Range

    • Output

    Parameters

    • a: object
      • [key: string]: Range
    • b: object
      • [key: string]: Output

    Returns function

      • (t: number): object
      • Parameters

        • t: number

        Returns object

        • [key: string]: Output
  • Type parameters

    • Range

    • Output

    Parameters

    • a: object
      • [key: string]: Range
    • b: object
      • [key: string]: Range

    Returns function

      • (t: number): object
      • Parameters

        • t: number

        Returns object

        • [key: string]: Output

interpolateRgb

  • interpolateRgb(a: string | Color, b: string | Color): function

interpolateRound

  • interpolateRound(a: number, b: number): function
  • Parameters

    • a: number
    • b: number

    Returns function

      • (t: number): number
      • Parameters

        • t: number

        Returns number

interpolateString

  • interpolateString(a: string, b: string): function
  • Parameters

    • a: string
    • b: string

    Returns function

      • (t: number): string
      • Parameters

        • t: number

        Returns string

interpolateTransform

interpolateZoom

  • interpolateZoom(a: [number, number, number], b: [number, number, number]): object
  • Parameters

    • a: [number, number, number]
    • b: [number, number, number]

    Returns object

      • (t: number): [number, number, number]
      • Parameters

        • t: number

        Returns [number, number, number]

    • duration: number

json

  • json(url: string, callback?: function): Xhr
  • Parameters

    • url: string
    • Optional callback: function
        • (err: any, data: any): void
        • Parameters

          • err: any
          • data: any

          Returns void

    Returns Xhr

keys

  • keys(object: Object): string[]
  • Returns the enumerable property names of the specified object.

    Parameters

    • object: Object

      a JavaScript object

    Returns string[]

locale

map

  • map<T>(): Map<T>
  • map<T>(object: Map<T>): Map<T>
  • map<T>(object: object): Map<T>
  • map<T>(object: object): Map<T>
  • map<T>(array: T[], key: function): Map<T>
  • map(object: Object): Map<any>
  • Constructs an initially empty map.

    Type parameters

    • T

    Returns Map<T>

  • Construct a new map by copying keys and values from the given one.

    Type parameters

    • T

    Parameters

    • object: Map<T>

    Returns Map<T>

  • Construct a new map by copying enumerable properties and values from the given object.

    Type parameters

    • T

    Parameters

    • object: object
      • [key: string]: T

    Returns Map<T>

  • Construct a new map by copying enumerable properties and values from the given object.

    Type parameters

    • T

    Parameters

    • object: object
      • [key: number]: T

    Returns Map<T>

  • Construct a new map by copying elements from the array. The key function is used to identify each object.

    Type parameters

    • T

    Parameters

    • array: T[]
    • key: function
        • (datum: T, index: number): string
        • Parameters

          • datum: T
          • index: number

          Returns string

    Returns Map<T>

  • Construct a new map by copying enumerable properties and values from the given object.

    Parameters

    • object: Object

    Returns Map<any>

max

  • max(array: number[]): number
  • max(array: string[]): string
  • max<T>(array: T[]): T
  • max<T>(array: T[], accessor: function): number
  • max<T>(array: T[], accessor: function): string
  • max<T, U>(array: T[], accessor: function): U
  • Return the maximum value in the array of numbers using natural order.

    Parameters

    • array: number[]

    Returns number

  • Return the maximum value in the array of strings using natural order.

    Parameters

    • array: string[]

    Returns string

  • Return the maximum value in the array of numbers using natural order.

    Type parameters

    Parameters

    • array: T[]

    Returns T

  • Return the maximum value in the array using natural order and a projection function to map values to numbers.

    Type parameters

    • T

    Parameters

    • array: T[]
    • accessor: function
        • (datum: T, index: number): number
        • Parameters

          • datum: T
          • index: number

          Returns number

    Returns number

  • Return the maximum value in the array using natural order and a projection function to map values to strings.

    Type parameters

    • T

    Parameters

    • array: T[]
    • accessor: function
        • (datum: T, index: number): string
        • Parameters

          • datum: T
          • index: number

          Returns string

    Returns string

  • Return the maximum value in the array using natural order and a projection function to map values to easily-sorted values.

    Type parameters

    Parameters

    • array: T[]
    • accessor: function
        • (datum: T, index: number): U
        • Parameters

          • datum: T
          • index: number

          Returns U

    Returns U

mean

  • mean(array: number[]): number
  • mean<T>(array: T[], accessor: function): number
  • Parameters

    • array: number[]

    Returns number

  • Type parameters

    • T

    Parameters

    • array: T[]
    • accessor: function
        • (datum: T, index: number): number
        • Parameters

          • datum: T
          • index: number

          Returns number

    Returns number

merge

  • merge<T>(arrays: T[]): T[]
  • Merges the specified arrays into a single array.

    Type parameters

    • T

    Parameters

    • arrays: T[]

    Returns T[]

min

  • min(array: number[]): number
  • min(array: string[]): string
  • min<T>(array: T[]): T
  • min<T>(array: T[], accessor: function): number
  • min<T>(array: T[], accessor: function): string
  • min<T, U>(array: T[], accessor: function): U
  • Return the minimum value in the array using natural order.

    Parameters

    • array: number[]

    Returns number

  • Return the minimum value in the array using natural order.

    Parameters

    • array: string[]

    Returns string

  • Return the minimum value in the array using natural order.

    Type parameters

    Parameters

    • array: T[]

    Returns T

  • Return the minimum value in the array using natural order.

    Type parameters

    • T

    Parameters

    • array: T[]
    • accessor: function
        • (datum: T, index: number): number
        • Parameters

          • datum: T
          • index: number

          Returns number

    Returns number

  • Return the minimum value in the array using natural order.

    Type parameters

    • T

    Parameters

    • array: T[]
    • accessor: function
        • (datum: T, index: number): string
        • Parameters

          • datum: T
          • index: number

          Returns string

    Returns string

  • Return the minimum value in the array using natural order.

    Type parameters

    Parameters

    • array: T[]
    • accessor: function
        • (datum: T, index: number): U
        • Parameters

          • datum: T
          • index: number

          Returns U

    Returns U

mouse

  • mouse(container: EventTarget): [number, number]
  • Returns the x and y coordinates of the mouse relative to the provided container element, using d3.event for the mouse's position on the page.

    Parameters

    • container: EventTarget

      the container element (e.g. an SVG element)

    Returns [number, number]

nest

  • nest<T>(): Nest<T>

pairs

  • pairs<T>(array: T[]): Array<[T, T]>
  • For each adjacent pair of elements in the specified array, returns a new array of tuples of elements i and i - 1. Returns the empty array if the input array has fewer than two elements.

    Type parameters

    • T

    Parameters

    • array: T[]

    Returns Array<[T, T]>

permute

  • permute<T>(array: object, keys: number[]): T[]
  • permute<T>(object: object, keys: string[]): T[]
  • Given the specified array, return an array corresponding to the list of indices in 'keys'.

    Type parameters

    • T

    Parameters

    • array: object
      • [key: number]: T
    • keys: number[]

    Returns T[]

  • Given the specified object, return an array corresponding to the list of property names in 'keys'.

    Type parameters

    • T

    Parameters

    • object: object
      • [key: string]: T
    • keys: string[]

    Returns T[]

quantile

  • quantile(array: number[], p: number): number

range

  • range(stop: number): number[]
  • range(start: number, stop: number, step?: number): number[]
  • Generates a 0-based numeric sequence. The output range does not include 'stop'.

    Parameters

    • stop: number

    Returns number[]

  • Generates a numeric sequence starting from the given start and stop values. 'step' defaults to 1. The output range does not include 'stop'.

    Parameters

    • start: number
    • stop: number
    • Optional step: number

    Returns number[]

rebind

  • rebind(target: __type, source: __type, ...names: string[]): any

requote

  • requote(string: string): string

round

  • round(x: number, n?: number): number

select

selectAll

  • selectAll(selector: string): Selection<any>
  • selectAll(nodes: EventTarget[]): Selection<any>

set

  • set(): Set
  • set(array: string[]): Set

shuffle

  • shuffle<T>(array: T[], lo?: number, hi?: number): T[]
  • Type parameters

    • T

    Parameters

    • array: T[]
    • Optional lo: number
    • Optional hi: number

    Returns T[]

sum

  • sum(array: number[]): number
  • sum<T>(array: T[], accessor: function): number
  • Compute the sum of an array of numbers.

    Parameters

    • array: number[]

    Returns number

  • Compute the sum of an array, using the given accessor to convert values to numbers.

    Type parameters

    • T

    Parameters

    • array: T[]
    • accessor: function
        • (datum: T, index: number): number
        • Parameters

          • datum: T
          • index: number

          Returns number

    Returns number

text

  • text(url: string, mimeType?: string, callback?: function): Xhr
  • text(url: string, callback: function): Xhr
  • Parameters

    • url: string
    • Optional mimeType: string
    • Optional callback: function
        • (err: any, data: string): void
        • Parameters

          • err: any
          • data: string

          Returns void

    Returns Xhr

  • Parameters

    • url: string
    • callback: function
        • (err: any, data: string): void
        • Parameters

          • err: any
          • data: string

          Returns void

    Returns Xhr

touch

  • touch(container: EventTarget, identifer: number): [number, number]
  • touch(container: EventTarget, touches: TouchList, identifer: number): [number, number]
  • Given a container element and a touch identifier, determine the x and y coordinates of the touch.

    Parameters

    • container: EventTarget

      the container element (e.g., an SVG element)

    • identifer: number

    Returns [number, number]

  • Given a container element, a list of touches, and a touch identifier, determine the x and y coordinates of the touch.

    Parameters

    • container: EventTarget

      the container element (e.g., an SVG element)

    • touches: TouchList
    • identifer: number

    Returns [number, number]

touches

  • touches(container: EventTarget, touches?: TouchList): Array<[number, number]>
  • Given a container element and an optional list of touches, return the position of every touch relative to the container.

    Parameters

    • container: EventTarget

      the container element

    • Optional touches: TouchList

      an optional list of touches (defaults to d3.event.touches)

    Returns Array<[number, number]>

transform

transpose

  • transpose<T>(matrix: T[]): T[]

values

  • values<T>(object: object): T[]
  • values<T>(object: object): T[]
  • values(object: Object): any[]
  • Returns an array containing the property values of the specified object.

    Type parameters

    • T

    Parameters

    • object: object
      • [key: string]: T

    Returns T[]

  • Returns an array containing the property values of the specified object.

    Type parameters

    • T

    Parameters

    • object: object
      • [key: number]: T

    Returns T[]

  • Returns an array containing the property values of the specified object.

    Parameters

    • object: Object

    Returns any[]

variance

  • variance(array: number[]): number
  • variance<T>(array: T[], accessor: function): number
  • Parameters

    • array: number[]

    Returns number

  • Type parameters

    • T

    Parameters

    • array: T[]
    • accessor: function
        • (datum: T, index: number): number
        • Parameters

          • datum: T
          • index: number

          Returns number

    Returns number

xhr

  • xhr(url: string, mimeType?: string, callback?: function): Xhr
  • xhr(url: string, callback: function): Xhr
  • Parameters

    • url: string
    • Optional mimeType: string
    • Optional callback: function
        • (err: any, data: any): void
        • Parameters

          • err: any
          • data: any

          Returns void

    Returns Xhr

  • Parameters

    • url: string
    • callback: function
        • (err: any, data: any): void
        • Parameters

          • err: any
          • data: any

          Returns void

    Returns Xhr

xml

  • xml(url: string, mimeType?: string, callback?: function): Xhr
  • xml(url: string, callback: function): Xhr
  • Parameters

    • url: string
    • Optional mimeType: string
    • Optional callback: function
        • (err: any, data: any): void
        • Parameters

          • err: any
          • data: any

          Returns void

    Returns Xhr

  • Parameters

    • url: string
    • callback: function
        • (err: any, data: any): void
        • Parameters

          • err: any
          • data: any

          Returns void

    Returns Xhr

zip

  • zip<T>(...arrays: T[]): T[]

Generated using TypeDoc