1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 | export declare interface Action {
|
12 | type: ActionType;
|
13 | field: string | null;
|
14 | as: string | null;
|
15 | options?: FillNullOptions;
|
16 | }
|
17 |
|
18 |
|
19 |
|
20 |
|
21 | export declare type ActionType = AggregationType | ConversionType | FillType;
|
22 |
|
23 |
|
24 |
|
25 |
|
26 | export declare type AggExtractorPair = {
|
27 | agg: AggregationType;
|
28 | measure: string;
|
29 | };
|
30 |
|
31 |
|
32 |
|
33 |
|
34 |
|
35 |
|
36 |
|
37 |
|
38 | export declare function aggregate(rows: RowData[], options: AggregateParams): RowData[];
|
39 |
|
40 |
|
41 |
|
42 |
|
43 | export declare interface AggregateParams {
|
44 | as: string[];
|
45 | fields?: string[];
|
46 | groupBy?: string | string[];
|
47 | op: Operations[];
|
48 | }
|
49 |
|
50 |
|
51 |
|
52 |
|
53 | export declare const AGGREGATION: ["sum", "max", "min", "average", "avg", "median", "count", "distinct", "countd"];
|
54 |
|
55 |
|
56 |
|
57 |
|
58 | export declare type AggregationType = typeof AGGREGATION[number];
|
59 |
|
60 |
|
61 |
|
62 |
|
63 | export declare type AllSubspaceDatasetOptions = {
|
64 | dimensions?: string[];
|
65 | measures?: string[];
|
66 | aggregations?: AggregationType[];
|
67 | extractors?: ExtractorType[];
|
68 | depth?: number;
|
69 | };
|
70 |
|
71 |
|
72 |
|
73 |
|
74 | export declare function autoSchema(data: RowData[], renameOption?: RenameOption, defaultAgg?: AggregationType): TransformSchema[];
|
75 |
|
76 |
|
77 |
|
78 |
|
79 | export declare function autoTransform(data: RowData[], renameOption?: RenameOption, defaultAgg?: AggregationType): AutoTransformResult;
|
80 |
|
81 |
|
82 |
|
83 |
|
84 | export declare interface AutoTransformResult {
|
85 | result: RowData[];
|
86 | schemas: TransformSchema[];
|
87 | }
|
88 |
|
89 |
|
90 |
|
91 |
|
92 | export declare type ColumnInfo = {
|
93 | name: string;
|
94 | data: any[];
|
95 | domain: any[];
|
96 | };
|
97 |
|
98 |
|
99 |
|
100 |
|
101 | export declare function compositeExtractor(siblingGroup: SiblingGroup, aggPair: AggExtractorPair, extractorPairs?: SubExtractorPair[], depth?: number): RowData[];
|
102 |
|
103 |
|
104 |
|
105 |
|
106 | export declare const CONVERSION: ["toString", "toFloat", "toInt"];
|
107 |
|
108 |
|
109 |
|
110 |
|
111 | export declare type ConversionType = typeof CONVERSION[number];
|
112 |
|
113 |
|
114 |
|
115 |
|
116 | export declare class Dataset {
|
117 | private _dataset;
|
118 | private _dimensions;
|
119 | private _measures;
|
120 | private _dimensionTitles;
|
121 | private _measureTitles;
|
122 | constructor(dataset: RowData[]);
|
123 | get dataset(): RowData[];
|
124 | set dataset(dataset: RowData[]);
|
125 | get dimensions(): ColumnInfo[];
|
126 | get measures(): ColumnInfo[];
|
127 | get dimensionTitles(): string[];
|
128 | get measureTitles(): string[];
|
129 | private _calculateDimensionsAndMeasures;
|
130 | subspace(defineArray?: string[]): Subspace;
|
131 | siblingGroup(subspace: Subspace, dimension: string): SiblingGroup;
|
132 | allSubspaceDataset(options?: AllSubspaceDatasetOptions): RowData[][];
|
133 | }
|
134 |
|
135 | /**
|
136 | * @public
|
137 | */
|
138 | export declare type Extractor = (siblingGroup: SiblingGroup) => Measure[];
|
139 |
|
140 | /**
|
141 | * @public
|
142 | */
|
143 | export declare const EXTRACTORS: ["rank", "percent"];
|
144 |
|
145 | /**
|
146 | * @public
|
147 | */
|
148 | export declare const extractors: Record<ExtractorType, Extractor>;
|
149 |
|
150 | /**
|
151 | * @public
|
152 | */
|
153 | export declare type ExtractorType = typeof EXTRACTORS[number];
|
154 |
|
155 | /**
|
156 | * @public
|
157 | */
|
158 | export declare const FILL: ["fillNull", "removeNull"];
|
159 |
|
160 | /**
|
161 | * @public
|
162 | */
|
163 | export declare type FillNullOptions = FillNullOptionsBySmart | FillNullOptionsByAgg | FillNullOptionsByValue;
|
164 |
|
165 | /**
|
166 | * @public
|
167 | */
|
168 | export declare interface FillNullOptionsByAgg {
|
169 | type: Extract<FillNullType, 'byAgg'>;
|
170 | cfg: {
|
171 | agg: AggregationType;
|
172 | };
|
173 | }
|
174 |
|
175 |
|
176 |
|
177 |
|
178 | export declare interface FillNullOptionsBySmart {
|
179 | type: Extract<FillNullType, 'bySmart'>;
|
180 | }
|
181 |
|
182 |
|
183 |
|
184 |
|
185 | export declare interface FillNullOptionsByValue {
|
186 | type: Extract<FillNullType, 'byValue'>;
|
187 | cfg: {
|
188 | value: string | number;
|
189 | };
|
190 | }
|
191 |
|
192 |
|
193 |
|
194 |
|
195 | export declare type FillNullType = 'bySmart' | 'byAgg' | 'byValue';
|
196 |
|
197 |
|
198 |
|
199 |
|
200 | export declare type FillType = typeof FILL[number];
|
201 |
|
202 |
|
203 |
|
204 |
|
205 | export declare type Measure = number[];
|
206 |
|
207 |
|
208 |
|
209 |
|
210 |
|
211 | export declare type Operations = 'sum' | 'average' | 'avg' | 'mean' | 'min' | 'max' | 'median' | 'variance' | 'stdevp' | 'stdev' | 'mode' | 'product' | 'count' | 'distinct' | 'countd' | 'valid';
|
212 |
|
213 |
|
214 |
|
215 |
|
216 | export declare function parse(data: RowData[], schemas: TransformSchema | TransformSchema[]): RowData[];
|
217 |
|
218 |
|
219 |
|
220 |
|
221 | export declare type RenameOption = boolean | 'origin' | 'brackets' | 'underline' | Function;
|
222 |
|
223 |
|
224 |
|
225 |
|
226 |
|
227 | export declare type RowData = Record<string, any>;
|
228 |
|
229 |
|
230 |
|
231 |
|
232 | export declare type SiblingGroup = {
|
233 | datasetInfo: {
|
234 | dimensionTitles: string[];
|
235 | measureTitles: string[];
|
236 | };
|
237 | define: {
|
238 | subspace: Subspace;
|
239 | dimension: string;
|
240 | };
|
241 | subspaceList: Subspace[];
|
242 | dataset: RowData[];
|
243 | };
|
244 |
|
245 |
|
246 |
|
247 |
|
248 | export declare type SubExtractorPair = {
|
249 | extractor: ExtractorType;
|
250 | dimension: string;
|
251 | };
|
252 |
|
253 |
|
254 |
|
255 |
|
256 | export declare type Subspace = {
|
257 | define: Record<string, string>;
|
258 | dataset: RowData[];
|
259 | };
|
260 |
|
261 |
|
262 |
|
263 |
|
264 | export declare interface TransformSchema {
|
265 | groupBy?: string[];
|
266 | actions: Action[];
|
267 | }
|
268 |
|
269 |
|
270 |
|
271 |
|
272 |
|
273 |
|
274 |
|
275 |
|
276 | export declare function unstack(data: RowData[], field: string, values: string[]): RowData[];
|
277 |
|
278 | export { }
|