From e22bdd2db60954445c41f7e2ca75a8944de5288f Mon Sep 17 00:00:00 2001 From: bobzel Date: Mon, 17 Mar 2025 16:45:06 -0400 Subject: fixed table box scrolling --- src/client/views/nodes/DataVizBox/components/TableBox.tsx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/client/views/nodes/DataVizBox/components/TableBox.tsx') diff --git a/src/client/views/nodes/DataVizBox/components/TableBox.tsx b/src/client/views/nodes/DataVizBox/components/TableBox.tsx index 7ef4bca6b..221b15372 100644 --- a/src/client/views/nodes/DataVizBox/components/TableBox.tsx +++ b/src/client/views/nodes/DataVizBox/components/TableBox.tsx @@ -101,7 +101,7 @@ export class TableBox extends ObservableReactComponent { return this._props.docView?.()?.screenToViewTransform().Scale || 1; } @computed get rowHeight() { - return (this.viewScale * this._tableHeight) / this._tableDataIds.length; + return (this.viewScale * this._tableHeight) / (this._tableDataIds.length + 1); // add 1 for header row } @computed get startID() { return this.rowHeight ? Math.max(Math.floor(this._scrollTop / this.rowHeight) - 1, 0) : 0; @@ -401,8 +401,9 @@ export class TableBox extends ObservableReactComponent { this._tableHeight = r?.getBoundingClientRect().height ?? 0; } })}> -
+ {/*
*/} + {this.columns.map(col => ( { {this._tableDataIds .filter((rowId, i) => this.startID - 2 <= i && i <= this.endID + 2) - ?.map(rowId => ( + .map(rowId => ( { })} ))} + -
+ {/*
*/}
-- cgit v1.2.3-70-g09d2 From 9e52b7ca60fd9891da6d07c67f89f97ae6f497ee Mon Sep 17 00:00:00 2001 From: bobzel Date: Mon, 2 Jun 2025 17:47:21 -0400 Subject: tweaks to tablebox to show bottom line of bottom row --- src/client/views/nodes/DataVizBox/components/TableBox.tsx | 15 +++++++-------- src/client/views/smartdraw/DrawingFillHandler.tsx | 1 - 2 files changed, 7 insertions(+), 9 deletions(-) (limited to 'src/client/views/nodes/DataVizBox/components/TableBox.tsx') diff --git a/src/client/views/nodes/DataVizBox/components/TableBox.tsx b/src/client/views/nodes/DataVizBox/components/TableBox.tsx index 21bef3426..60f1f2d58 100644 --- a/src/client/views/nodes/DataVizBox/components/TableBox.tsx +++ b/src/client/views/nodes/DataVizBox/components/TableBox.tsx @@ -111,6 +111,7 @@ export class TableBox extends ObservableReactComponent { @action handleScroll = () => { if (!this._props.docView?.()?.ContentDiv?.hidden) { this._scrollTop = this._containerRef?.scrollTop ?? 0; + console.log('scrollTop', this._scrollTop, this.startID * Number(DATA_VIZ_TABLE_ROW_HEIGHT)); } }; @action @@ -400,13 +401,12 @@ export class TableBox extends ObservableReactComponent { this._tableHeight = r?.getBoundingClientRect().height ?? 0; } })}> - {/*
*/} - + - {this.columns.map(col => ( + {this.columns.map((col, i) => ( { : '', border: rowId === this._props.specHighlightedRow ? `solid 3px ${Colors.MEDIUM_BLUE}` : '', }}> - {this.columns.map(col => { + {this.columns.map((col, i) => { let colSelected = false; if (this._props.axes.length > 2) colSelected = this._props.axes[0] === col || this._props.axes[1] === col || this._props.axes[2] === col; else if (this._props.axes.length > 1) colSelected = this._props.axes[0] === col || this._props.axes[1] === col; else if (this._props.axes.length > 0) colSelected = this._props.axes[0] === col; if (this._props.titleCol === col) colSelected = true; return ( - +
{this._props.records[rowId][col] as string | number}
); })} ))} - + - {/*
*/}
diff --git a/src/client/views/smartdraw/DrawingFillHandler.tsx b/src/client/views/smartdraw/DrawingFillHandler.tsx index 23055fdc3..f773957e7 100644 --- a/src/client/views/smartdraw/DrawingFillHandler.tsx +++ b/src/client/views/smartdraw/DrawingFillHandler.tsx @@ -6,7 +6,6 @@ import { Upload } from '../../../server/SharedMediaTypes'; import { gptDescribeImage } from '../../apis/gpt/GPT'; import { Docs } from '../../documents/Documents'; import { Networking } from '../../Network'; -import { DocCreatorMenu } from '../nodes/DataVizBox/DocCreatorMenu/DocCreatorMenu'; import { DocumentView, DocumentViewInternal } from '../nodes/DocumentView'; import { OpenWhere } from '../nodes/OpenWhere'; import { AspectRatioLimits, FireflyDimensionsMap, FireflyImageDimensions, FireflyStylePresets } from './FireflyConstants'; -- cgit v1.2.3-70-g09d2 From 8b6f03c191a355a34fa01183ce2b6bd86240ebaf Mon Sep 17 00:00:00 2001 From: bobzel Date: Mon, 2 Jun 2025 17:49:48 -0400 Subject: from last --- src/client/views/nodes/DataVizBox/components/TableBox.tsx | 1 - src/fields/Doc.ts | 3 --- 2 files changed, 4 deletions(-) (limited to 'src/client/views/nodes/DataVizBox/components/TableBox.tsx') diff --git a/src/client/views/nodes/DataVizBox/components/TableBox.tsx b/src/client/views/nodes/DataVizBox/components/TableBox.tsx index 60f1f2d58..9e0868cd5 100644 --- a/src/client/views/nodes/DataVizBox/components/TableBox.tsx +++ b/src/client/views/nodes/DataVizBox/components/TableBox.tsx @@ -111,7 +111,6 @@ export class TableBox extends ObservableReactComponent { @action handleScroll = () => { if (!this._props.docView?.()?.ContentDiv?.hidden) { this._scrollTop = this._containerRef?.scrollTop ?? 0; - console.log('scrollTop', this._scrollTop, this.startID * Number(DATA_VIZ_TABLE_ROW_HEIGHT)); } }; @action diff --git a/src/fields/Doc.ts b/src/fields/Doc.ts index 6e7f95897..6e0c3d112 100644 --- a/src/fields/Doc.ts +++ b/src/fields/Doc.ts @@ -608,9 +608,6 @@ export namespace Doc { const value = (fields as { [key: string]: Opt })[key]; if (!skipUndefineds || value !== undefined) { // Do we want to filter out undefineds? - if (typeof value === 'object' && 'values' in value) { - //console.log(value); - } doc[key] = value; } }); -- cgit v1.2.3-70-g09d2