1 | import { AnnotationBaseOption as BaseOption, ArcOption, ComponentOption, ShapeAnnotationOption, DataMarkerOption, DataRegionOption, HtmlAnnotationOption, ImageOption, LineOption, RegionFilterOption, RegionOption, TextOption } from '../../interface';
|
2 | import View from '../view';
|
3 | import { Controller } from './base';
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 | export default class Annotation extends Controller<BaseOption[]> {
|
10 | private foregroundContainer;
|
11 | private backgroundContainer;
|
12 | private cache;
|
13 | constructor(view: View);
|
14 | get name(): string;
|
15 | init(): void;
|
16 | /**
|
17 | * 因为 annotation 需要依赖坐标系信息,所以 render 阶段为空方法,实际的创建逻辑都在 layout 中
|
18 | */
|
19 | layout(): void;
|
20 | render(): void;
|
21 | /**
|
22 | * 更新
|
23 | */
|
24 | update(): void;
|
25 | /**
|
26 | * 清空
|
27 | * @param includeOption 是否清空 option 配置项
|
28 | */
|
29 | clear(includeOption?: boolean): void;
|
30 | destroy(): void;
|
31 | /**
|
32 | * 复写基类的方法
|
33 | */
|
34 | getComponents(): ComponentOption[];
|
35 | /**
|
36 | * 清除当前的组件
|
37 | */
|
38 | private clearComponents;
|
39 | /**
|
40 | * region filter 比较特殊的渲染时机
|
41 | * @param doWhat
|
42 | */
|
43 | private onAfterRender;
|
44 | private createAnnotation;
|
45 | annotation(option: any): void;
|
46 | /**
|
47 | * 创建 Arc
|
48 | * @param option
|
49 | * @returns AnnotationController
|
50 | */
|
51 | arc(option: ArcOption): this;
|
52 | /**
|
53 | * 创建 image
|
54 | * @param option
|
55 | * @returns AnnotationController
|
56 | */
|
57 | image(option: ImageOption): this;
|
58 | /**
|
59 | * 创建 Line
|
60 | * @param option
|
61 | * @returns AnnotationController
|
62 | */
|
63 | line(option: LineOption): this;
|
64 | /**
|
65 | * 创建 Region
|
66 | * @param option
|
67 | * @returns AnnotationController
|
68 | */
|
69 | region(option: RegionOption): this;
|
70 | /**
|
71 | * 创建 Text
|
72 | * @param option
|
73 | * @returns AnnotationController
|
74 | */
|
75 | text(option: TextOption): this;
|
76 | /**
|
77 | * 创建 DataMarker
|
78 | * @param option
|
79 | * @returns AnnotationController
|
80 | */
|
81 | dataMarker(option: DataMarkerOption): this;
|
82 | /**
|
83 | * 创建 DataRegion
|
84 | * @param option
|
85 | * @returns AnnotationController
|
86 | */
|
87 | dataRegion(option: DataRegionOption): void;
|
88 | /**
|
89 | * 创建 RegionFilter
|
90 | * @param option
|
91 | * @returns AnnotationController
|
92 | */
|
93 | regionFilter(option: RegionFilterOption): void;
|
94 | /**
|
95 | * 创建 ShapeAnnotation
|
96 | * @param option
|
97 | */
|
98 | shape(option: ShapeAnnotationOption): void;
|
99 | /**
|
100 | * 创建 HtmlAnnotation
|
101 | * @param option
|
102 | */
|
103 | html(option: HtmlAnnotationOption): void;
|
104 | /**
|
105 | * parse the point position to [x, y]
|
106 | * @param p Position
|
107 | * @returns { x, y }
|
108 | */
|
109 | private parsePosition;
|
110 | |
111 |
|
112 |
|
113 |
|
114 |
|
115 |
|
116 | private getRegionPoints;
|
117 | |
118 |
|
119 |
|
120 |
|
121 | private parsePercentPosition;
|
122 | |
123 |
|
124 |
|
125 | private getCoordinateBBox;
|
126 | |
127 |
|
128 |
|
129 |
|
130 |
|
131 |
|
132 | private getAnnotationCfg;
|
133 | |
134 |
|
135 |
|
136 |
|
137 |
|
138 | private isTop;
|
139 | |
140 |
|
141 |
|
142 |
|
143 |
|
144 |
|
145 | private getComponentContainer;
|
146 | private getAnnotationTheme;
|
147 | |
148 |
|
149 |
|
150 |
|
151 | private updateOrCreate;
|
152 | |
153 |
|
154 |
|
155 |
|
156 | private syncCache;
|
157 | |
158 |
|
159 |
|
160 |
|
161 | private getCacheKey;
|
162 | }
|