From 0332a80329328e39c244623d5090331b83df339c Mon Sep 17 00:00:00 2001
From: bobzel <zzzman@gmail.com>
Date: Sun, 27 Aug 2023 13:31:46 -0400
Subject: minor cleanup of componentDidMount stuff for dataViz

---
 src/client/views/nodes/DataVizBox/DataVizBox.tsx | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

(limited to 'src/client/views/nodes/DataVizBox/DataVizBox.tsx')

diff --git a/src/client/views/nodes/DataVizBox/DataVizBox.tsx b/src/client/views/nodes/DataVizBox/DataVizBox.tsx
index b14525993..b9db5fe15 100644
--- a/src/client/views/nodes/DataVizBox/DataVizBox.tsx
+++ b/src/client/views/nodes/DataVizBox/DataVizBox.tsx
@@ -35,12 +35,8 @@ export class DataVizBox extends ViewBoxAnnotatableComponent<FieldViewProps>() {
 
     // all CSV records in the dataset (that aren't an empty row)
     @computed.struct get records() {
-        var records = DataVizBox.dataset.get(CsvCast(this.rootDoc[this.fieldKey]).url.href)
-        var nonEmptyRecords = records?.filter(record => {
-            var notEmpty = false;
-            Object.keys(record).forEach(key => { if (record[key]!=undefined  && record[key]!="") notEmpty = true});
-            return notEmpty})
-        return nonEmptyRecords;
+        var records = DataVizBox.dataset.get(CsvCast(this.rootDoc[this.fieldKey]).url.href);
+        return records?.filter(record => Object.keys(record).some(key => record[key]));
     }
 
     // currently chosen visualization type: line, pie, histogram, table
-- 
cgit v1.2.3-70-g09d2

