This is an automated email from the ASF dual-hosted git repository. sushuang pushed a commit to branch dataset-trans in repository https://gitbox.apache.org/repos/asf/incubator-echarts.git
commit 4243980aa4881555339e9151d7e6d6e312798dde Author: 100pah <sushuang0...@gmail.com> AuthorDate: Fri Jul 31 16:56:05 2020 +0800 ts: fix type. --- extension-src/dataTool/prepareBoxplotData.ts | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/extension-src/dataTool/prepareBoxplotData.ts b/extension-src/dataTool/prepareBoxplotData.ts index b57575a..1bb733e 100644 --- a/extension-src/dataTool/prepareBoxplotData.ts +++ b/extension-src/dataTool/prepareBoxplotData.ts @@ -17,7 +17,6 @@ * under the License. */ -// @ts-nocheck function asc<T extends number[]>(arr: T): T { arr.sort(function (a, b) { @@ -59,11 +58,21 @@ function quantile(ascArr: number[], p: number): number { * axisData: Array.<string> * } */ -export default function (rawData, opt) { - opt = opt || []; +export default function ( + rawData: number[][], + opt: { + boundIQR?: number | 'none', + layout?: 'horizontal' | 'vertical' + } +): { + boxData: number[][] + outliers: number[][] + axisData: string[] +} { + opt = opt || {}; const boxData = []; const outliers = []; - const axisData = []; + const axisData: string[] = []; const boundIQR = opt.boundIQR; const useExtreme = boundIQR === 'none' || boundIQR === 0; @@ -77,7 +86,7 @@ export default function (rawData, opt) { const min = ascList[0]; const max = ascList[ascList.length - 1]; - const bound = (boundIQR == null ? 1.5 : boundIQR) * (Q3 - Q1); + const bound = (boundIQR == null ? 1.5 : boundIQR as number) * (Q3 - Q1); const low = useExtreme ? min --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@echarts.apache.org For additional commands, e-mail: commits-h...@echarts.apache.org