aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/nodes/DataVizBox/components/TableBox.tsx
diff options
context:
space:
mode:
authorA.J. Shulman <Shulman.aj@gmail.com>2025-05-11 10:46:15 -0400
committerA.J. Shulman <Shulman.aj@gmail.com>2025-05-11 10:46:15 -0400
commitb87b2105e966928518c96c7702b68c12344ffdd7 (patch)
tree84fd5ecede3af9d773c10d02908cdde27da1a759 /src/client/views/nodes/DataVizBox/components/TableBox.tsx
parent0db4583914e43e6efdba3e86a614a19956e73b5e (diff)
parent0c3f86d57225a2991920adef3a337bc13e408ac0 (diff)
Merge branch 'master' into agent-web-working
Diffstat (limited to 'src/client/views/nodes/DataVizBox/components/TableBox.tsx')
-rw-r--r--src/client/views/nodes/DataVizBox/components/TableBox.tsx17
1 files changed, 8 insertions, 9 deletions
diff --git a/src/client/views/nodes/DataVizBox/components/TableBox.tsx b/src/client/views/nodes/DataVizBox/components/TableBox.tsx
index 7ef4bca6b..ad2731109 100644
--- a/src/client/views/nodes/DataVizBox/components/TableBox.tsx
+++ b/src/client/views/nodes/DataVizBox/components/TableBox.tsx
@@ -5,7 +5,6 @@ import * as React from 'react';
import { ClientUtils, setupMoveUpEvents } from '../../../../../ClientUtils';
import { emptyFunction } from '../../../../../Utils';
import { Doc, Field, NumListCast } from '../../../../../fields/Doc';
-import { DocData } from '../../../../../fields/DocSymbols';
import { List } from '../../../../../fields/List';
import { listSpec } from '../../../../../fields/Schema';
import { Cast, DocCast } from '../../../../../fields/Types';
@@ -20,7 +19,7 @@ import './Chart.scss';
const { DATA_VIZ_TABLE_ROW_HEIGHT } = require('../../../global/globalCssVariables.module.scss'); // prettier-ignore
interface TableBoxProps {
- Document: Doc;
+ Doc: Doc;
layoutDoc: Doc;
records: { [key: string]: unknown }[];
selectAxes: (axes: string[]) => void;
@@ -82,7 +81,7 @@ export class TableBox extends ObservableReactComponent<TableBoxProps> {
}
@computed get parentViz() {
- return DocCast(this._props.Document.dataViz_parentViz);
+ return DocCast(this._props.Doc.dataViz_parentViz);
}
@computed get columns() {
@@ -129,7 +128,7 @@ export class TableBox extends ObservableReactComponent<TableBoxProps> {
selected.splice(selected.indexOf(rowId), 1);
} else selected?.push(rowId);
e.stopPropagation();
- this.hasRowsToFilter = selected.length > 0;
+ this.hasRowsToFilter = (selected?.length ?? 0) > 0;
};
columnPointerDown = (e: React.PointerEvent, col: string) => {
@@ -140,28 +139,28 @@ export class TableBox extends ObservableReactComponent<TableBoxProps> {
e,
moveEv => {
// dragging off a column to create a brushed DataVizBox
- const sourceAnchorCreator = () => this._props.docView?.()?.Document || this._props.Document;
+ const sourceAnchorCreator = () => this._props.docView?.()?.Document || this._props.Doc;
const targetCreator = (annotationOn: Doc | undefined) => {
const doc = this._props.docView?.()?.Document;
if (doc) {
const embedding = Doc.MakeEmbedding(doc);
embedding._dataViz = DataVizView.TABLE;
embedding._dataViz_axes = new List<string>([col]);
- embedding._dataViz_parentViz = this._props.Document;
+ embedding._dataViz_parentViz = this._props.Doc;
embedding.annotationOn = annotationOn;
embedding.histogramBarColors = Field.Copy(this._props.layoutDoc.histogramBarColors);
embedding.defaultHistogramColor = this._props.layoutDoc.defaultHistogramColor;
embedding.pieSliceColors = Field.Copy(this._props.layoutDoc.pieSliceColors);
return embedding;
}
- return this._props.Document;
+ return this._props.Doc;
};
if (this._props.docView?.() && !ClientUtils.isClick(moveEv.clientX, moveEv.clientY, downX, downY, Date.now())) {
DragManager.StartAnchorAnnoDrag(moveEv.target instanceof HTMLElement ? [moveEv.target] : [], new DragManager.AnchorAnnoDragData(this._props.docView()!, sourceAnchorCreator, targetCreator), downX, downY, {
dragComplete: completeEv => {
if (!completeEv.aborted && completeEv.annoDragData && completeEv.annoDragData.linkSourceDoc && completeEv.annoDragData.dropDocument && completeEv.linkDocument) {
- completeEv.linkDocument[DocData].link_matchEmbeddings = true;
- completeEv.linkDocument[DocData].stroke_startMarker = true;
+ completeEv.linkDocument.$link_matchEmbeddings = true;
+ completeEv.linkDocument.$stroke_startMarker = true;
this._props.docView?.()?._props.addDocument?.(completeEv.linkDocument);
}
},