(
dims: ItrParamDims | MapArrayCb<Ctx>,
cb: MapArrayCb<Ctx> | Ctx,
ctx?: Ctx
)
| 976 | mapArray<Ctx, Cb extends MapArrayCb<Ctx>>(dims: ItrParamDims, cb: Cb, ctx?: Ctx, ctxCompat?: Ctx): ReturnType<Cb>[]; |
| 977 | /* eslint-enable max-len */ |
| 978 | mapArray<Ctx>( |
| 979 | dims: ItrParamDims | MapArrayCb<Ctx>, |
| 980 | cb: MapArrayCb<Ctx> | Ctx, |
| 981 | ctx?: Ctx |
| 982 | ): unknown[] { |
| 983 | 'use strict'; |
| 984 | |
| 985 | if (zrUtil.isFunction(dims)) { |
| 986 | ctx = cb as Ctx; |
| 987 | cb = dims; |
| 988 | dims = []; |
| 989 | } |
| 990 | |
| 991 | // ctxCompat just for compat echarts3 |
| 992 | ctx = (ctx || this) as Ctx; |
| 993 | |
| 994 | const result: unknown[] = []; |
| 995 | this.each(dims, function () { |
| 996 | result.push(cb && (cb as MapArrayCb<Ctx>).apply(this, arguments)); |
| 997 | }, ctx); |
| 998 | return result; |
| 999 | } |
| 1000 | |
| 1001 | /** |
| 1002 | * Data mapping to a new List with given dimensions |
no test coverage detected