diff options
author | bobzel <zzzman@gmail.com> | 2023-08-27 13:31:46 -0400 |
---|---|---|
committer | bobzel <zzzman@gmail.com> | 2023-08-27 13:31:46 -0400 |
commit | 0332a80329328e39c244623d5090331b83df339c (patch) | |
tree | c761c0b161face4eea1eaff276c4c220a3b72c85 /src/client/views/nodes/DataVizBox/DataVizBox.tsx | |
parent | 2df1f976b5f79213299ea7169c9ded8b216dee6e (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.tsx | 8 |
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 |