aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/nodes/DataVizBox/DataVizBox.tsx
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2023-08-27 13:31:46 -0400
committerbobzel <zzzman@gmail.com>2023-08-27 13:31:46 -0400
commit0332a80329328e39c244623d5090331b83df339c (patch)
treec761c0b161face4eea1eaff276c4c220a3b72c85 /src/client/views/nodes/DataVizBox/DataVizBox.tsx
parent2df1f976b5f79213299ea7169c9ded8b216dee6e (diff)
minor cleanup of componentDidMount stuff for dataViz
Diffstat (limited to 'src/client/views/nodes/DataVizBox/DataVizBox.tsx')
-rw-r--r--src/client/views/nodes/DataVizBox/DataVizBox.tsx8
1 files changed, 2 insertions, 6 deletions
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