UNPKG

3.83 kBTypeScriptView Raw
1import { Component, TextStyleProps, RectStyleProps, LineStyleProps } from '@antv/f-engine';
2import { ChartChildProps } from '../../chart';
3export interface DataRecord {
4 origin: any;
5 [k: string]: any;
6}
7export interface TooltipProps {
8 /**
9 * 是否显示
10 */
11 visible?: boolean;
12 /**
13 * 顶部边距
14 */
15 padding?: string;
16 /**
17 * 显示事件名,默认为 press
18 */
19 triggerOn?: 'press' | 'click';
20 /**
21 * 消失的事件名,默认为 pressend
22 */
23 triggerOff?: 'pressend';
24 /**
25 * 是否一直显示
26 */
27 alwaysShow?: boolean;
28 /**
29 * 是否显示十字线
30 */
31 showCrosshairs?: boolean;
32 /**
33 * 十字线类型
34 */
35 crosshairsType?: 'x' | 'y' | 'xy';
36 /**
37 * 十字线样式
38 */
39 crosshairsStyle?: LineStyleProps;
40 /**
41 * 是否显示辅助点
42 */
43 snap?: boolean;
44 /**
45 * 名称样式
46 */
47 nameStyle?: TextStyleProps;
48 /**
49 * 值样式
50 */
51 valueStyle?: TextStyleProps;
52 /**
53 * 背景样式
54 */
55 background?: RectStyleProps;
56 /**
57 * 是否显示
58 */
59 showItemMarker?: boolean;
60 defaultItem?: any;
61 custom?: boolean;
62 tooltipMarkerStyle?: any;
63 onChange?: any;
64 showXTip?: boolean;
65 /**
66 * x 的位置点类型,record 表示按照数据取位置点,coord 表示按照坐标取位置点
67 */
68 xPositionType?: 'record' | 'coord';
69 showYTip?: boolean;
70 /**
71 * x 的位置点类型,record 表示按照数据取位置点,coord 表示按照坐标取位置点
72 */
73 yPositionType?: 'record' | 'coord';
74 showTooltipMarker?: boolean;
75 customText?: any;
76 markerBackgroundStyle?: any;
77 [key: string]: any;
78}
79export interface TooltipState {
80 records: DataRecord[];
81}
82declare const _default: (View: any) => {
83 new <IProps extends TooltipProps = TooltipProps>(props: IProps & ChartChildProps<import("../../chart/Data").DataRecord>): {
84 updateCoord(): void;
85 willMount(): void;
86 didMount(): void;
87 _initEvent(): void;
88 willReceiveProps(nextProps: any): void;
89 _initShow(): void;
90 _showByData(dataItem: any): void;
91 _triggerOn: (ev: any) => void;
92 _triggerOff: () => void;
93 show(point: any, _ev?: any): void;
94 showSnapRecords(snapRecords: any): void;
95 hide(): void;
96 render(): import("@antv/f-engine").JSX.Element;
97 props: IProps & ChartChildProps<import("../../chart/Data").DataRecord>;
98 state: TooltipState;
99 context: import("@antv/f-engine").IContext;
100 refs: {
101 [key: string]: Component<import("@antv/f-engine").IProps, import("@antv/f-engine").IState>;
102 };
103 /**
104 * 是否一直显示
105 */
106 updater: import("@antv/f-engine/es/component/updater").Updater<TooltipState>;
107 container: import("@antv/g-lite").Group;
108 layout: import("@antv/f-engine").LayoutProps;
109 children: import("@antv/f-engine/es/canvas/vnode").VNode | import("@antv/f-engine/es/canvas/vnode").VNode[];
110 isMounted: boolean;
111 animate: boolean;
112 animator: import("@antv/f-engine/es/canvas/render/animator").default;
113 destroyed: boolean;
114 _vNode: import("@antv/f-engine/es/canvas/vnode").VNode; /**
115 * 是否显示辅助点
116 */
117 shouldUpdate(_nextProps: IProps & ChartChildProps<import("../../chart/Data").DataRecord>): boolean;
118 willUpdate(): void;
119 didUpdate(): void;
120 willUnmount(): void;
121 didUnmount(): void;
122 setState(partialState: TooltipState, callback?: () => void): void;
123 forceUpdate(callback?: () => void): void;
124 setAnimate(animate: boolean): void;
125 destroy(): void;
126 };
127};
128export default _default;