diff options
author | srichman333 <sarah_n_richman@brown.edu> | 2024-04-16 17:02:23 -0400 |
---|---|---|
committer | srichman333 <sarah_n_richman@brown.edu> | 2024-04-16 17:02:23 -0400 |
commit | b98f3cb1c0e356c318e4d629e8baa05648c153e2 (patch) | |
tree | 874a30d28aa6521f6ebd620715199c0b18a48ccf /src | |
parent | 982991ca69cd7f844680949ed160e678f89050fc (diff) |
makes histogram on transfer to text
Diffstat (limited to 'src')
-rw-r--r-- | src/client/views/nodes/DataVizBox/DataVizBox.tsx | 3 | ||||
-rw-r--r-- | src/client/views/pdf/GPTPopup/GPTPopup.tsx | 7 |
2 files changed, 6 insertions, 4 deletions
diff --git a/src/client/views/nodes/DataVizBox/DataVizBox.tsx b/src/client/views/nodes/DataVizBox/DataVizBox.tsx index 24199a5e3..19fde7273 100644 --- a/src/client/views/nodes/DataVizBox/DataVizBox.tsx +++ b/src/client/views/nodes/DataVizBox/DataVizBox.tsx @@ -437,7 +437,7 @@ export class DataVizBox extends ViewBoxAnnotatableComponent<FieldViewProps>() im embedding.defaultHistogramColor = this.layoutDoc.defaultHistogramColor; embedding.pieSliceColors = Field.Copy(this.layoutDoc.pieSliceColors); this._props.addDocument?.(embedding); - embedding._dataViz_axes = new List<string>([this.axes[1]]) + embedding._dataViz_axes = new List<string>(axes) this.layoutDoc.dataViz_selectedRows = new List<number>(this.records.map((rec, i) => i)) console.log(embedding.x); @@ -445,7 +445,6 @@ export class DataVizBox extends ViewBoxAnnotatableComponent<FieldViewProps>() im console.log(Number(embedding.x) + 100.0) embedding.x = Number(embedding.x) + 100.0; console.log(embedding.x); - // embedding.y = StrCast(Number(embedding.y) + 100); return true; }; diff --git a/src/client/views/pdf/GPTPopup/GPTPopup.tsx b/src/client/views/pdf/GPTPopup/GPTPopup.tsx index 50835a541..706b44aef 100644 --- a/src/client/views/pdf/GPTPopup/GPTPopup.tsx +++ b/src/client/views/pdf/GPTPopup/GPTPopup.tsx @@ -30,6 +30,7 @@ interface GPTPopupProps {} export class GPTPopup extends ObservableReactComponent<GPTPopupProps> { static Instance: GPTPopup; @observable private chatMode: boolean = false; + private correlatedColumns: string[] = [] @observable public visible: boolean = false; @@ -173,7 +174,9 @@ export class GPTPopup extends ObservableReactComponent<GPTPopupProps> { console.log(res) let json = JSON.parse(res! as string); const keys = Object.keys(json) - console.log(json[keys[0]], json[keys[1]]) + this.correlatedColumns = [] + this.correlatedColumns.push(json[keys[0]]) + this.correlatedColumns.push(json[keys[1]]) GPTPopup.Instance.setText(json[keys[2]] || 'Something went wrong.'); } catch (err) { console.error(err); @@ -199,7 +202,7 @@ export class GPTPopup extends ObservableReactComponent<GPTPopupProps> { }); } - this.createFilteredDoc(); + this.createFilteredDoc(this.correlatedColumns); }; /** |