From ce7a55a8a29bcff8f6384e5df0e202d47d9cb9cb Mon Sep 17 00:00:00 2001 From: bobzel Date: Wed, 27 Dec 2023 16:03:47 -0500 Subject: error fixes. --- src/client/views/nodes/DataVizBox/DataVizBox.tsx | 64 +++++++++++------------- 1 file changed, 30 insertions(+), 34 deletions(-) (limited to 'src') diff --git a/src/client/views/nodes/DataVizBox/DataVizBox.tsx b/src/client/views/nodes/DataVizBox/DataVizBox.tsx index e8e46edbc..3c9105996 100644 --- a/src/client/views/nodes/DataVizBox/DataVizBox.tsx +++ b/src/client/views/nodes/DataVizBox/DataVizBox.tsx @@ -133,13 +133,13 @@ export class DataVizBox extends ViewBoxAnnotatableComponent() { const anchor = !pinProps ? this.Document : this._vizRenderer?.getAnchor(pinProps) ?? - visibleAnchor ?? + visibleAnchor ?? Docs.Create.ConfigDocument({ - title: 'ImgAnchor:' + this.Document.title, - config_panX: NumCast(this.layoutDoc._freeform_panX), - config_panY: NumCast(this.layoutDoc._freeform_panY), - config_viewScale: Cast(this.layoutDoc._freeform_scale, 'number', null), - annotationOn: this.Document, + title: 'ImgAnchor:' + this.Document.title, + config_panX: NumCast(this.layoutDoc._freeform_panX), + config_panY: NumCast(this.layoutDoc._freeform_panY), + config_viewScale: Cast(this.layoutDoc._freeform_scale, 'number', null), + annotationOn: this.Document, // when we clear selection -> we should have it so chartBox getAnchor returns undefined // this is for when we want the whole doc (so when the chartBox getAnchor returns without a marker) /*put in some options*/ @@ -155,7 +155,7 @@ export class DataVizBox extends ViewBoxAnnotatableComponent() { anchor[key] = this.layoutDoc[key]; } }); - + this.addDocument(anchor); //addAsAnnotation && this.addDocument(anchor); return anchor; @@ -269,15 +269,15 @@ export class DataVizBox extends ViewBoxAnnotatableComponent() { layoutDoc: this.layoutDoc, records: this.records, axes: this.axes, - //width: this.SidebarShown? this._props.PanelWidth()*.9/1.2: this._props.PanelWidth() * 0.9, + //width: this.SidebarShown? this._props.PanelWidth()*.9/1.2: this._props.PanelWidth() * 0.9, height: (this._props.PanelHeight() / scale - 32) /* height of 'change view' button */ * 0.9, width: (this._props.PanelWidth() / scale) * 0.9, margin: { top: 10, right: 25, bottom: 75, left: 45 }, }; if (!this.records.length) return 'no data/visualization'; switch (this.dataVizView) { - case DataVizView.TABLE: return ; - case DataVizView.LINECHART: return (this._vizRenderer = r ?? undefined)} />; + case DataVizView.TABLE: return ; + case DataVizView.LINECHART: return (this._vizRenderer = r ?? undefined)} vizBox={this} />; case DataVizView.HISTOGRAM: return (this._vizRenderer = r ?? undefined)} />; case DataVizView.PIECHART: return (this._vizRenderer = r ?? undefined)} margin={{ top: 10, right: 15, bottom: 15, left: 15 }} />; @@ -326,28 +326,28 @@ export class DataVizBox extends ViewBoxAnnotatableComponent() { @action updateSchemaViz = () => { - const getFrom = DocCast(this.layoutDoc.dataViz_asSchema) - const keys = Cast(getFrom.schema_columnKeys, listSpec('string'))?.filter(key => key!="text"); + const getFrom = DocCast(this.layoutDoc.dataViz_asSchema); + const keys = Cast(getFrom.schema_columnKeys, listSpec('string'))?.filter(key => key != 'text'); if (!keys) return; const children = DocListCast(getFrom[Doc.LayoutFieldKey(getFrom)]); - var current: {[key: string]: string}[] = [] - for (let i=0; i() { position: 'absolute', }} onWheel={e => e.stopPropagation()} - ref={this._mainCont} - > + ref={this._mainCont}>
(this.layoutDoc._dataViz = DataVizView.TABLE)} toggleStatus={this.layoutDoc._dataViz === DataVizView.TABLE} /> (this.layoutDoc._dataViz = DataVizView.LINECHART)} toggleStatus={this.layoutDoc._dataViz === DataVizView.LINECHART} /> @@ -397,15 +396,12 @@ export class DataVizBox extends ViewBoxAnnotatableComponent() { */} {this.renderVizView} -
+
() { {this.annotationLayer} {!this._marqueeing || !this._mainCont.current || !this._annotationLayer.current ? null : (