1 | import { MappingDatum, Point } from '../../interface';
|
2 | import { LabelCfg, LabelItem, LabelPointCfg, TextAlign } from './interface';
|
3 | import Labels from '../../component/labels';
|
4 | import Geometry from '../base';
|
5 | export declare type GeometryLabelConstructor = new (cfg: any) => GeometryLabel;
|
6 |
|
7 |
|
8 |
|
9 | export default class GeometryLabel {
|
10 |
|
11 | readonly geometry: Geometry;
|
12 | labelsRenderer: Labels;
|
13 |
|
14 | defaultLayout: string;
|
15 | constructor(geometry: Geometry);
|
16 | getLabelItems(mapppingArray: MappingDatum[]): LabelItem[];
|
17 | render(mappingArray: MappingDatum[], isUpdate?: boolean): Promise<void>;
|
18 | clear(): void;
|
19 | destroy(): void;
|
20 | getCoordinate(): import("@antv/coord/lib/coord/base").default;
|
21 | /**
|
22 | * 获取 label 的默认配置
|
23 | */
|
24 | protected getDefaultLabelCfg(offset?: number, position?: string): any;
|
25 | /**
|
26 | * 获取当前 label 的最终配置
|
27 | * @param labelCfg
|
28 | */
|
29 | protected getThemedLabelCfg(labelCfg: LabelCfg): any;
|
30 | /**
|
31 | * 设置 label 位置
|
32 | * @param labelPointCfg
|
33 | * @param mappingData
|
34 | * @param index
|
35 | * @param position
|
36 | */
|
37 | protected setLabelPosition(labelPointCfg: LabelPointCfg, mappingData: MappingDatum, index: number, position: string): void;
|
38 | /**
|
39 | * @desc 获取 label offset
|
40 | */
|
41 | protected getLabelOffset(offset: number | string): number;
|
42 | /**
|
43 | * 获取每个 label 的偏移量 (矢量)
|
44 | * @param labelCfg
|
45 | * @param index
|
46 | * @param total
|
47 | * @return {Point} offsetPoint
|
48 | */
|
49 | protected getLabelOffsetPoint(labelCfg: LabelCfg, index: number, total: number): Point;
|
50 | |
51 |
|
52 |
|
53 |
|
54 |
|
55 |
|
56 |
|
57 | protected getLabelPoint(labelCfg: LabelCfg, mappingData: MappingDatum, index: number): LabelPointCfg;
|
58 | |
59 |
|
60 |
|
61 |
|
62 |
|
63 |
|
64 |
|
65 | protected getLabelAlign(item: LabelItem, index: number, total: number): TextAlign;
|
66 | |
67 |
|
68 |
|
69 |
|
70 | protected getLabelId(mappingData: MappingDatum): any;
|
71 | private getLabelsRenderer;
|
72 | private getLabelCfgs;
|
73 | private getLabelText;
|
74 | private getOffsetVector;
|
75 | private getGeometryShapes;
|
76 | }
|