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 hcl: { (h: number, c: number, l: number): D3.Color.HCLColor; (color: string): D3.Color.HCLColor; }
Constructs a new HCL color.
Constructs a new HCL color.
Returns
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.
Constructs a new HSL color with the specified hue h, saturation s and lightness l
Returns
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.
public json: (url: string, callback?: (error: any, data: any) => void) => D3.Xhr
Request a JSON blob
public lab: { (l: number, a: number, b: number): D3.Color.LABColor; (color: string): D3.Color.LABColor; }
Constructs a new RGB color.
Constructs a new LAB color.
Returns
LABColor
Constructs a new LAB color by parsing the specified color string
Returns
LABColor
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; }
public quantile: (arr: number[], p: number) => number
Compute a quantile for a sorted array of numbers.
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.
Constructs a new RGB color with the specified r, g and b channel values
Returns
RGBColor
Constructs a new RGB color by parsing the specified color string
Returns
RGBColor
public select: { (selector: string): D3.Selection; (element: EventTarget): D3.Selection; }
Select an element from the current document
Selects the first element that matches the specified selector string
Returns
Selection
public selectAll: { (selector: string): D3.Selection; (elements: EventTarget[]): D3.Selection; }
Select multiple elements from the current document
Selects all elements that match the specified selector
Returns
Selection
Selects the specified array of elements
Returns
Selection
public text: { (url: string, callback?: (response: string) => void): D3.Xhr; (url: string, mime: string, callback?: (response: string) => void): D3.Xhr; }
Request a text file
Request a text file
Returns
Xhr
Request a text file
Returns
Xhr
public time: Time
Time Functions
public timer: { flush(): void; (funct: () => boolean, delay?: number, mark?: number): void; }
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.
Creates an asynchronous request for specified url
Returns
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.
Request an HTML document fragment.
Returns
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
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
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
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
Returns
(p: R) => T
public functor(value: T): (p: any) => T
Parameters
Returns
(p: any) => T
public keys(map: any): Array<string>
List the keys of an associative array.
Parameters
Returns
Array<string>
public map(object?: any): Map
Parameters
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
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
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
Returns
string
public round(x: number, n: number): number
Parameters
Returns
number
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
Returns
Array<number[]>
public transform(definition: string): any
Parse the given 2D affine transform string, as defined by SVG's transform attribute.
Parameters
Returns
any
public transpose(matrix: Array<any>): Array<any>
Transpose an array of arrays.
Parameters
Returns
Array<any>
public values(map: Array<any>): Array<any>
List the values of an associative array.
Parameters
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>