@kanaries/graphic-walker 0.2.19 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/pivotTable/index.d.ts +1 -0
- package/dist/components/pivotTable/inteface.d.ts +13 -0
- package/dist/components/pivotTable/leftTree.d.ts +7 -0
- package/dist/components/pivotTable/store.d.ts +24 -0
- package/dist/components/pivotTable/topTree.d.ts +7 -0
- package/dist/components/pivotTable/utils.d.ts +4 -0
- package/dist/graphic-walker.es.js +1 -1
- package/dist/graphic-walker.es.js.map +1 -1
- package/dist/graphic-walker.umd.js +1 -1
- package/dist/graphic-walker.umd.js.map +1 -1
- package/dist/main.d.ts +1 -1
- package/package.json +3 -3
- package/src/components/pivotTable/index.tsx +40 -0
- package/src/components/pivotTable/inteface.ts +12 -0
- package/src/components/pivotTable/leftTree.tsx +11 -0
- package/src/components/pivotTable/store.tsx +65 -0
- package/src/components/pivotTable/topTree.tsx +11 -0
- package/src/components/pivotTable/utils.ts +37 -0
- package/src/main.tsx +24 -11
- package/src/models/visSpecHistory.ts +1 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { IAggregator } from "../../interfaces";
|
|
2
|
+
export interface INestNode {
|
|
3
|
+
key: string;
|
|
4
|
+
value: string;
|
|
5
|
+
children: INestNode[];
|
|
6
|
+
}
|
|
7
|
+
export interface IGroupByQuery {
|
|
8
|
+
groupBy: string[];
|
|
9
|
+
measures: {
|
|
10
|
+
field: string;
|
|
11
|
+
agg: IAggregator;
|
|
12
|
+
}[];
|
|
13
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { IGroupByQuery, INestNode } from './inteface';
|
|
2
|
+
import { IField, IRow } from '../../interfaces';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
declare class PivotTableStore {
|
|
5
|
+
leftTree: INestNode | null;
|
|
6
|
+
topTree: INestNode | null;
|
|
7
|
+
metricTable: any[][];
|
|
8
|
+
dataSource: IRow[];
|
|
9
|
+
metas: IField[];
|
|
10
|
+
viewData: IRow[];
|
|
11
|
+
constructor();
|
|
12
|
+
init(dataSource: IRow[], metas: IField[]): void;
|
|
13
|
+
createTree(query: IGroupByQuery, viewData: IRow[]): void;
|
|
14
|
+
createTopTree(query: IGroupByQuery, viewData: any): void;
|
|
15
|
+
createLeftTree(query: IGroupByQuery, viewData: any): void;
|
|
16
|
+
queryData(leftQuery: IGroupByQuery, topQuery: IGroupByQuery): Promise<void>;
|
|
17
|
+
}
|
|
18
|
+
export interface PivotTableDataProps {
|
|
19
|
+
data: IRow[];
|
|
20
|
+
metas: IField[];
|
|
21
|
+
}
|
|
22
|
+
export declare const PivotTableStoreWrapper: React.FC<PivotTableDataProps>;
|
|
23
|
+
export declare function usePivotTableStore(): PivotTableStore;
|
|
24
|
+
export {};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { IRow } from "../../interfaces";
|
|
2
|
+
import { INestNode } from "./inteface";
|
|
3
|
+
export declare function insertNode(tree: INestNode, layerKeys: string[], nodeData: IRow, depth: number): void;
|
|
4
|
+
export declare function buildNestTree(layerKeys: string[], data: IRow[]): INestNode;
|
|
@@ -11982,7 +11982,7 @@ class Vp {
|
|
|
11982
11982
|
}
|
|
11983
11983
|
clone() {
|
|
11984
11984
|
const t = new Vp(this.frame);
|
|
11985
|
-
return t.cursor = this.cursor, t;
|
|
11985
|
+
return t.snapshots = this.snapshots.slice().map((n) => ({ ...n })), t.cursor = this.cursor, t;
|
|
11986
11986
|
}
|
|
11987
11987
|
exportGW() {
|
|
11988
11988
|
return {
|