diff options
Diffstat (limited to 'src/client/views/nodes/DataVizBox/DataVizBox.tsx')
-rw-r--r-- | src/client/views/nodes/DataVizBox/DataVizBox.tsx | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/client/views/nodes/DataVizBox/DataVizBox.tsx b/src/client/views/nodes/DataVizBox/DataVizBox.tsx index b98f65054..b14525993 100644 --- a/src/client/views/nodes/DataVizBox/DataVizBox.tsx +++ b/src/client/views/nodes/DataVizBox/DataVizBox.tsx @@ -33,9 +33,14 @@ export class DataVizBox extends ViewBoxAnnotatableComponent<FieldViewProps>() { static dataset = new ObservableMap<string, { [key: string]: string }[]>(); private _vizRenderer: LineChart | Histogram | PieChart | undefined; - // all CSV records in the dataset + // all CSV records in the dataset (that aren't an empty row) @computed.struct get records() { - return DataVizBox.dataset.get(CsvCast(this.rootDoc[this.fieldKey]).url.href); + 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; } // currently chosen visualization type: line, pie, histogram, table |