Skip to content

Commit

Permalink
fix: fix cellLocation in pivot-table #2694
Browse files Browse the repository at this point in the history
  • Loading branch information
Rui-Sun committed Nov 7, 2024
1 parent fb2c1b4 commit f3dde64
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@visactor/vtable",
"comment": "fix: fix cellLocation in pivot-table #2694",
"type": "none"
}
],
"packageName": "@visactor/vtable"
}
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export function createComplexColumn(
mergeMap: MergeMap,
defaultRowHeight: number | number[],
table: BaseTableAPI,
cellLocation: CellLocation,
// cellLocation: CellLocation,
rowLimit?: number
) {
let padding;
Expand All @@ -63,6 +63,7 @@ export function createComplexColumn(

for (let j = rowStart; j <= rowEnd; j++) {
const row = j;
let cellLocation = table.getCellLocation(col, row);
let value = table.getCellValue(col, row);

// 处理单元格合并
Expand Down
2 changes: 1 addition & 1 deletion packages/vtable/src/scenegraph/group-creater/column.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ export function createColGroup(
table.scenegraph.mergeMap,
cellLocation === 'columnHeader' && isNumber(defaultHeaderRowHeight) ? defaultHeaderRowHeight : defaultRowHeight,
table,
cellLocation,
// cellLocation,
rowLimit
);
x += default2Width;
Expand Down
12 changes: 6 additions & 6 deletions packages/vtable/src/scenegraph/group-creater/progress/proxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -314,8 +314,8 @@ export class SceneProxy {
endRow,
this.table.scenegraph.mergeMap,
this.table.internalProps.defaultRowHeight,
this.table,
cellLocation
this.table
// cellLocation
);
maxHeight = Math.max(maxHeight, height);
this.table.scenegraph.rowHeaderGroup.setAttribute('height', maxHeight);
Expand All @@ -336,8 +336,8 @@ export class SceneProxy {
endRow,
this.table.scenegraph.mergeMap,
this.table.internalProps.defaultRowHeight,
this.table,
cellLocation
this.table
// cellLocation
);
maxHeight = Math.max(maxHeight, height);
this.table.scenegraph.rightFrozenGroup.setAttribute('height', maxHeight);
Expand All @@ -360,8 +360,8 @@ export class SceneProxy {
endRow,
this.table.scenegraph.mergeMap,
this.table.internalProps.defaultRowHeight,
this.table,
cellLocation
this.table
// cellLocation
);
maxHeight = Math.max(maxHeight, height);
}
Expand Down

0 comments on commit f3dde64

Please sign in to comment.