@antv/g2plot
Version:
G2 Plot, a market of plots built with the Grammar of Graphics'
37 lines (36 loc) • 1.58 kB
TypeScript
import { LabelItem } from '@antv/component/lib/interface';
import Polar from '@antv/coord/lib/coord/polar';
import { BBox, Shape } from '@antv/g';
import { PieViewConfig } from '../../layer';
declare const PieElementLabels: import("@antv/g2/lib/element/controller/label/components/base").ElementLabelsConstructor;
/**
* @desc eva-pie 所有自定义 pie-label 的基类
*/
export default abstract class extends PieElementLabels {
protected anchors: Array<{
x: number;
y: number;
id: string;
} & LabelItem>;
protected anchorRadius: number;
showLabels(points: any, shapes: Shape[]): void;
/** 调整 labels */
abstract adjustPosition(labels: Shape[], items: LabelItem[], coord: Polar, panel: BBox): void;
/** 调整 label lines */
abstract adjustLines(labels: Shape[], items: LabelItem[], lines: Shape[], coord: Polar, panel: BBox): void;
/** 调整 label texts */
adjustTexts(labels: Shape[], items: LabelItem[], coord: Polar, panel: BBox): void;
adjustItems(originItems: LabelItem[]): LabelItem[];
/** 调整 label text */
protected adjustLabelText(label: Shape, item: LabelItem, coord: Polar, panel: BBox): void;
/** 处理标签遮挡问题 */
protected adjustOverlap(labels: Shape[], panel: BBox): void;
/**
* 超出panel边界的标签默认隐藏
*/
protected checkInPanel(label: Shape, panel: BBox): void;
/** 默认用户配置的offset, */
protected abstract getOffsetOfLabel(): number;
protected getLabelOptions(): PieViewConfig['label'];
}
export {};