From 1ccbb22c29ea406dae824b9163ddc676263bb83a Mon Sep 17 00:00:00 2001
From: Naafiyan Ahmed <naafiyan@gmail.com>
Date: Wed, 6 Jul 2022 20:41:27 -0400
Subject: cleaned up code for chartbox

---
 src/client/views/nodes/DataVizBox/DataVizBox.tsx | 22 +++++-----------------
 1 file changed, 5 insertions(+), 17 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 0c1063e0c..c5ad3c84d 100644
--- a/src/client/views/nodes/DataVizBox/DataVizBox.tsx
+++ b/src/client/views/nodes/DataVizBox/DataVizBox.tsx
@@ -41,23 +41,6 @@ export class DataVizBox extends ViewBoxBaseComponent<FieldViewProps>() {
 
     public static LayoutString(fieldKey: string) {  return FieldView.LayoutString(DataVizBox, fieldKey);  }
 
-    @action
-    private async createPairs() {
-        // const xVals: number[] = [0, 1, 2, 3, 4, 5];
-        // // const yVals: number[] = [10, 20, 30, 40, 50, 60];
-        // const yVals: number[] = [1, 2, 3, 4, 5, 6];
-        // let pairs: {
-        //     x: number,
-        //     y:number
-        // }[] = [];
-        // if (xVals.length != yVals.length) return pairs;
-        // for (let i = 0; i < xVals.length; i++) {
-        //     pairs.push({x: xVals[i], y: yVals[i]});
-        // }
-        // this.pairs = pairs;
-        // this.pairs = await this.fetchData();
-    }
-
     @computed get selectView() {
         switch(this.currView) {
             case "table":
@@ -107,6 +90,11 @@ export class DataVizBox extends ViewBoxBaseComponent<FieldViewProps>() {
     }
 
     render() {
+
+        if (this.pairs.length == 0) {
+            return <div>Loading...</div>
+        }
+
         return (
             <div className="dataViz">
                 <button onClick={(e) => this.changeViewHandler(e)}>Change View</button>
-- 
cgit v1.2.3-70-g09d2

