1 | import { Component, GroupStyleProps, TextStyleProps } from '@antv/f-engine';
|
2 | import { ChartChildProps } from '../../chart';
|
3 | interface LegendItem {
|
4 | |
5 |
|
6 |
|
7 | color?: string;
|
8 | |
9 |
|
10 |
|
11 | name?: string;
|
12 | |
13 |
|
14 |
|
15 | value?: string | number;
|
16 | |
17 |
|
18 |
|
19 | marker?: string;
|
20 | [key: string]: any;
|
21 | }
|
22 | export interface LegendProps {
|
23 | |
24 |
|
25 |
|
26 | position?: 'right' | 'left' | 'top' | 'bottom';
|
27 | |
28 |
|
29 |
|
30 | width?: number | string;
|
31 | |
32 |
|
33 |
|
34 | height?: number | string;
|
35 | |
36 |
|
37 |
|
38 | margin?: number | string;
|
39 | |
40 |
|
41 |
|
42 | itemFormatter?: (value: any, name: any) => string;
|
43 | |
44 |
|
45 |
|
46 | items?: LegendItem[];
|
47 | |
48 |
|
49 |
|
50 | style?: GroupStyleProps;
|
51 | |
52 |
|
53 |
|
54 | marker?: 'circle' | 'square' | 'line';
|
55 | |
56 |
|
57 |
|
58 | itemStyle?: GroupStyleProps;
|
59 | |
60 |
|
61 |
|
62 | nameStyle?: Omit<TextStyleProps, 'text'>;
|
63 | |
64 |
|
65 |
|
66 | valueStyle?: Omit<TextStyleProps, 'text'>;
|
67 | |
68 |
|
69 |
|
70 | valuePrefix?: string;
|
71 | |
72 |
|
73 |
|
74 | clickable?: boolean;
|
75 | onClick?: (item: LegendItem) => void;
|
76 | }
|
77 | declare const _default: (View: any) => {
|
78 | new <IProps extends LegendProps = LegendProps>(props: any): {
|
79 | legendStyle: GroupStyleProps;
|
80 | itemWidth: Number;
|
81 | getOriginItems(): any;
|
82 | getItems(): any;
|
83 | setItems(items: any): void;
|
84 | getMaxItemBox(node: any): {
|
85 | width: number;
|
86 | height: number;
|
87 | };
|
88 | _init(): void;
|
89 | updateCoord(): void;
|
90 | willMount(): void;
|
91 | didMount(): void;
|
92 | willUpdate(): void;
|
93 | _onclick: (item: any) => void;
|
94 | render(): import("@antv/f-engine").JSX.Element;
|
95 | props: IProps & ChartChildProps<import("../../chart/Data").DataRecord>;
|
96 | state: import("@antv/f-engine").IState;
|
97 | context: import("@antv/f-engine").IContext;
|
98 | refs: {
|
99 | [key: string]: Component<import("@antv/f-engine").IProps, import("@antv/f-engine").IState>;
|
100 | };
|
101 | updater: import("@antv/f-engine/es/component/updater").Updater<import("@antv/f-engine").IState>;
|
102 | container: import("@antv/g-lite").Group;
|
103 | layout: import("@antv/f-engine").LayoutProps;
|
104 | children: import("@antv/f-engine/es/canvas/vnode").VNode | import("@antv/f-engine/es/canvas/vnode").VNode[];
|
105 | isMounted: boolean;
|
106 | animate: boolean;
|
107 | animator: import("@antv/f-engine/es/canvas/render/animator").default;
|
108 | destroyed: boolean;
|
109 | _vNode: import("@antv/f-engine/es/canvas/vnode").VNode;
|
110 | shouldUpdate(_nextProps: IProps & ChartChildProps<import("../../chart/Data").DataRecord>): boolean;
|
111 | willReceiveProps(_props: IProps & ChartChildProps<import("../../chart/Data").DataRecord>, _context?: import("@antv/f-engine").IContext): void;
|
112 | didUpdate(): void;
|
113 | willUnmount(): void;
|
114 | didUnmount(): void;
|
115 | setState(partialState: import("@antv/f-engine").IState, callback?: () => void): void;
|
116 | forceUpdate(callback?: () => void): void;
|
117 | setAnimate(animate: boolean): void;
|
118 | destroy(): void;
|
119 | };
|
120 | };
|
121 | export default _default;
|