@univerjs-pro/engine-pivot
Version:
[](https://npmjs.org/packages/@univerjs-pro/engine-pivot) [](https://img.shields.io/npm/l/@univerjs-pro/engine-pivot)
59 lines (58 loc) • 3.72 kB
TypeScript
import { PivotTable } from '../pivot/pivot-table';
import { NodeTree } from '../summary/node-tree';
import { SummaryManager } from '../summary/summary-manager';
import { IColumnNodeSizeInfo, INodeSizeInfo, IPivotLayoutCtx, IPivotTableLabelFieldQueryData, IPivotTableQueryData, PivotErrorTypeEnum } from '../types';
import { PageViewItem } from './pivot-view';
export declare class BaseLayout {
/**
*
* @param pivotTable - the pivot table
* @param summaryManager - the summary manager
* @returns {IPivotLayoutCtx} the layout context
*/
static prepareLayoutCtx(pivotTable: PivotTable, summaryManager: SummaryManager, queryData: IPivotTableQueryData): IPivotLayoutCtx;
static layoutPage(ctx: IPivotLayoutCtx): void;
static layoutPageOverThenDown(filters: IPivotTableLabelFieldQueryData[], page: PageViewItem, pageWrap?: number): void;
static layoutPageDownThenOver(filters: IPivotTableLabelFieldQueryData[], page: PageViewItem, pageWrap?: number): void;
static layoutCol(ctx: IPivotLayoutCtx): void;
static layoutCorner(ctx: IPivotLayoutCtx): void;
static layoutColHeader(ctx: IPivotLayoutCtx): void;
static setValueSize(ctx: IPivotLayoutCtx): void;
static layoutNoneColFields(ctx: IPivotLayoutCtx, nodeTree: NodeTree): IColumnNodeSizeInfo;
static layoutColFields(ctx: IPivotLayoutCtx): void;
/**
* - the node is leaf node when the level of the node is equal to the deep, but the node is not the real leaf node
* @param {NodeTree} nodeTree - the node tree
* @param {number} deep - the deep of the tree
* @returns {boolean} - the node is leaf node or not
*/
static isLeafNode(nodeTree: NodeTree, deep: number): boolean;
static getRealSize(sizeInfo: INodeSizeInfo): number;
/**
* - get the node value from the summary manager, the node index is the tuples of summary manager
* @param {IPivotLayoutCtx} ctx
* @param {NodeTree} nodeTree
* @param {number} measureIndex
* @returns {number} - the value of the node
*/
static getNodeValue(ctx: IPivotLayoutCtx, nodeTree: NodeTree, measureIndex: number): number | {
errorType: PivotErrorTypeEnum;
} | undefined;
static doColLeafNode(ctx: IPivotLayoutCtx, nodeTree: NodeTree, col: number, valueIds: string[]): IColumnNodeSizeInfo;
static buildColPathMap(ctx: IPivotLayoutCtx, nodeTree: NodeTree): Record<string, number>;
static iterateColLeafNodeChildren(ctx: IPivotLayoutCtx, nodeTree: NodeTree, paths: string[], map: Record<string, number>): void;
/**
* - build the path map for the collapse node
* @param ctx - the layout context
* @param nodeTree - the node tree
* @param colPathMapList - the path map list
*/
static buildColPathMapForCollapse(ctx: IPivotLayoutCtx, nodeTree: NodeTree, colPathMapList: Record<string, number>[]): void;
static doColBranchNode(ctx: IPivotLayoutCtx, nodeTree: NodeTree, col: number, valueIds: string[]): IColumnNodeSizeInfo;
static shouldMultipleTotal(hasMultiValue: boolean, nodeLevel: number, valueIndex: number): boolean;
static shouldMultipleNode(hasMultiValue: boolean, nodeLevel: number, valueIndex: number): boolean;
static getRowIndexForColHeader(nodeLevel: number, valueIndex: number, hasMultiValue: boolean): number;
static layoutColNode(ctx: IPivotLayoutCtx, nodeTree: NodeTree, col: number, valueIds: string[]): IColumnNodeSizeInfo;
static getMeasureIndex(isColMultiMeasure: boolean, valueIds: string[], measureIndexesMap: Record<string, number>): number;
static updateColumnSubtotal(ctx: IPivotLayoutCtx, col: number, nodeTree: NodeTree, valueIds: string[], colPathMap: Record<string, number>): void;
}