aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/nodes/DataVizBox/DataVizBox.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/views/nodes/DataVizBox/DataVizBox.tsx')
-rw-r--r--src/client/views/nodes/DataVizBox/DataVizBox.tsx8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/client/views/nodes/DataVizBox/DataVizBox.tsx b/src/client/views/nodes/DataVizBox/DataVizBox.tsx
index c07ab5ba1..284923092 100644
--- a/src/client/views/nodes/DataVizBox/DataVizBox.tsx
+++ b/src/client/views/nodes/DataVizBox/DataVizBox.tsx
@@ -15,6 +15,7 @@ import './DataVizBox.scss';
import { Histogram } from './components/Histogram';
import { PieChart } from './components/PieChart';
import { Toggle, ToggleType, Type } from 'browndash-components';
+import { Utils } from '../../../../Utils';
export enum DataVizView {
TABLE = 'table',
@@ -162,7 +163,12 @@ export class DataVizBox extends ViewBoxAnnotatableComponent<FieldViewProps>() {
if (DataVizBox.pairSet.has(CsvCast(this.rootDoc[this.fieldKey]).url.href)) return;
DataVizBox.pairSet.set(CsvCast(this.rootDoc[this.fieldKey]).url.href, []);
fetch('/csvData?uri=' + this.dataUrl?.url.href) //
- .then(res => res.json().then(action(res => !res.errno && DataVizBox.pairSet.set(CsvCast(this.rootDoc[this.fieldKey]).url.href, res))));
+ .then(res => res.json().then(action(res => {
+ if (!res.errno) {
+ DataVizBox.pairSet.set(CsvCast(this.rootDoc[this.fieldKey]).url.href, res);
+ if (!this.dataDoc.dataViz_rowGuids && this.pairs) this.dataDoc.dataViz_rowGuids = new List<string>(this.pairs.map(row => Utils.GenerateGuid()));
+ }
+ })));
}
render() {