Interface Selection

Hierarchy

Index

Index signatures

Properties

Methods

Index signatures

(n: number): T in Array<T>

Parameters

  • n: number

Returns

T in Array<T>

Properties

public append: (name: string) => D3.Selection

public attr: { (name: string): string; (name: string, value: any): D3.Selection; (name: string, valueFunction: (data: any, index: number) => any): D3.Selection; (attrValueMap: Object): D3.Selection; }

(): string

Returns

string

(): Selection

Returns

Selection

(): Selection

Returns

Selection

(): Selection

Returns

Selection

public classed: { (name: string): string; (name: string, value: any): D3.Selection; (name: string, valueFunction: (data: any, index: number) => any): D3.Selection; }

(): string

Returns

string

(): Selection

Returns

Selection

(): Selection

Returns

Selection

public data: { (values: (data: any, index?: number) => any[], key?: (data: any, index?: number) => any): D3.UpdateSelection; (values: any[], key?: (data: any, index?: number) => any): D3.UpdateSelection; (): any[]; }

(): UpdateSelection

Returns

UpdateSelection

(): UpdateSelection

Returns

UpdateSelection

(): Array<any>

Returns

Array<any>

public datum: { (values: (data: any, index: number) => any): D3.UpdateSelection; (values: any): D3.UpdateSelection; (): any; }

(): UpdateSelection

Returns

UpdateSelection

(): UpdateSelection

Returns

UpdateSelection

(): any

Returns

any

public empty: () => boolean

public filter: (filter: (data: any, index: number) => boolean, thisArg?: any) => D3.UpdateSelection

(): UpdateSelection

Returns

UpdateSelection

public html: { (): string; (value: any): D3.Selection; (valueFunction: (data: any, index: number) => any): D3.Selection; }

(): string

Returns

string

(): Selection

Returns

Selection

(): Selection

Returns

Selection

public insert: (name: string, before: string) => D3.Selection

public length: number

Gets or sets the length of the array. This is a number one higher than the highest element defined in an array.

public node: () => Element

Returns the first non-null element in the current selection. If the selection is empty, returns null.

public on: { (type: string): (data: any, index: number) => any; (type: string, listener: (data: any, index: number) => any, capture?: boolean): D3.Selection; }

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

Returns

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

(): Selection

Returns

Selection

public order: () => D3.Selection

Re-inserts elements into the document such that the document order matches the selection order. This is equivalent to calling sort() if the data is already sorted, but much faster.

public property: { (name: string): void; (name: string, value: any): D3.Selection; (name: string, valueFunction: (data: any, index: number) => any): D3.Selection; (propertyValueMap: Object): D3.Selection; }

()

(): Selection

Returns

Selection

(): Selection

Returns

Selection

(): Selection

Returns

Selection

public remove: () => D3.Selection

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 style: { (name: string): string; (name: string, value: any, priority?: string): D3.Selection; (name: string, valueFunction: (data: any, index: number) => any, priority?: string): D3.Selection; (styleValueMap: Object): D3.Selection; }

(): string

Returns

string

(): Selection

Returns

Selection

(): Selection

Returns

Selection

(): Selection

Returns

Selection

public text: { (): string; (value: any): D3.Selection; (valueFunction: (data: any, index: number) => any): D3.Selection; }

(): string

Returns

string

(): Selection

Returns

Selection

(): Selection

Returns

Selection

Methods

public call(callback: (selection: D3.Selection, ...args: any[]) => void, args?: Array<any>): Selection

Parameters

  • callback: (selection: D3.Selection, ...args: any[]) => void
  • args?: Array<any> optional

Returns

Selection

public concat(items?: Array<U extends T[]>): Array<T>

Combines two or more arrays.

Parameters

  • items?: Array<U extends T[]> optional

    Additional items to add to the end of array1.

Returns

Array<T>

public concat(items?: Array<T>): Array<T>

Combines two or more arrays.

Parameters

  • items?: Array<T> optional

    Additional items to add to the end of array1.

Returns

Array<T>

public each(eachFunction: (data: any, index: number) => any): Selection

Parameters

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

Returns

Selection

public every(callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg?: any): boolean

Determines whether all the members of an array satisfy the specified test.

Parameters

  • callbackfn: (value: T, index: number, array: T[]) => boolean

    A function that accepts up to three arguments. The every method calls the callbackfn function for each element in array1 until the callbackfn returns false, or until the end of the array.

  • thisArg?: any optional

    An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.

Returns

boolean

public forEach(callbackfn: (value: T, index: number, array: T[]) => void, thisArg?: any)

Performs the specified action for each element in an array.

Parameters

  • callbackfn: (value: T, index: number, array: T[]) => void

    A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the array.

  • thisArg?: any optional

    An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.

public indexOf(searchElement: T in Array<T>, fromIndex?: number): number

Returns the index of the first occurrence of a value in an array.

Parameters

  • searchElement: T in Array<T>

    The value to locate in the array.

  • fromIndex?: number optional

    The array index at which to begin the search. If fromIndex is omitted, the search starts at index 0.

Returns

number

public join(separator?: string): string

Adds all the elements of an array separated by the specified separator string.

Parameters

  • separator?: string optional

    A string used to separate one element of an array from the next in the resulting String. If omitted, the array elements are separated with a comma.

Returns

string

public lastIndexOf(searchElement: T in Array<T>, fromIndex?: number): number

Returns the index of the last occurrence of a specified value in an array.

Parameters

  • searchElement: T in Array<T>

    The value to locate in the array.

  • fromIndex?: number optional

    The array index at which to begin the search. If fromIndex is omitted, the search starts at the last index in the array.

Returns

number

public map(callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any): Array<U>

Calls a defined callback function on each element of an array, and returns an array that contains the results.

Parameters

  • callbackfn: (value: T, index: number, array: T[]) => U

    A function that accepts up to three arguments. The map method calls the callbackfn function one time for each element in the array.

  • thisArg?: any optional

    An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.

Returns

Array<U>

public pop(): T in Array<T>

Removes the last element from an array and returns it.

Returns

T in Array<T>

public push(items?: Array<T>): number

Appends new elements to an array, and returns the new length of the array.

Parameters

  • items?: Array<T> optional

    New elements of the Array.

Returns

number

public reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue?: T in Array<T>): T in Array<T>

Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.

Parameters

  • callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T

    A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array.

  • initialValue?: T in Array<T> optional

    If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.

Returns

T in Array<T>

public reduce(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U

Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.

Parameters

  • callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U

    A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array.

  • initialValue: U

    If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.

Returns

U

public reduceRight(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue?: T in Array<T>): T in Array<T>

Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.

Parameters

  • callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T

    A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array.

  • initialValue?: T in Array<T> optional

    If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.

Returns

T in Array<T>

public reduceRight(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U

Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.

Parameters

  • callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U

    A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array.

  • initialValue: U

    If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.

Returns

U

public reverse(): Array<T>

Reverses the elements in an Array.

Returns

Array<T>

public shift(): T in Array<T>

Removes the first element from an array and returns it.

Returns

T in Array<T>

public size(): number

Returns the total number of elements in the current selection.

Returns

number

public slice(start?: number, end?: number): Array<T>

Returns a section of an array.

Parameters

  • start?: number optional

    The beginning of the specified portion of the array.

  • end?: number optional

    The end of the specified portion of the array.

Returns

Array<T>

public some(callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg?: any): boolean

Determines whether the specified callback function returns true for any element of an array.

Parameters

  • callbackfn: (value: T, index: number, array: T[]) => boolean

    A function that accepts up to three arguments. The some method calls the callbackfn function for each element in array1 until the callbackfn returns true, or until the end of the array.

  • thisArg?: any optional

    An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.

Returns

boolean

public sort(comparator?: (a: T, b: T) => number): Selection

Sorts the elements in the current selection according to the specified comparator function.

Parameters

  • comparator?: (a: T, b: T) => number optional

    a comparison function, which will be passed two data elements a and b to compare, and should return either a negative, positive, or zero value to indicate their relative order.

Returns

Selection

public splice(start: number): Array<T>

Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements.

Parameters

  • start: number

    The zero-based location in the array from which to start removing elements.

Returns

Array<T>

public splice(start: number, deleteCount: number, items?: Array<T>): Array<T>

Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements.

Parameters

  • start: number

    The zero-based location in the array from which to start removing elements.

  • deleteCount: number

    The number of elements to remove.

  • items?: Array<T> optional

    Elements to insert into the array in place of the deleted elements.

Returns

Array<T>

public toLocaleString(): string

Returns

string

public toString(): string

Returns a string representation of an array.

Returns

string

public transition(): Transition

Starts a transition for the current selection. Transitions behave much like selections, except operators animate smoothly over time rather than applying instantaneously.

Returns

Transition

public unshift(items?: Array<T>): number

Inserts new elements at the start of an array.

Parameters

  • items?: Array<T> optional

    Elements to insert at the start of the Array.

Returns

number