diff options
author | Nathan-SR <144961007+Nathan-SR@users.noreply.github.com> | 2024-08-21 18:39:25 -0400 |
---|---|---|
committer | Nathan-SR <144961007+Nathan-SR@users.noreply.github.com> | 2024-08-21 18:39:25 -0400 |
commit | ed88af4bdc68b22c247a2030e8bdc5775293bfe6 (patch) | |
tree | c7a65f6a9bc790ce56e02b7795f1cc397e379e11 /src/client/views/nodes/DataVizBox/DataVizBox.tsx | |
parent | 888c710b55f747bdeadcf2e862e6dde69d4450c0 (diff) |
work on fields dashboard
Diffstat (limited to 'src/client/views/nodes/DataVizBox/DataVizBox.tsx')
-rw-r--r-- | src/client/views/nodes/DataVizBox/DataVizBox.tsx | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/src/client/views/nodes/DataVizBox/DataVizBox.tsx b/src/client/views/nodes/DataVizBox/DataVizBox.tsx index 808bc182a..eaf5c1758 100644 --- a/src/client/views/nodes/DataVizBox/DataVizBox.tsx +++ b/src/client/views/nodes/DataVizBox/DataVizBox.tsx @@ -63,7 +63,8 @@ export class DataVizBox extends ViewBoxAnnotatableComponent<FieldViewProps>() { @observable _marqueeing: number[] | undefined = undefined; @observable _savedAnnotations = new ObservableMap<number, HTMLDivElement[]>(); @observable _specialHighlightedRow: number | undefined = undefined; - @observable _GPTSummary: ObservableMap<string, string> | undefined = undefined; + @observable GPTSummary: ObservableMap<string, string> | undefined = undefined; + @observable fieldTypes: ObservableMap<string, string> = new ObservableMap(); @observable _GPTLoading: boolean = false; constructor(props: FieldViewProps) { @@ -145,6 +146,18 @@ export class DataVizBox extends ViewBoxAnnotatableComponent<FieldViewProps>() { this._specialHighlightedRow = row; } + @action setFieldType = (field: string, type: string) => { + this.fieldTypes?.set(field, type); + } + + getFieldType = (field: string): string => { + return this.fieldTypes?.get(field) ?? ''; + } + + getFieldDescription = (field: string): string => { + return this.GPTSummary?.get(field) ?? ''; + } + @action // pinned / linked anchor doc includes selected rows, graph titles, and graph colors restoreView = (data: Doc) => { // const changedView = data.config_dataViz && this.dataVizView !== data.config_dataViz && (this.layoutDoc._dataViz = data.config_dataViz); @@ -516,10 +529,10 @@ export class DataVizBox extends ViewBoxAnnotatableComponent<FieldViewProps>() { const res = await gptAPICall(prompt, GPTCallType.VIZSUM); if (res) { - this._GPTSummary = new ObservableMap(); + this.GPTSummary = new ObservableMap(); const descs: {[col: string]: string} = JSON.parse(res); for (const [key, val] of Object.entries(descs)) { - this._GPTSummary.set(key, val); + this.GPTSummary.set(key, val); } console.log(res, descs); |