1 | import { GroupStyleProps, IContext, LayoutProps, Component, Ref } from '@antv/f-engine';
|
2 | import { ScaleConfig } from '../deps/f2-scale/src';
|
3 | import CoordController, { Coord } from '../controller/coord';
|
4 | import ScaleController from '../controller/scale';
|
5 | import { Data, DataRecord, DataRecordScale } from './Data';
|
6 | import { CoordType, CoordProps } from './Coord';
|
7 | export { Point } from './types';
|
8 | export interface ChartProps<TRecord extends DataRecord = DataRecord> {
|
9 | data: Data<TRecord>;
|
10 | scale?: DataRecordScale<TRecord>;
|
11 | coord?: CoordType | CoordProps;
|
12 | style?: GroupStyleProps;
|
13 | theme?: Record<string, any>;
|
14 | children?: any;
|
15 | }
|
16 | export interface ChartState {
|
17 | filters: any;
|
18 | }
|
19 | export interface ChartChildProps<TRecord extends DataRecord = DataRecord> {
|
20 | data?: Data<TRecord>;
|
21 | chart?: Chart<TRecord>;
|
22 | coord?: Coord;
|
23 | layout?: LayoutProps;
|
24 | }
|
25 | export interface PositionLayout {
|
26 | position: 'top' | 'right' | 'bottom' | 'left';
|
27 | width: number;
|
28 | height: number;
|
29 | }
|
30 | export interface ComponentPosition {
|
31 | component: Component;
|
32 | layout: PositionLayout | PositionLayout[];
|
33 | }
|
34 | declare class Chart<TRecord extends DataRecord = DataRecord, IProps extends ChartProps<TRecord> = ChartProps<TRecord>> extends Component<IProps, ChartState> {
|
35 | private componentsPosition;
|
36 | coord: CoordController;
|
37 | scale: ScaleController;
|
38 | coordRef: Ref;
|
39 | constructor(props: IProps, context?: IContext);
|
40 | private getStyle;
|
41 | willMount(): void;
|
42 | willReceiveProps(nextProps: IProps, context: any): void;
|
43 | willUpdate(): void;
|
44 | on(eventName: string, listener: (...args: any[]) => void): void;
|
45 | off(eventName: string, listener: (...args: any[]) => void): void;
|
46 | layoutCoord(layout: PositionLayout): void;
|
47 | resetCoordLayout(): void;
|
48 | updateCoordLayout(layout: PositionLayout | PositionLayout[]): void;
|
49 | updateCoordFor(component: Component, layout: PositionLayout | PositionLayout[]): void;
|
50 | removeComponentsPositionCache(): void;
|
51 | getGeometrys(): Component<import("@antv/f-engine").IProps, import("@antv/f-engine").IState>[];
|
52 | /**
|
53 | * calculate dataset's position on canvas
|
54 | * @param {Object} record the dataset
|
55 | * @return {Object} return the position
|
56 | */
|
57 | getPosition(record: any): {
|
58 | x: any;
|
59 | y: any;
|
60 | };
|
61 | getSnapRecords(point: any, inCoordRange?: any): any;
|
62 | getRecords(data: any, field: any): any;
|
63 | getLegendItems(point?: any): any;
|
64 | setScale(field: string, option: ScaleConfig): void;
|
65 | getScale(field: string): import("../deps/f2-scale/src").Scale;
|
66 | getScales(): {
|
67 | [field: string]: import("../deps/f2-scale/src").Scale;
|
68 | };
|
69 | getXScales(): any[];
|
70 | getYScales(): any[];
|
71 | getLayout(): import("../controller/coord").Layout;
|
72 | getCoord(): Coord;
|
73 | filter(field: string, condition: any): void;
|
74 | _getRenderData(): Data<TRecord>;
|
75 | render(): import("@antv/f-engine").JSX.Element;
|
76 | }
|
77 | export default Chart;
|