Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

401 feature pivot grid expand collapse #3328

Merged
merged 40 commits into from
Feb 8, 2025
Merged
Changes from 1 commit
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
8323cc2
feat: rowHierarchyType support grid-tree #401
fangsmile Jan 15, 2025
6a63244
refactor: tree grid
fangsmile Jan 16, 2025
dc80a34
feat: grid-tree mode
fangsmile Jan 17, 2025
96962fa
feat: grid-tree mode
fangsmile Jan 17, 2025
bed8171
feat: add columnHierarchyType
fangsmile Jan 17, 2025
f8fb589
feat: add columnHierarchyType
fangsmile Jan 17, 2025
9c753a7
feat: add columnHierarchyType
fangsmile Jan 17, 2025
e40f29a
feat: add columnhirerachytype
fangsmile Jan 21, 2025
081926f
feat: add columnhirerachytype
fangsmile Jan 21, 2025
bb9d3ba
feat: add columnhirerachytype
fangsmile Jan 21, 2025
4d51d1c
feat: support columnHierarchyType
fangsmile Jan 22, 2025
cb1ce10
feat: support columnHierarchyType
fangsmile Jan 22, 2025
8c44d3b
feat: support columnHierarchyType
fangsmile Jan 22, 2025
c4c3e72
feat: add columnhirerachytype
fangsmile Jan 23, 2025
2ab3c67
Merge remote-tracking branch 'origin/develop' into 401-feature-pivot-…
fangsmile Jan 23, 2025
2cef8bb
fix: column grid tree mode expand render
fangsmile Jan 23, 2025
8941ebc
fix: support column header grid-tree mode
fangsmile Jan 23, 2025
4230818
feat: hierarchyType support grid-tree
fangsmile Jan 24, 2025
2754760
feat: hierarchyType support grid-tree
fangsmile Jan 24, 2025
65845f1
fix: scroll render
fangsmile Jan 26, 2025
a36e844
Merge remote-tracking branch 'origin/develop' into 401-feature-pivot-…
fangsmile Jan 26, 2025
6939491
fix: rowSubTotalLabel in last key getValue work
fangsmile Jan 26, 2025
40bcf6a
fix: not records columnHeader render error
fangsmile Jan 27, 2025
ccae39f
fix: tree indicator expand state error
fangsmile Jan 27, 2025
9686156
fix: no records occor error
fangsmile Jan 27, 2025
e59f2b6
fix: right frozen col handle with
fangsmile Jan 27, 2025
252fa46
fix: case pivot-analysis-grid-tree-cornerOnColumn
fangsmile Jan 30, 2025
0c867d8
fix: test custom header tree
fangsmile Jan 31, 2025
5a58043
docs: add tutorial and demo
fangsmile Feb 5, 2025
62ef685
docs: add tutorial and demo
fangsmile Feb 5, 2025
f218088
docs: update event
fangsmile Feb 5, 2025
9085e75
Merge remote-tracking branch 'origin/develop' into 401-feature-pivot-…
fangsmile Feb 5, 2025
8995292
docs: update changlog of rush
fangsmile Feb 5, 2025
897c32a
chore: update changelog
fangsmile Feb 5, 2025
7632cdd
chore: update changelog
fangsmile Feb 5, 2025
493cd66
fix: expand row node merge info error
fangsmile Feb 7, 2025
b9194fb
fix: when indicator title on dimension set all update corner cell
fangsmile Feb 8, 2025
250c77a
fix: when no data corner show title error
fangsmile Feb 8, 2025
d1a6a8a
fix: when no data corner show title error
fangsmile Feb 8, 2025
fb2d46b
Merge remote-tracking branch 'origin/develop' into 401-feature-pivot-…
fangsmile Feb 8, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
feat: support columnHierarchyType
fangsmile committed Jan 22, 2025
commit 4d51d1cb7fd4db52bf875dc706dccd7d1e64c268
1 change: 1 addition & 0 deletions packages/vtable/examples/pivot/pivot-grid-tree-column.ts
Original file line number Diff line number Diff line change
@@ -352,6 +352,7 @@ export function createTable() {
columnHierarchyType: 'grid-tree',
rowExpandLevel: 1,
columnExpandLevel: 1,
// rightFrozenColCount: 2,
rowHierarchyIndent: 20,
theme: VTable.themes.ARCO,
// indicatorsAsCol: false,
1 change: 1 addition & 0 deletions packages/vtable/examples/pivot/pivot-grid-tree.ts
Original file line number Diff line number Diff line change
@@ -366,6 +366,7 @@ export function createTable() {
indicatorsAsCol: false,
// hideIndicatorName:true,
dragHeaderMode: 'all'
// bottomFrozenRowCount: 2
};
const tableInstance = new PivotTable(option);
// 只为了方便控制太调试用,不要拷贝
45 changes: 17 additions & 28 deletions packages/vtable/src/PivotTable.ts
Original file line number Diff line number Diff line change
@@ -51,6 +51,7 @@ import {
} from './layout/layout-helper';
import type { IEmptyTipComponent } from './components/empty-tip/empty-tip';
import { Factory } from './core/factory';
import { callUpdateColOnScenegraph, callUpdateRowOnScenegraph } from './tools/diff-cell';

export class PivotTable extends BaseTable implements PivotTableAPI {
layoutNodeId: { seqId: number } = { seqId: 0 };
@@ -585,6 +586,7 @@ export class PivotTable extends BaseTable implements PivotTableAPI {
table.rightFrozenColCount = this.options.rightFrozenColCount ?? 0;
}
this.stateManager.setFrozenCol(this.internalProps.frozenColCount);
this.stateManager.setFrozenRow(this.frozenRowCount);
}
protected _getSortFuncFromHeaderOption(
columns: undefined,
@@ -599,6 +601,12 @@ export class PivotTable extends BaseTable implements PivotTableAPI {
get rowHierarchyType(): 'grid' | 'tree' | 'grid-tree' {
return (this.internalProps.layoutMap as PivotHeaderLayoutMap).rowHierarchyType;
}
/**
* Get columnHierarchyType of pivotTable
*/
get columnHierarchyType(): 'grid' | 'grid-tree' {
return (this.internalProps.layoutMap as PivotHeaderLayoutMap).columnHierarchyType;
}
/**
* 将现有tree中的的hierarchyState同步到rows透视树中
* @param sourceNode
@@ -1528,38 +1536,19 @@ export class PivotTable extends BaseTable implements PivotTableAPI {
// } else {
// this.scenegraph.updateCol(result.removeCellPositions, result.addCellPositions, result.updateCellPositions);
// }

if (
result.addCellPositionsColumnDirection?.length ||
result.removeCellPositionsColumnDirection?.length ||
result.updateCellPositionsColumnDirection?.length
this.columnHierarchyType === 'grid-tree' &&
this.isColumnHeader(col, row) &&
oldFrozenRowCount > this.frozenRowCount //p判断这个
) {
this.scenegraph.updateCol(
result.removeCellPositionsColumnDirection,
result.addCellPositionsColumnDirection.map(item => {
item.col += newFrozenColCount - oldFrozenColCount;
return item;
}),
result.updateCellPositionsColumnDirection
);
callUpdateRowOnScenegraph(result, recalculateColWidths, newFrozenRowCount, oldFrozenRowCount, this.scenegraph);
callUpdateColOnScenegraph(result, newFrozenColCount, oldFrozenColCount, this.scenegraph);
} else {
callUpdateColOnScenegraph(result, newFrozenColCount, oldFrozenColCount, this.scenegraph);
callUpdateRowOnScenegraph(result, recalculateColWidths, newFrozenRowCount, oldFrozenRowCount, this.scenegraph);
}

if (
result.addCellPositionsRowDirection?.length ||
result.removeCellPositionsRowDirection?.length ||
result.updateCellPositionsRowDirection?.length
) {
this.scenegraph.updateRow(
result.removeCellPositionsRowDirection,
result.addCellPositionsRowDirection.map(item => {
item.row += newFrozenRowCount - oldFrozenRowCount;
return item;
}),
result.updateCellPositionsRowDirection,
recalculateColWidths
);
}
if (this.rowHierarchyType === 'grid-tree') {
if (this.rowHierarchyType === 'grid-tree' || this.columnHierarchyType === 'grid-tree') {
this.scenegraph.updateCornerHeaderCells();
if (newFrozenColCount !== oldFrozenColCount) {
this.scenegraph.updateRowHeaderCells();
2 changes: 1 addition & 1 deletion packages/vtable/src/core/BaseTable.ts
Original file line number Diff line number Diff line change
@@ -674,7 +674,7 @@ export abstract class BaseTable extends EventTarget implements BaseTableAPI {
*/
set frozenRowCount(frozenRowCount: number) {
this.internalProps.frozenRowCount = frozenRowCount;
// this.options.frozenRowCount = frozenRowCount;
this.stateManager.setFrozenRow(this.internalProps.frozenRowCount);
}

get rightFrozenColCount(): number {
29 changes: 17 additions & 12 deletions packages/vtable/src/layout/pivot-header-layout.ts
Original file line number Diff line number Diff line change
@@ -4147,7 +4147,11 @@ export class PivotHeaderLayoutMap implements LayoutMapAPI {
}
}
//#region 纠正角头 处理角头和行头或者列头长度不一致的情况(grid-tree模式下会有这种情况发生)
if (this.cornerSetting.titleOnDimension === 'column') {
if (
this.rowHierarchyType === 'grid-tree' &&
this.cornerSetting.titleOnDimension === 'column' &&
this.indicatorsAsCol === false
) {
if (this._cornerHeaderCellIds[0].length < this._rowHeaderCellIds[0].length) {
this._cornerHeaderCellIds.forEach((cellIds: number[], index: number) => {
const oldLength = cellIds.length;
@@ -4159,19 +4163,20 @@ export class PivotHeaderLayoutMap implements LayoutMapAPI {
cellIds.length = this._rowHeaderCellIds[0].length;
});
}
} else {
if (this._cornerHeaderCellIds[0]?.length < this._columnHeaderCellIds[0]?.length) {
this._cornerHeaderCellIds.forEach((cellIds: number[], index: number) => {
const oldLength = cellIds.length;
cellIds.length = this._columnHeaderCellIds[0].length;
cellIds.fill(cellIds[0], oldLength);
});
} else if (this._cornerHeaderCellIds[0]?.length > this._columnHeaderCellIds[0]?.length) {
this._cornerHeaderCellIds.forEach((cellIds: number[], index: number) => {
cellIds.length = this._columnHeaderCellIds[0].length;
});
} else if (
this.columnHierarchyType === 'grid-tree' &&
this.cornerSetting.titleOnDimension === 'row' &&
this.indicatorsAsCol === true
) {
if (this._cornerHeaderCellIds?.length < this._columnHeaderCellIds?.length) {
const oldLength = this._cornerHeaderCellIds.length;
this._cornerHeaderCellIds.length = this._columnHeaderCellIds.length;
this._cornerHeaderCellIds.fill(this._cornerHeaderCellIds[0], oldLength);
} else if (this._cornerHeaderCellIds?.length > this._columnHeaderCellIds?.length) {
this._cornerHeaderCellIds.length = this._columnHeaderCellIds.length;
}
}
//#endregion
}
enableUseGetBodyCache() {
this._useGetBodyCache = true;
Original file line number Diff line number Diff line change
@@ -31,7 +31,7 @@ export class SceneProxy {
rowStart = 0; // 当前维护的部分第一行的row number
rowEnd = 0; // 当前维护的部分最后一行的row number
referenceRow = 0; // 当前维护的部分中间一行的row number,认为referenceRow对应当前屏幕显示范围的第一行
bodyTopRow: number; // table body部分的第一行row number
// bodyTopRow: number; // table body部分的第一行row number
bodyBottomRow: number; // table body部分的最后一行row number
screenRowCount: number; // 预计屏幕范围内显示的row count
firstScreenRowLimit: number; // 首屏同步加载部分最后一行的row number
@@ -97,6 +97,9 @@ export class SceneProxy {
get bodyLeftCol(): number {
return this.table.frozenColCount;
}
get bodyTopRow(): number {
return this.table.frozenRowCount;
}

setParamsForColumn() {
// this.bodyLeftCol = this.table.frozenColCount;
@@ -131,7 +134,7 @@ export class SceneProxy {
}

setParamsForRow() {
this.bodyTopRow = this.table.frozenRowCount;
// this.bodyTopRow = this.table.frozenRowCount;
this.bodyBottomRow = this.table.rowCount - 1 - this.table.bottomFrozenRowCount;
// this.bodyLeftCol = 0;
// this.bodyRightCol = this.table.colCount - 1 - this.table.rightFrozenColCount;
@@ -166,7 +169,7 @@ export class SceneProxy {
}

refreshRowCount() {
this.bodyTopRow = this.table.frozenRowCount;
// this.bodyTopRow = this.table.frozenRowCount;
this.bodyBottomRow = this.table.rowCount - 1 - this.table.bottomFrozenRowCount;
const totalActualBodyRowCount = Math.min(this.rowLimit, this.bodyBottomRow - this.bodyTopRow + 1); // 渐进加载总row数量
this.totalActualBodyRowCount = totalActualBodyRowCount;
157 changes: 157 additions & 0 deletions packages/vtable/src/scenegraph/layout/frozen.ts
Original file line number Diff line number Diff line change
@@ -493,3 +493,160 @@ function insertBefore(container: Group, newNode: Group, targetGroup: Group) {
container.appendChild(newNode);
}
}

export function resetRowFrozen(scene: Scenegraph) {
if (scene.frozenRowCount > scene.table.frozenRowCount) {
// move columnGroup from rowHeaderGroup into bodyGroup(from cornerHeaderGroup into colHeaderGroup)
scene.bodyGroup.setAttribute('width', scene.colHeaderGroup.attribute.width);
scene.bodyGroup.setAttribute('x', scene.colHeaderGroup.attribute.x);
scene.rowHeaderGroup.setAttribute('width', scene.cornerHeaderGroup.attribute.width);
for (let i = 0; i < scene.frozenRowCount - scene.table.frozenRowCount; i++) {
moveRowFromColHeaderToBody(scene);
moveRowFromCornerHeaderToRowHeader(scene);
moveRowFromTopRightCornerToRight(scene);
}
} else if (scene.frozenRowCount < scene.table.frozenRowCount) {
// move columnGroup from bodyGroup into rowHeaderGroup(from colHeaderGroup into cornerHeaderGroup)
scene.colHeaderGroup.setAttribute('width', scene.bodyGroup.attribute.width);
scene.colHeaderGroup.setAttribute('x', scene.bodyGroup.attribute.x);
scene.cornerHeaderGroup.setAttribute('width', scene.rowHeaderGroup.attribute.width);
for (let i = 0; i < scene.table.frozenRowCount - scene.frozenRowCount; i++) {
moveRowFromBodyToColHeader(scene);
moveRowFromRowHeaderToCornerHeader(scene);
moveRowFromRightToTopRightCorner(scene);
}
}

updateReactComponentContainer(scene);
scene.recreateAllSelectRangeComponents();
// scene.frozenColCount = scene.rowHeaderGroup.childrenCount;
scene.frozenRowCount = scene.table.frozenRowCount;
scene.frozenColCount = scene.rowHeaderGroup?.childrenCount ?? 0;
// scene.proxy.colStart = scene.table.frozenColCount;
scene.proxy.rowStart = (scene.bodyGroup.firstChild.firstChild as any)?.row ?? scene.table.frozenRowCount;
scene.bodyGroup.setAttribute('y', scene.colHeaderGroup.attribute.height);
scene.rowHeaderGroup.setAttribute('y', scene.cornerHeaderGroup.attribute.height);
// scene.updateContainerAttrWidthAndX();
scene.updateContainer();
scene.updateBorderSizeAndPosition();

scene.hasFrozen = true;
}

function moveRowFromBodyToColHeader(scene: Scenegraph) {
let hasSetedHeight = false;
// deal with bodyGroup
for (let i = 0; i < scene.bodyGroup.childrenCount; i++) {
const colGroup = scene.bodyGroup.children[i] as Group;
const rowCell = colGroup.firstChild as Group;
scene.colHeaderGroup.children[i]?.appendChild(rowCell);
// update container width
if (!hasSetedHeight) {
scene.colHeaderGroup.setAttribute('height', scene.colHeaderGroup.attribute.height + rowCell.attribute.height);
scene.bodyGroup.setAttribute('height', scene.bodyGroup.attribute.height - rowCell.attribute.height);
hasSetedHeight = true;
}
}
}

function moveRowFromRowHeaderToCornerHeader(scene: Scenegraph) {
let hasSetedHeight = false;
// deal with rowHeaderGroup
for (let i = 0; i < scene.rowHeaderGroup.childrenCount; i++) {
const colGroup = scene.rowHeaderGroup.children[i] as Group;
const rowCell = colGroup.firstChild as Group;
scene.cornerHeaderGroup.children[i]?.appendChild(rowCell);
// update container width
if (!hasSetedHeight) {
scene.cornerHeaderGroup.setAttribute(
'height',
scene.cornerHeaderGroup.attribute.height + rowCell.attribute.height
);
scene.rowHeaderGroup.setAttribute('height', scene.rowHeaderGroup.attribute.height - rowCell.attribute.height);
hasSetedHeight = true;
}
}
}

function moveRowFromRightToTopRightCorner(scene: Scenegraph) {
let hasSetedHeight = false;
// deal with rowHeaderGroup
for (let i = 0; i < scene.rightFrozenGroup.childrenCount; i++) {
const colGroup = scene.rightFrozenGroup.children[i] as Group;
const rowCell = colGroup.firstChild as Group;
scene.rightTopCornerGroup.children[i]?.appendChild(rowCell);
// update container width
if (!hasSetedHeight) {
scene.rightTopCornerGroup.setAttribute(
'height',
scene.rightTopCornerGroup.attribute.height + rowCell.attribute.height
);
scene.rightFrozenGroup.setAttribute('height', scene.rightFrozenGroup.attribute.height - rowCell.attribute.height);
hasSetedHeight = true;
}
}
}

function moveRowFromColHeaderToBody(scene: Scenegraph) {
let hasSetedHeight = false;
// deal with bodyGroup
for (let i = 0; i < scene.colHeaderGroup.childrenCount; i++) {
const colGroup = scene.colHeaderGroup.children[i] as Group;
const rowCell = colGroup.lastChild as Group;
insertBefore(scene.bodyGroup.children[i] as Group, rowCell, scene.bodyGroup.children[i].firstChild as Group);
// update container width
if (!hasSetedHeight) {
scene.colHeaderGroup.setAttribute('height', scene.colHeaderGroup.attribute.height - rowCell.attribute.height);
scene.bodyGroup.setAttribute('height', scene.bodyGroup.attribute.height + rowCell.attribute.height);
hasSetedHeight = true;
}
}
}

function moveRowFromCornerHeaderToRowHeader(scene: Scenegraph) {
let hasSetedHeight = false;
// deal with rowHeaderGroup
for (let i = 0; i < scene.cornerHeaderGroup.childrenCount; i++) {
const colGroup = scene.cornerHeaderGroup.children[i] as Group;
const rowCell = colGroup.lastChild as Group;
// scene.rowHeaderGroup.children[i]?.appendChild(rowCell);
insertBefore(
scene.rowHeaderGroup.children[i] as Group,
rowCell,
scene.rowHeaderGroup.children[i].firstChild as Group
);
// update container width
if (!hasSetedHeight) {
scene.cornerHeaderGroup.setAttribute(
'height',
scene.cornerHeaderGroup.attribute.height - rowCell.attribute.height
);
scene.rowHeaderGroup.setAttribute('height', scene.rowHeaderGroup.attribute.height + rowCell.attribute.height);
hasSetedHeight = true;
}
}
}

function moveRowFromTopRightCornerToRight(scene: Scenegraph) {
let hasSetedHeight = false;
// deal with rowHeaderGroup
for (let i = 0; i < scene.rightTopCornerGroup.childrenCount; i++) {
const colGroup = scene.rightTopCornerGroup.children[i] as Group;
const rowCell = colGroup.lastChild as Group;
// scene.rightFrozenGroup.children[i]?.appendChild(rowCell);
insertBefore(
scene.rightFrozenGroup.children[i] as Group,
rowCell,
scene.rightFrozenGroup.children[i].firstChild as Group
);
// update container width
if (!hasSetedHeight) {
scene.rightTopCornerGroup.setAttribute(
'height',
scene.rightTopCornerGroup.attribute.height - rowCell.attribute.height
);
scene.rightFrozenGroup.setAttribute('height', scene.rightFrozenGroup.attribute.height + rowCell.attribute.height);
hasSetedHeight = true;
}
}
}
15 changes: 14 additions & 1 deletion packages/vtable/src/scenegraph/scenegraph.ts
Original file line number Diff line number Diff line change
@@ -41,7 +41,7 @@ import { updateRow } from './layout/update-row';
import { handleTextStick } from './stick-text';
import { computeRowHeight, computeRowsHeight } from './layout/compute-row-height';
import { emptyGroup } from './utils/empty-group';
import { dealBottomFrozen, dealFrozen, dealRightFrozen, resetFrozen } from './layout/frozen';
import { dealBottomFrozen, dealFrozen, dealRightFrozen, resetFrozen, resetRowFrozen } from './layout/frozen';
import {
updateChartSizeForResizeColWidth,
updateChartSizeForResizeRowHeight,
@@ -1515,6 +1515,10 @@ export class Scenegraph {
resetFrozen(this);
}

resetRowFrozen() {
resetRowFrozen(this);
}

/**
* @description: 判断指定列更新宽度时,其中单元格是否会更新宽度;如果更新宽度,返回true
* @param {Group} columnGroup
@@ -1836,6 +1840,15 @@ export class Scenegraph {
this.component.updateScrollBar();
}

updateRowFrozen() {
if (this.clear) {
return;
}
this.resetRowFrozen();
// this.dealFrozen();
this.component.updateScrollBar();
}

dealWidthRightFrozen(rightFrozenColCount: number) {
if (this.clear) {
this.table.internalProps.rightFrozenColCount = rightFrozenColCount;
12 changes: 11 additions & 1 deletion packages/vtable/src/state/state.ts
Original file line number Diff line number Diff line change
@@ -166,7 +166,7 @@ export class StateManager {
}>;
frozen: {
col: number;
// row: number;
row: number;
icon?: Icon;
};
scroll: {
@@ -909,6 +909,16 @@ export class StateManager {
this.table.scenegraph.updateFrozenIcon(0, this.table.colCount - 1);
}
}
setFrozenRow(row: number) {
if (row !== this.frozen.row) {
// const oldFrozenCol = this.frozen.col;
this.frozen.row = row;

// 更新scenegraph,这里因为dealFreeze更新了table里存储的frozen信息,会影响scenegraph里的getCell
// 因此先更新scenegraph结构再更新icon
this.table.scenegraph.updateRowFrozen();
}
}
checkVerticalScrollBarEnd() {
const totalHeight = this.table.getAllRowsHeight();
const scrollTop = this.scroll.verticalBarPos;
69 changes: 65 additions & 4 deletions packages/vtable/src/tools/diff-cell.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { PivotHeaderLayoutMap } from '../layout/pivot-header-layout';
import type { Scenegraph } from '../scenegraph/scenegraph';
import type { CellAddress } from '../ts-types';
import type { LayoutObjectId } from '../ts-types/base-table';

@@ -170,14 +171,14 @@ export function diffCellAddressForGridTreeOnColumn(
if (
layout.columnHierarchyType === 'grid-tree' &&
layout.cornerSetting.titleOnDimension === 'row' &&
layout.columnHeaderLevelCount !== layout._cornerHeaderCellIds[0].length // 表头层级数发生了变化 需要整体做更新_cornerHeaderCellIds是旧值 rowHeaderLevelCount是新值
layout.columnHeaderLevelCount !== layout._cornerHeaderCellIds.length // 表头层级数发生了变化 需要整体做更新_cornerHeaderCellIds是旧值 rowHeaderLevelCount是新值
) {
if (layout.columnHeaderLevelCount > layout._cornerHeaderCellIds[0].length) {
for (let i = layout._cornerHeaderCellIds[0].length; i < layout.columnHeaderLevelCount; i++) {
if (layout.columnHeaderLevelCount > layout._cornerHeaderCellIds.length) {
for (let i = layout._cornerHeaderCellIds.length; i < layout.columnHeaderLevelCount; i++) {
addCellPositionsRowDirection.push({ col, row: i });
}
} else {
for (let i = layout.columnHeaderLevelCount; i < layout._cornerHeaderCellIds[0].length; i++) {
for (let i = layout.columnHeaderLevelCount; i < layout._cornerHeaderCellIds.length; i++) {
// if (layout.hideIndicatorName && layout.indicatorsAsCol) {
// removeCellPositionsRowDirection.push({ col, row: i });
// updateCellPositionsRowDirection.push({ col, row: i - 1 });
@@ -309,3 +310,63 @@ function isEqual(arr1: any, arr2: any) {

return true;
}

export function callUpdateRowOnScenegraph(
result: {
addCellPositionsRowDirection?: CellAddress[];
removeCellPositionsRowDirection?: CellAddress[];
updateCellPositionsRowDirection?: CellAddress[];
addCellPositionsColumnDirection?: CellAddress[];
removeCellPositionsColumnDirection?: CellAddress[];
updateCellPositionsColumnDirection?: CellAddress[];
},
recalculateColWidths: boolean,
newFrozenRowCount: number,
oldFrozenRowCount: number,
scenegraph: Scenegraph
) {
if (
result.addCellPositionsRowDirection?.length ||
result.removeCellPositionsRowDirection?.length ||
result.updateCellPositionsRowDirection?.length
) {
scenegraph.updateRow(
result.removeCellPositionsRowDirection,
result.addCellPositionsRowDirection.map(item => {
item.row += newFrozenRowCount - oldFrozenRowCount;
return item;
}),
result.updateCellPositionsRowDirection,
recalculateColWidths
);
}
}

export function callUpdateColOnScenegraph(
result: {
addCellPositionsRowDirection?: CellAddress[];
removeCellPositionsRowDirection?: CellAddress[];
updateCellPositionsRowDirection?: CellAddress[];
addCellPositionsColumnDirection?: CellAddress[];
removeCellPositionsColumnDirection?: CellAddress[];
updateCellPositionsColumnDirection?: CellAddress[];
},
newFrozenColCount: number,
oldFrozenColCount: number,
scenegraph: Scenegraph
) {
if (
result.addCellPositionsColumnDirection?.length ||
result.removeCellPositionsColumnDirection?.length ||
result.updateCellPositionsColumnDirection?.length
) {
scenegraph.updateCol(
result.removeCellPositionsColumnDirection,
result.addCellPositionsColumnDirection.map(item => {
item.col += newFrozenColCount - oldFrozenColCount;
return item;
}),
result.updateCellPositionsColumnDirection
);
}
}