UNPKG

@antv/s2

Version:

effective spreadsheet render core lib

20 lines 952 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getFrozenRowsForGrid = exports.getRowsForGrid = exports.getColsForGrid = void 0; const getColsForGrid = (colMin, colMax, colNodes) => colNodes.slice(colMin, colMax + 1).map((item) => item.x + item.width); exports.getColsForGrid = getColsForGrid; const getRowsForGrid = (rowMin, rowMax, viewCellHeights) => { const rows = []; for (let index = rowMin; index < rowMax + 1; index++) { rows.push(viewCellHeights.getCellOffsetY(index + 1)); } return rows; }; exports.getRowsForGrid = getRowsForGrid; const getFrozenRowsForGrid = (rowMin, rowMax, startY, viewCellHeights) => { const rows = (0, exports.getRowsForGrid)(rowMin, rowMax, viewCellHeights); const baseY = viewCellHeights.getCellOffsetY(rowMin); return rows.map((r) => r - baseY + startY); }; exports.getFrozenRowsForGrid = getFrozenRowsForGrid; //# sourceMappingURL=grid.js.map