聚合表达式定义通过一组数据处理的计算。
架构:[operator: string, initialValue?: boolean | number, mapExpression: Expression] 运算符:一个表达式函数,然后针对群集中每个点由
mapExpression
计算的所有值应用。 支持的运算符:o 对于数字:
+
、
*
、
max
、
min
o 对于布尔值:
all
、
any
initialValue:可选,一个初始值,其中第一个计算值聚合为 。
mapExpression:针对数据集中的每个点应用的表达式。
reduce((previous
Value: any, current
Value: any, current
Index: number, array: any[]) => any)
为数组中的所有元素调用指定的回调函数。 回调函数的返回值是累积的结果,并且作为对回调函数的下一个调用中的参数提供。
reduce((previous
Value: any, current
Value: any, current
Index: number, array: any[]) => any, any)
reduce<U>((previous
Value: U, current
Value: any, current
Index: number, array: any[]) => U, U)
为数组中的所有元素调用指定的回调函数。 回调函数的返回值是累积的结果,并且作为对回调函数的下一个调用中的参数提供。
reduce
Right((previous
Value: any, current
Value: any, current
Index: number, array: any[]) => any)
以降序为数组中的所有元素调用指定的回调函数。 回调函数的返回值是累积的结果,并且作为对回调函数的下一个调用中的参数提供。
reduce
Right((previous
Value: any, current
Value: any, current
Index: number, array: any[]) => any, any)
reduce
Right<U>((previous
Value: U, current
Value: any, current
Index: number, array: any[]) => U, U)
以降序为数组中的所有元素调用指定的回调函数。 回调函数的返回值是累积的结果,并且作为对回调函数的下一个调用中的参数提供。
reverse()
反转 Array 中的元素。
shift()
从数组中移除第一个元素并将返回该元素。
slice(number, number)
返回一个数组中的一部分。
some((value: any, index: number, array: any[]) => unknown, any)
确定指定的回调函数是否为数组的任何元素返回 true。
sort((a: any, b: any) => number)
对数组进行排序。
splice(number, number)
从一个数组中移除元素,如有必要,在所移除元素的位置上插入新元素,并返回所移除的元素。
splice(number, number, any[])
从一个数组中移除元素,如有必要,在所移除元素的位置上插入新元素,并返回所移除的元素。
to
Locale
String()
返回数组的字符串表示形式。 元素使用其 toLocalString 方法转换为字符串。
to
String()
返回数组的字符串表示形式。
unshift(any[])
在数组的开头插入新元素。
function every(callbackfn: (value: any, index: number, array: any[]) => unknown, thisArg?: any): boolean
callbackfn
(value: any, index: number, array: any[]) => unknown
最多可以接受三个参数的函数。 每个方法为数组中的每个元素调用 callbackfn 函数,直到 callbackfn 返回一个可强制转换为布尔值 false 的值,或直到数组的末尾。
thisArg
此关键字可以在 callbackfn 函数中引用的对象。
如果省略 thisArg,则 undefined 用作此值。
boolean
function filter(callbackfn: (value: any, index: number, array: any[]) => unknown, thisArg?: any): any[]
callbackfn
(value: any, index: number, array: any[]) => unknown
最多可以接受三个参数的函数。 筛选器方法为数组中的每个元素调用一次 callbackfn 函数。
thisArg
此关键字可以在 callbackfn 函数中引用的对象。 如果省略 thisArg,则 undefined 用作此值。
any[]
function filter<S>(callbackfn: (value: any, index: number, array: any[]) => value, thisArg?: any): S[]
callbackfn
(value: any, index: number, array: any[]) => value
最多可以接受三个参数的函数。 筛选器方法为数组中的每个元素调用一次 callbackfn 函数。
thisArg
此关键字可以在 callbackfn 函数中引用的对象。 如果省略 thisArg,则 undefined 用作此值。
function forEach(callbackfn: (value: any, index: number, array: any[]) => void, thisArg?: any)
callbackfn
(value: any, index: number, array: any[]) => void
最多可以接受三个参数的函数。 forEach 为数组中的每个元素调用一次 callbackfn 函数。
thisArg
此关键字可以在 callbackfn 函数中引用的 对象。 如果省略 thisArg,则将 undefined 用作此值。
function map<U>(callbackfn: (value: any, index: number, array: any[]) => U, thisArg?: any): U[]
callbackfn
(value: any, index: number, array: any[]) => U
最多可以接受三个参数的函数。 map 方法为数组中的每个元素调用一次 callbackfn 函数。
thisArg
此关键字可以在 callbackfn 函数中引用的 对象。 如果省略 thisArg,则将 undefined 用作此值。
function reduce(callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: any[]) => any): any
callbackfn
(previousValue: any, currentValue: any, currentIndex: number, array: any[]) => any
一个最多接受四个参数的函数。 reduce 方法为数组中的每个元素调用一次 callbackfn 函数。
function reduce(callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: any[]) => any, initialValue: any): any
callbackfn
(previousValue: any, currentValue: any, currentIndex: number, array: any[]) => any
function reduce<U>(callbackfn: (previousValue: U, currentValue: any, currentIndex: number, array: any[]) => U, initialValue: U): U
callbackfn
(previousValue: U, currentValue: any, currentIndex: number, array: any[]) => U
一个最多接受四个参数的函数。 reduce 方法为数组中的每个元素调用一次 callbackfn 函数。
initialValue
如果指定了 initialValue,则将其用作开始累积的初始值。 对 callbackfn 函数的第一次调用将此值作为参数提供,而不是数组值。
function reduceRight(callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: any[]) => any): any
callbackfn
(previousValue: any, currentValue: any, currentIndex: number, array: any[]) => any
一个最多接受四个参数的函数。 reduceRight 方法为数组中的每个元素调用回调fn 函数一次。
function reduceRight(callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: any[]) => any, initialValue: any): any
callbackfn
(previousValue: any, currentValue: any, currentIndex: number, array: any[]) => any
function reduceRight<U>(callbackfn: (previousValue: U, currentValue: any, currentIndex: number, array: any[]) => U, initialValue: U): U
callbackfn
(previousValue: U, currentValue: any, currentIndex: number, array: any[]) => U
一个最多接受四个参数的函数。 reduceRight 方法为数组中的每个元素调用回调fn 函数一次。
initialValue
如果指定了 initialValue,则将其用作开始累积的初始值。 对 callbackfn 函数的第一次调用将此值作为参数提供,而不是数组值。
function some(callbackfn: (value: any, index: number, array: any[]) => unknown, thisArg?: any): boolean
callbackfn
(value: any, index: number, array: any[]) => unknown
最多可以接受三个参数的函数。 一些 方法为数组中的每个元素调用 callbackfn 函数,直到 callbackfn 返回一个可强制转换为布尔值 true 的值,或直到数组的末尾。
thisArg
此关键字可以在 callbackfn 函数中引用的 对象。
如果省略 thisArg,则将 undefined 用作此值。
boolean