UNPKG

@visactor/vrender-components

Version:

components library for dp visualization

80 lines (79 loc) 3.18 kB
import type { IAABBBounds, IBoundsLike } from '@visactor/vutils'; import { LabelBase } from './base'; import type { ArcLabelAttrs, IPoint, Quadrant, BaseLabelAttrs, LabelItem, IArcLabelLineSpec } from './type'; import type { IArc } from '@visactor/vrender-core'; import { type IRichText, type IText, type IGraphic } from '@visactor/vrender-core'; import type { ComponentOptions } from '../interface'; export declare class ArcInfo { key: string; refDatum: any; refArc: IArc; center: IPoint; outerCenter: IPoint; labelSize: { width: number; height: number; }; labelPosition: IPoint; labelLimit: number; labelVisible: boolean; lastLabelY: number; labelYRange: [number, number]; labelText: string | string[]; pointA: IPoint; pointB: IPoint; pointC: IPoint; labelLine: IArcLabelLineSpec; quadrant: Quadrant; radian: number; middleAngle: number; innerRadius: number; outerRadius: number; circleCenter: IPoint; k: number; angle: number; constructor(refDatum: any, center: IPoint, outerCenter: IPoint, quadrant: Quadrant, radian: number, middleAngle: number, innerRadius: number, outerRadius: number, circleCenter: IPoint); getLabelBounds(): IBoundsLike; } export declare class ArcLabel extends LabelBase<ArcLabelAttrs> { name: string; static defaultAttributes: Partial<ArcLabelAttrs>; private _ellipsisWidth; private _arcLeft; private _arcRight; private _line2MinLength; private _alignOffset; constructor(attributes: ArcLabelAttrs, options?: ComponentOptions); protected _overlapping(labels: (IText | IRichText)[]): (IRichText | IText)[]; protected labeling(textBounds: IBoundsLike, graphicBounds: IBoundsLike, position?: string, offset?: number): { x: number; y: number; } | undefined; protected _layout(texts: (IText | IRichText)[]): (IRichText | IText)[]; protected layoutArcLabels(position: BaseLabelAttrs['position'], attribute: any, currentMarks?: IGraphic[], data?: LabelItem[], textBoundsArray?: any, ellipsisWidth?: number): ArcInfo[]; private _layoutInsideLabels; private _layoutOutsideLabels; private _computeX; private _computeAlign; private _getFormatLabelText; private _adjustY; private _shiftY; private _findNextVisibleIndex; private _computePointB; private _storeY; private _computeYRange; private _computeLayoutRadius; private _findNeighborIndex; private _twoWayShift; private _restoreY; private _checkYRange; private _coverLabels; protected _getLabelLinePoints(text: IText | IRichText, baseMark?: IGraphic): IPoint[]; protected _createLabelLine(text: IText, baseMark?: IGraphic): import("@visactor/vrender-core").ILine; protected computeRadius(r: number, width?: number, height?: number, k?: number): number; protected computeLayoutRadius(width: number, height: number): number; protected _canPlaceInside(textBound: IBoundsLike, shapeBound: IAABBBounds): boolean; private computeLayoutOuterRadius; private computeDatumRadius; } export declare const registerArcDataLabel: () => void;