From 4aeffc02334fb873341d93f300f3e153499854fd Mon Sep 17 00:00:00 2001
From: srichman333 <sarah_n_richman@brown.edu>
Date: Thu, 17 Aug 2023 14:12:22 -0400
Subject: layout doc fields organized

---
 src/client/views/nodes/DataVizBox/DataVizBox.tsx | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 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 9c59fcd13..399d6ada0 100644
--- a/src/client/views/nodes/DataVizBox/DataVizBox.tsx
+++ b/src/client/views/nodes/DataVizBox/DataVizBox.tsx
@@ -47,11 +47,11 @@ export class DataVizBox extends ViewBoxAnnotatableComponent<FieldViewProps>() {
         const changedView = this.dataVizView !== data.config_dataViz && (this.layoutDoc._dataViz = data.config_dataViz);
         const changedAxes = this.axes.join('') !== StrListCast(data.config_dataVizAxes).join('') && (this.layoutDoc._dataViz_axes = new List<string>(StrListCast(data.config_dataVizAxes)));
         this.layoutDoc.dataViz_selectedRows = Field.Copy(data.dataViz_selectedRows);
-        this.layoutDoc.histogramBarColors = Field.Copy(data.histogramBarColors);
-        this.layoutDoc.defaultHistogramColor = data.defaultHistogramColor;
-        this.layoutDoc.pieSliceColors = Field.Copy(data.pieSliceColors);
+        this.layoutDoc.dataViz_histogram_barColors = Field.Copy(data.dataViz_histogram_barColors);
+        this.layoutDoc.dataViz_histogram_defaultColor = data.dataViz_histogram_defaultColor;
+        this.layoutDoc.dataViz_pie_sliceColors = Field.Copy(data.dataViz_pie_sliceColors);
         Object.keys(this.layoutDoc).map(key => {
-            if (key.startsWith('histogram_title') || key.startsWith('lineChart_title') || key.startsWith('pieChart_title')) {
+            if (key.startsWith('dataViz_histogram_title') || key.startsWith('dataViz_lineChart_title') || key.startsWith('dataViz_pieChart_title')) {
                 this.layoutDoc['_' + key] = data[key];
             }
         });
@@ -74,11 +74,11 @@ export class DataVizBox extends ViewBoxAnnotatableComponent<FieldViewProps>() {
         anchor.config_dataViz = this.dataVizView;
         anchor.config_dataVizAxes = this.axes.length ? new List<string>(this.axes) : undefined;
         anchor.dataViz_selectedRows = Field.Copy(this.layoutDoc.dataViz_selectedRows);
-        anchor.histogramBarColors = Field.Copy(this.layoutDoc.histogramBarColors);
-        anchor.defaultHistogramColor = this.layoutDoc.defaultHistogramColor;
-        anchor.pieSliceColors = Field.Copy(this.layoutDoc.pieSliceColors);
+        anchor.dataViz_histogram_barColors = Field.Copy(this.layoutDoc.dataViz_histogram_barColors);
+        anchor.dataViz_histogram_defaultColor = this.layoutDoc.dataViz_histogram_defaultColor;
+        anchor.dataViz_pie_sliceColors = Field.Copy(this.layoutDoc.dataViz_pie_sliceColors);
         Object.keys(this.layoutDoc).map(key => {
-            if (key.startsWith('histogram_title') || key.startsWith('lineChart_title') || key.startsWith('pieChart_title')) {
+            if (key.startsWith('dataViz_histogram_title') || key.startsWith('dataViz_lineChart_title') || key.startsWith('dataViz_pieChart_title')) {
                 anchor[key] = this.layoutDoc[key];
             }
         });
@@ -155,7 +155,7 @@ export class DataVizBox extends ViewBoxAnnotatableComponent<FieldViewProps>() {
     componentDidMount() {
         this.props.setContentView?.(this);
         this.fetchData();
-        if (!this.layoutDoc._dataVizView) this.layoutDoc._dataVizView = this.dataVizView;
+        if (!this.layoutDoc.dataViz) this.layoutDoc.dataViz = this.dataVizView;
     }
 
     fetchData() {
-- 
cgit v1.2.3-70-g09d2

