From e72b603383f608201d9276f33768f3d532137153 Mon Sep 17 00:00:00 2001 From: susiwen Date: Tue, 23 Apr 2019 16:13:39 +0800 Subject: [PATCH 1/3] Fix negetive number or string exist in dimensions array, the corresponding line won't show (#10343) --- src/data/helper/completeDimensions.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/data/helper/completeDimensions.js b/src/data/helper/completeDimensions.js index 890531d7e1..4c5af8f453 100644 --- a/src/data/helper/completeDimensions.js +++ b/src/data/helper/completeDimensions.js @@ -117,7 +117,7 @@ function completeDimensions(sysDims, source, opt) { // Note: It is allowed that `dataDims.length` is `0`, e.g., options is // `{encode: {x: -1, y: 1}}`. Should not filter anything in // this case. - if (dataDims.length === 1 && dataDims[0] < 0) { + if (dataDims.length === 1 && dataDims[0] == null) { encodeDef.set(coordDim, false); return; } From 206885890b6c149772841b060715beb3c9297dc5 Mon Sep 17 00:00:00 2001 From: susiwen Date: Sun, 5 May 2019 13:06:46 +0800 Subject: [PATCH 2/3] Check if dataDims[0] type is number or not --- src/data/helper/completeDimensions.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/data/helper/completeDimensions.js b/src/data/helper/completeDimensions.js index 4c5af8f453..7bacd99c1b 100644 --- a/src/data/helper/completeDimensions.js +++ b/src/data/helper/completeDimensions.js @@ -117,7 +117,7 @@ function completeDimensions(sysDims, source, opt) { // Note: It is allowed that `dataDims.length` is `0`, e.g., options is // `{encode: {x: -1, y: 1}}`. Should not filter anything in // this case. - if (dataDims.length === 1 && dataDims[0] == null) { + if (dataDims.length === 1 && typeof dataDims[0] === 'number' && dataDims[0] < 0) { encodeDef.set(coordDim, false); return; } From bc0722969363c76fb952976a3b60047706094ff8 Mon Sep 17 00:00:00 2001 From: sushuang Date: Sun, 5 May 2019 14:00:10 +0800 Subject: [PATCH 3/3] Tweak the "is string" check. Tweak the "is string" check. Should better be the same as the existing checking. --- src/data/helper/completeDimensions.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/data/helper/completeDimensions.js b/src/data/helper/completeDimensions.js index 7bacd99c1b..0034094f81 100644 --- a/src/data/helper/completeDimensions.js +++ b/src/data/helper/completeDimensions.js @@ -117,7 +117,7 @@ function completeDimensions(sysDims, source, opt) { // Note: It is allowed that `dataDims.length` is `0`, e.g., options is // `{encode: {x: -1, y: 1}}`. Should not filter anything in // this case. - if (dataDims.length === 1 && typeof dataDims[0] === 'number' && dataDims[0] < 0) { + if (dataDims.length === 1 && !isString(dataDims[0]) && dataDims[0] < 0) { encodeDef.set(coordDim, false); return; }