From 8628e1d0dc20676b7130d953146ba5f7e9cbf1f7 Mon Sep 17 00:00:00 2001 From: Swoorup Joshi Date: Mon, 16 Jan 2023 22:12:40 +1100 Subject: [PATCH] Skip calcPrecision for empty data --- src/core/gridScale.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/core/gridScale.js b/src/core/gridScale.js index e0e1aa9..686f447 100644 --- a/src/core/gridScale.js +++ b/src/core/gridScale.js @@ -145,6 +145,10 @@ export default function Scale(id, src, specs) { for (var i = 0; i < SAMPLE; i++) { // Random element n let n = Math.floor(Math.random() * ov.dataSubset.length) + + if (ov.dataSubset.length === 0) + continue; + let x = f(ov.dataSubset[n]) if (typeof x === 'number') sample.push(x) else sample = sample.concat(x)