UNPKG

3.81 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}
78export interface TooltipState {
79 records: DataRecord[];
80}
81declare const _default: (View: any) => {
82 new <IProps extends TooltipProps = TooltipProps>(props: IProps & ChartChildProps<import("../../chart/Data").DataRecord>): {
83 updateCoord(): void;
84 willMount(): void;
85 didMount(): void;
86 _initEvent(): void;
87 willReceiveProps(nextProps: any): void;
88 _initShow(): void;
89 _showByData(dataItem: any): void;
90 _triggerOn: (ev: any) => void;
91 _triggerOff: () => void;
92 show(point: any, _ev?: any): void;
93 showSnapRecords(snapRecords: any): void;
94 hide(): void;
95 render(): import("@antv/f-engine").JSX.Element;
96 props: IProps & ChartChildProps<import("../../chart/Data").DataRecord>;
97 state: TooltipState;
98 context: import("@antv/f-engine").IContext;
99 refs: {
100 [key: string]: Component<import("@antv/f-engine").IProps, import("@antv/f-engine").IState>;
101 };
102 /**
103 * 是否一直显示
104 */
105 updater: import("@antv/f-engine/es/component/updater").Updater<TooltipState>;
106 container: import("@antv/g-lite").Group;
107 layout: import("@antv/f-engine").LayoutProps;
108 children: import("@antv/f-engine/es/canvas/vnode").VNode | import("@antv/f-engine/es/canvas/vnode").VNode[];
109 isMounted: boolean;
110 animate: boolean;
111 animator: import("@antv/f-engine/es/canvas/render/animator").default;
112 destroyed: boolean;
113 _vNode: import("@antv/f-engine/es/canvas/vnode").VNode; /**
114 * 是否显示辅助点
115 */
116 shouldUpdate(_nextProps: IProps & ChartChildProps<import("../../chart/Data").DataRecord>): boolean;
117 willUpdate(): void;
118 didUpdate(): void;
119 willUnmount(): void;
120 didUnmount(): void;
121 setState(partialState: TooltipState, callback?: () => void): void;
122 forceUpdate(callback?: () => void): void;
123 setAnimate(animate: boolean): void;
124 destroy(): void;
125 };
126};
127export default _default;