1 | import EventEmitter from 'wolfy87-eventemitter';
|
2 | import { DataSet } from './data-set';
|
3 | import { StatisticsApi } from './api/statistics';
|
4 | import { PartitionApi } from './api/partition';
|
5 | import { HierarchyApi } from './api/hierarchy';
|
6 | import { GeoApi } from './api/geo';
|
7 | import { TransformsParams } from './transform-params';
|
8 | import { ConnectorParams } from './connector-params';
|
9 | export interface ViewOptions {
|
10 | watchingStates?: string[];
|
11 | }
|
12 | declare type TransformOptions<T extends keyof TransformsParams = any> = {
|
13 | type: T;
|
14 | } & TransformsParams[T];
|
15 | declare type ConnectorOptions<T extends keyof ConnectorParams = any> = {
|
16 | type: T;
|
17 | } & ConnectorParams[T][1];
|
18 | interface CustomSource {
|
19 | source: any;
|
20 | options: any;
|
21 | }
|
22 |
|
23 |
|
24 |
|
25 |
|
26 | export declare class View extends EventEmitter {
|
27 | static DataSet: typeof DataSet;
|
28 | |
29 |
|
30 |
|
31 | dataSet: DataSet | null;
|
32 | |
33 |
|
34 |
|
35 | loose: boolean;
|
36 | |
37 |
|
38 |
|
39 | isView: boolean;
|
40 | |
41 |
|
42 |
|
43 | isDataView: boolean;
|
44 | |
45 |
|
46 |
|
47 | private watchingStates;
|
48 | |
49 |
|
50 |
|
51 | dataType: string;
|
52 | |
53 |
|
54 |
|
55 | transforms: TransformOptions[];
|
56 | |
57 |
|
58 |
|
59 | origin: any[];
|
60 | |
61 |
|
62 |
|
63 | rows: any[];
|
64 | _source: CustomSource;
|
65 | _tagCloud: any;
|
66 | graph: {
|
67 | nodes: any[];
|
68 | edges: any[];
|
69 | };
|
70 | nodes: any[];
|
71 | edges: any[];
|
72 | _projectedAs: string[];
|
73 | _gridRows: any;
|
74 | _HexJSON: any;
|
75 | _GridHexJSON: any;
|
76 | constructor(options?: ViewOptions);
|
77 | constructor(dataSet?: DataSet, options?: ViewOptions);
|
78 | private _parseStateExpression;
|
79 | private _preparseOptions;
|
80 | private _prepareSource;
|
81 | /**
|
82 | * 载入数据
|
83 | *
|
84 | * @remarks
|
85 | * data 是原始数据,可能是字符串,也可能是数组、对象,或者另一个数据视图实例。options 里指定了载入数据使用的 connector 和载入时使用的配置项。
|
86 | *
|
87 | * @param source - 数据
|
88 | * @param options- 数据解析配置
|
89 | */
|
90 | source(source: string): View;
|
91 | source(source: any[]): View;
|
92 | source(source: View): View;
|
93 | source<T extends keyof ConnectorParams>(source: ConnectorParams[T][0], options: ConnectorOptions<T>): View;
|
94 | /**
|
95 | * 执行数据处理数据。执行完这个函数后,transform 会被存储
|
96 | * @param options - 某种类型的transform
|
97 | */
|
98 | transform<T extends keyof TransformsParams>(options?: TransformOptions<T>): View;
|
99 | private _executeTransform;
|
100 | private _reExecuteTransforms;
|
101 | addRow(row: any): void;
|
102 | removeRow(index: number): void;
|
103 | updateRow(index: number, newRow: any): void;
|
104 | findRows(query: any): any[];
|
105 | findRow(query: any): any;
|
106 | getColumnNames(): string[];
|
107 | getColumnName(index: number): string;
|
108 | getColumnIndex(columnName: string): number;
|
109 | getColumn(columnName: string): any[];
|
110 | getColumnData(columnName: string): any[];
|
111 | getSubset(startRowIndex: number, endRowIndex: number, columnNames: string[]): any[];
|
112 | toString(prettyPrint?: boolean): string;
|
113 | private _reExecute;
|
114 | }
|
115 | export interface View extends StatisticsApi, PartitionApi, HierarchyApi, GeoApi {
|
116 | }
|
117 | export {};
|