aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/client/views/nodes/DataVizBox/DataVizBox.tsx14
-rw-r--r--src/client/views/pdf/GPTPopup/GPTPopup.tsx8
2 files changed, 19 insertions, 3 deletions
diff --git a/src/client/views/nodes/DataVizBox/DataVizBox.tsx b/src/client/views/nodes/DataVizBox/DataVizBox.tsx
index dbba9c7f3..a6de64d85 100644
--- a/src/client/views/nodes/DataVizBox/DataVizBox.tsx
+++ b/src/client/views/nodes/DataVizBox/DataVizBox.tsx
@@ -427,19 +427,27 @@ export class DataVizBox extends ViewBoxAnnotatableComponent<FieldViewProps>() im
GPTPopup.Instance.generateDataAnalysis();
});
+ /**
+ * creates a new dataviz document filter from this one
+ * it appears to the right of this document, with the
+ * parameters passed in being used to create an initial display
+ */
createFilteredDoc = (axes?: any, type?: DataVizView) => {
-
const embedding = Doc.MakeEmbedding(this.Document!);
- embedding._dataViz = DataVizView.HISTOGRAM;
+ embedding._layout_showSidebar = false;
+ embedding._dataViz = type? type : DataVizView.HISTOGRAM;
embedding._dataViz_axes = new List<string>(axes);
embedding._dataViz_parentViz = this.Document;
embedding.histogramBarColors = Field.Copy(this.layoutDoc.histogramBarColors);
embedding.defaultHistogramColor = this.layoutDoc.defaultHistogramColor;
embedding.pieSliceColors = Field.Copy(this.layoutDoc.pieSliceColors);
+ embedding._layout_showSidebar = false;
+ embedding.width = NumCast(this.layoutDoc._width)- this.sidebarWidth();
+ embedding._layout_sidebarWidthPercent = "0%";
this._props.addDocument?.(embedding);
embedding._dataViz_axes = new List<string>(axes)
this.layoutDoc.dataViz_selectedRows = new List<number>(this.records.map((rec, i) => i))
- embedding.x = Number(embedding.x) + 100.0;
+ embedding.x = Number(embedding.x) + Number(this.Document.width);
return true;
};
diff --git a/src/client/views/pdf/GPTPopup/GPTPopup.tsx b/src/client/views/pdf/GPTPopup/GPTPopup.tsx
index 686ef9c28..40946cd36 100644
--- a/src/client/views/pdf/GPTPopup/GPTPopup.tsx
+++ b/src/client/views/pdf/GPTPopup/GPTPopup.tsx
@@ -152,6 +152,10 @@ export class GPTPopup extends ObservableReactComponent<GPTPopupProps> {
this.setLoading(false);
};
+ /**
+ * Completes an API call to generate a summary of
+ * this.selectedText in the popup.
+ */
generateSummary = async () => {
GPTPopup.Instance.setVisible(true);
GPTPopup.Instance.setMode(GPTPopupMode.SUMMARY);
@@ -166,6 +170,10 @@ export class GPTPopup extends ObservableReactComponent<GPTPopupProps> {
GPTPopup.Instance.setLoading(false);
}
+ /**
+ * Completes an API call to generate an analysis of
+ * this.dataJson in the popup.
+ */
generateDataAnalysis = async () => {
GPTPopup.Instance.setVisible(true);
GPTPopup.Instance.setLoading(true);