UNPKG

pivot-chart

Version:

pivot table react component

55 lines (54 loc) 2.74 kB
import { NestTree, DataSource, Record, Measure, Filter } from './common'; import { momentCube } from 'cube-core/built/core'; import { VisType, Field } from './common'; export declare function useNestTree(): { nestTree: NestTree; setNestTree: import("react").Dispatch<import("react").SetStateAction<NestTree>>; repaint: (path: number[]) => void; }; export declare function sortPureNestTree(tree: NestTree, dimensions: Field[], depth?: number): void; export declare function getPureNestTree(dataSource: DataSource, dimensions: string[]): NestTree; export declare function transTree2LeafPathList(tree: NestTree, hasAggChild: boolean): string[][]; interface QueryNode { dimCode: string; dimValue: string; } export declare type QueryPath = QueryNode[]; /** * * @param cube * @param path * @param cubeDimensions * @param measures */ export declare function queryCube(cube: momentCube, path: QueryPath, cubeDimensions: string[]): DataSource; export declare function getCossMatrix(visType: VisType, cube: momentCube, rowLPList: string[][], columnLPList: string[][], rows: string[], columns: string[], measures: Measure[], dimensionsInView: string[]): Record[][] | Record[][][]; interface NestFields { nestRows: Field[]; nestColumns: Field[]; dimensionsInView: Field[]; facetMeasures: Measure[]; viewMeasures: Measure[]; } export declare function getNestFields(visType: VisType, rows: Field[], columns: Field[], measures: Measure[]): NestFields; export declare function useNestFields(visType: VisType, rows: Field[], columns: Field[], measures: Measure[]): NestFields; export declare function aggregateOnGroupBy(dataSource: DataSource, fields: string[], measures: Measure[]): DataSource; export declare type cmpFunc = (a: string, b: string) => number; export declare class AsyncCacheCube { private dynamicCube; private dimensions; private asyncCubeQuery; private dimCompare; constructor(props: { dimensions?: string[]; cmp?: cmpFunc; asyncCubeQuery: (path: QueryPath, measures: string[]) => Promise<DataSource>; }); cacheQuery(originPath: QueryPath, measures: string[]): Promise<DataSource>; getCuboidNestTree(originPath: Field[], branchFilters?: Filter[]): Promise<NestTree>; requestCossMatrix(visType: VisType, rowLPList: string[][], columnLPList: string[][], rows: Field[], columns: Field[], measures: Measure[], dimensionsInView: Field[]): Promise<Record[][] | Record[][][]>; } export declare function arrayEqual(arr1: any[], arr2: any[]): boolean; export declare function labelHighlightNode(tree: NestTree, valuePath: any[], hlPath: any[], depth: number): void; export declare function clearHighlight(tree: NestTree): void; export {};