From ef98eed2ece88c5cae58f49ab6ea8cdd5a9abdeb Mon Sep 17 00:00:00 2001 From: AntoineYANG Date: Wed, 26 Jul 2023 17:42:32 +0800 Subject: [PATCH] fix: bin count result not match --- packages/graphic-walker/src/lib/execExp.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/graphic-walker/src/lib/execExp.ts b/packages/graphic-walker/src/lib/execExp.ts index 93c16757..aa586953 100644 --- a/packages/graphic-walker/src/lib/execExp.ts +++ b/packages/graphic-walker/src/lib/execExp.ts @@ -82,7 +82,7 @@ function binCount(resKey: string, params: IExpParamter[], data: IDataFrame, binS const groupSize = valueWithIndices.length / binSize; - const newValues = valueWithIndices.map(item => { + const newValues = valueWithIndices.sort((a, b) => a.index - b.index).map(item => { let bIndex = Math.floor(item.orderIndex / groupSize); if (bIndex === binSize) bIndex = binSize - 1; return bIndex + 1