Interface Base

Hierarchy

Index

Properties

Methods

Properties

public behavior: Behavior

Create a behavior

public csv: Dsv

Request a comma-separated values (CSV) file.

public ease: (type: string, ...arrs: any[]) => D3.Transition.Transition

Returns a built-in easing function of the specified type

public event: Event

Access the current user event for interaction

public geo: Geo

public geom: Geom

public hcl: { (h: number, c: number, l: number): D3.Color.HCLColor; (color: string): D3.Color.HCLColor; }

Constructs a new HCL color.

(): HCLColor

Constructs a new HCL color.

Returns

HCLColor

(): HCLColor

Constructs a new HCL color by parsing the specified color string

Returns

HCLColor

public hsl: { (h: number, s: number, l: number): D3.Color.HSLColor; (color: string): D3.Color.HSLColor; }

Constructs a new HSL color.

(): HSLColor

Constructs a new HSL color with the specified hue h, saturation s and lightness l

Returns

HSLColor

(): HSLColor

Constructs a new HSL color by parsing the specified color string

Returns

HSLColor

public html: (url: string, callback?: (response: DocumentFragment) => void) => D3.Xhr

Request an XML document fragment.

param

Url to request

param

Function to invoke when resource is loaded or the request fails

public interpolate: BaseInterpolate

public interpolateArray: BaseInterpolate

public interpolateHcl: BaseInterpolate

public interpolateHsl: BaseInterpolate

public interpolateLab: BaseInterpolate

public interpolateNumber: BaseInterpolate

public interpolateObject: BaseInterpolate

public interpolateRgb: BaseInterpolate

public interpolateRound: BaseInterpolate

public interpolateString: BaseInterpolate

public interpolateTransform: BaseInterpolate

public interpolators: InterpolateFactory[]

public json: (url: string, callback?: (error: any, data: any) => void) => D3.Xhr

Request a JSON blob

param

Url to request

param

Function to invoke when resource is loaded or the request fails

public lab: { (l: number, a: number, b: number): D3.Color.LABColor; (color: string): D3.Color.LABColor; }

Constructs a new RGB color.

(): LABColor

Constructs a new LAB color.

Returns

LABColor

(): LABColor

Constructs a new LAB color by parsing the specified color string

Returns

LABColor

public layout: Layout

Layouts

public ns: { prefix: { svg: string; xhtml: string; xlink: string; xml: string; xmlns: string; }; qualify(name: string): { space: string; local: string; }; }

public ns.prefix: { svg: string; xhtml: string; xlink: string; xml: string; xmlns: string; }

The map of registered namespace prefixes

public prefix.svg: string

public prefix.xhtml: string

public prefix.xlink: string

public prefix.xml: string

public prefix.xmlns: string

public qualify(): { space: string; local: string; }

Qualifies the specified name

Returns

{ space: string; local: string; }

.name.name: string

public quantile: (arr: number[], p: number) => number

Compute a quantile for a sorted array of numbers.

param

Array to search

param

The quantile to return

public random: Random

Random number generators

public range: { (stop: number, step?: number): number[]; (start: number, stop?: number, step?: number): number[]; }

Generate a range of numeric values.

(): Array<number>

Generate a range of numeric values from 0.

Returns

Array<number>

(): Array<number>

Generate a range of numeric values.

Returns

Array<number>

public rgb: { (r: number, g: number, b: number): D3.Color.RGBColor; (color: string): D3.Color.RGBColor; }

Constructs a new RGB color.

(): RGBColor

Constructs a new RGB color with the specified r, g and b channel values

Returns

RGBColor

(): RGBColor

Constructs a new RGB color by parsing the specified color string

Returns

RGBColor

public scale: ScaleBase

Scales

public select: { (selector: string): D3.Selection; (element: EventTarget): D3.Selection; }

Select an element from the current document

(): Selection

Selects the first element that matches the specified selector string

Returns

Selection

(): Selection

Selects the specified node

Returns

Selection

public selectAll: { (selector: string): D3.Selection; (elements: EventTarget[]): D3.Selection; }

Select multiple elements from the current document

(): Selection

Selects all elements that match the specified selector

Returns

Selection

(): Selection

Selects the specified array of elements

Returns

Selection

public svg: Svg

Svg's

public text: { (url: string, callback?: (response: string) => void): D3.Xhr; (url: string, mime: string, callback?: (response: string) => void): D3.Xhr; }

Request a text file

(): Xhr

Request a text file

Returns

Xhr

(): Xhr

Request a text file

Returns

Xhr

public time: Time

Time Functions

public timer: { flush(): void; (funct: () => boolean, delay?: number, mark?: number): void; }

()

public flush()

public tsv: Dsv

Request a tab-separated values (TSV) file

public version: string

The version of the d3 library

public xhr: { (url: string, callback?: (xhr: XMLHttpRequest) => void): D3.Xhr; (url: string, mime: string, callback?: (xhr: XMLHttpRequest) => void): D3.Xhr; }

Request a resource using XMLHttpRequest.

(): Xhr

Creates an asynchronous request for specified url

Returns

Xhr

(): Xhr

Creates an asynchronous request for specified url

Returns

Xhr

public xml: { (url: string, callback?: (response: Document) => void): D3.Xhr; (url: string, mime: string, callback?: (response: Document) => void): D3.Xhr; }

Request an HTML document fragment.

(): Xhr

Request an HTML document fragment.

Returns

Xhr

(): Xhr

Request an HTML document fragment.

Returns

Xhr

Methods

public ascending(a: T, b: T): number

Compare two values for sorting. Returns -1 if a is less than b, or 1 if a is greater than b, or 0

Parameters

  • a: T

    First value

  • b: T

    Second value

Returns

number

public bisect(arr: Array<T>, x: T, low?: number, high?: number): number

Locate the insertion point for x in array to maintain sorted order

Parameters

  • arr: Array<T>

    Array to search

  • x: T

    Value to search for insertion point

  • low?: number optional

    Minimum value of array subset

  • high?: number optional

Returns

number

public bisectLeft(arr: Array<T>, x: T, low?: number, high?: number): number

Locate the insertion point for x in array to maintain sorted order

Parameters

  • arr: Array<T>

    Array to search

  • x: T

    Value to serch for insertion point

  • low?: number optional

    Minimum value of array subset

  • high?: number optional

    Maximum value of array subset

Returns

number

public bisectRight(arr: Array<T>, x: T, low?: number, high?: number): number

Locate the insertion point for x in array to maintain sorted order

Parameters

  • arr: Array<T>

    Array to search

  • x: T

    Value to serch for insertion point

  • low?: number optional

    Minimum value of array subset

  • high?: number optional

    Maximum value of array subset

Returns

number

public bisector(accessor: (data: any, index: number) => any): any

Bisect using an accessor.

Parameters

  • accessor: (data: any, index: number) => any

    Accessor function

Returns

any

public descending(a: T, b: T): number

Compare two values for sorting. Returns -1 if a is greater than b, or 1 if a is less than b, or 0

Parameters

  • a: T

    First value

  • b: T

    Second value

Returns

number

public dispatch(types?: Array<string>): Dispatch

Parameters

  • types?: Array<string> optional

Returns

Dispatch

public entries(map: any): Array<any>

List the key-value entries of an associative array.

Parameters

  • map: any

    Array of objects to get the key-value pairs from

Returns

Array<any>

public extent(arr: Array<T>, map: (v: T) => U): Array<U>

Find the minimum and maximum value in an array

Parameters

  • arr: Array<T>

    Array to search

  • map: (v: T) => U

    Accsessor function

Returns

Array<U>

public extent(arr: Array<T>): Array<T>

Find the minimum and maximum value in an array

Parameters

  • arr: Array<T>

    Array to search

Returns

Array<T>

public format(specifier: string): (value: number) => string

Create a function to format a number as a string

Parameters

  • specifier: string

    The format specifier to use

Returns

(value: number) => string

public formatPrefix(value: number, precision?: number): MetricPrefix

Returns the SI prefix for the specified value at the specified precision

Parameters

  • value: number
  • precision?: number optional

Returns

MetricPrefix

public functor(value: (p: R) => T): (p: R) => T

If the specified value is a function, returns the specified value. Otherwise, returns a function that returns the specified value.

Parameters

  • value: (p: R) => T

Returns

(p: R) => T

public functor(value: T): (p: any) => T

Parameters

  • value: T

Returns

(p: any) => T

public keys(map: any): Array<string>

List the keys of an associative array.

Parameters

  • map: any

    Array of objects to get the key values from

Returns

Array<string>

public map(object?: any): Map

Parameters

  • object?: any optional

Returns

Map

public max(arr: Array<T>, map: (v: T) => U): U

Find the maximum value in an array

Parameters

  • arr: Array<T>

    Array to search

  • map: (v: T) => U

    Accsessor function

Returns

U

public max(arr: Array<T>): T

Find the maximum value in an array

Parameters

  • arr: Array<T>

    Array to search

Returns

T

public mean(arr: Array<T>, map: (v: T) => number): number

Compute the arithmetic mean of an array of numbers

Parameters

  • arr: Array<T>

    Array to search

  • map: (v: T) => number

    Accsessor function

Returns

number

public mean(arr: Array<number>): number

Compute the arithmetic mean of an array of numbers

Parameters

  • arr: Array<number>

    Array to search

Returns

number

public median(arr: Array<T>, map: (v: T) => number): number

Compute the median of an array of numbers (the 0.5-quantile).

Parameters

  • arr: Array<T>

    Array to search

  • map: (v: T) => number

    Accsessor function

Returns

number

public median(arr: Array<number>): number

Compute the median of an array of numbers (the 0.5-quantile).

Parameters

  • arr: Array<number>

    Array to search

Returns

number

public merge(map?: Array<any>): Array<any>

merge multiple arrays into one array

Parameters

  • map?: Array<any> optional

    Arrays to merge

Returns

Array<any>

public min(arr: Array<T>, map: (v: T) => U): U

Find the minimum value in an array

Parameters

  • arr: Array<T>

    Array to search

  • map: (v: T) => U

    Accsessor function

Returns

U

public min(arr: Array<T>): T

Find the minimum value in an array

Parameters

  • arr: Array<T>

    Array to search

Returns

T

public mouse(container: any): Array<number>

gets the mouse position relative to a specified container.

Parameters

  • container: any

Returns

Array<number>

public nest(): Nest

Create new nest operator

Returns

Nest

public permute(arr: Array<any>, indexes: Array<any>): Array<any>

Reorder an array of elements according to an array of indexes

Parameters

  • arr: Array<any>

    Array to reorder

  • indexes: Array<any>

    Array containing the order the elements should be returned in

Returns

Array<any>

public rebind(target: any, source: any, names?: Array<any>): any

Parameters

  • target: any
  • source: any
  • names?: Array<any> optional

Returns

any

public requote(str: string): string

Parameters

  • str: string

Returns

string

public round(x: number, n: number): number

Parameters

  • x: number
  • n: number

Returns

number

public selection(): Selection

Returns the root selection

Returns

Selection

public set(array?: Array<any>): Set

Parameters

  • array?: Array<any> optional

Returns

Set

public shuffle(arr: Array<T>): Array<T>

Randomize the order of an array.

Parameters

  • arr: Array<T>

    Array to randomize

Returns

Array<T>

public sum(arr: Array<T>, map: (v: T) => number): number

Compute the sum of an array of numbers

Parameters

  • arr: Array<T>

    Array to search

  • map: (v: T) => number

    Accsessor function

Returns

number

public sum(arr: Array<number>): number

Compute the sum of an array of numbers

Parameters

  • arr: Array<number>

    Array to search

Returns

number

public touches(container: any): Array<number[]>

gets the touch positions relative to a specified container.

Parameters

  • container: any

Returns

Array<number[]>

public transform(definition: string): any

Parse the given 2D affine transform string, as defined by SVG's transform attribute.

Parameters

  • definition: string

    2D affine transform string

Returns

any

public transition(): Transition

Returns

Transition

public transpose(matrix: Array<any>): Array<any>

Transpose an array of arrays.

Parameters

  • matrix: Array<any>

    Two dimensional array to transpose

Returns

Array<any>

public values(map: Array<any>): Array<any>

List the values of an associative array.

Parameters

  • map: Array<any>

    Array of objects to get the values from

Returns

Array<any>

public zip(arrs?: Array<any>): Array<any>

Transpose a variable number of arrays.

Parameters

  • arrs?: Array<any> optional

    Arrays to transpose

Returns

Array<any>