UNPKG

@visactor/vrender-components

Version:

components library for dp visualization

24 lines (23 loc) 1.39 kB
import type { IText, Text } from '@visactor/vrender-core'; import type { IAABBBounds, IBoundsLike } from '@visactor/vutils'; import type { PointLocationCfg } from '../../core/type'; import type { LabelBase } from '../base'; import type { BaseLabelAttrs, Strategy } from '../type'; import type { Bitmap } from './bitmap'; import type { BitmapTool } from './scaler'; export declare function canPlace($: BitmapTool, bitmap: Bitmap, bound: IBoundsLike, checkBound?: boolean, pad?: number): boolean; export declare function canPlaceInside(textBound: IBoundsLike, shapeBound: IAABBBounds): boolean; export declare function placeToCandidates($: BitmapTool, bitmap: Bitmap, text: Text, candidates?: PointLocationCfg[], clampForce?: boolean, pad?: number, changePosition?: boolean): PointLocationCfg | false; export declare function place<T extends BaseLabelAttrs>($: BitmapTool, bitmap: Bitmap, s: Strategy, attrs: T, text: Text, bounds: IBoundsLike, labeling?: LabelBase<T>['labeling']): PointLocationCfg | false; export declare const DefaultPositions: string[]; export declare const DefaultRectPositions: string[]; export declare function defaultLabelPosition(type?: string): string[]; export declare function clampText(text: IText, width: number, height: number, padding?: { top?: number; left?: number; right?: number; bottom?: number; }): { dx: number; dy: number; };