NuclearDispersionSystem/ant-design-vue-jeecg/node_modules/@antv/g2/esm/util/bbox.d.ts

84 lines
1.9 KiB
TypeScript
Raw Normal View History

2023-09-14 14:47:11 +08:00
import { DIRECTION } from '../constant';
import { Padding, Point, Region } from '../interface';
/**
*
*/
export declare class BBox {
/** x 轴坐标系 */
x: number;
/** y 轴坐标系 */
y: number;
/** 包围盒高度 */
height: number;
/** 包围盒宽度 */
width: number;
static fromRange(minX: number, minY: number, maxX: number, maxY: number): BBox;
constructor(x?: number, y?: number, width?: number, height?: number);
get minX(): number;
get maxX(): number;
get minY(): number;
get maxY(): number;
get tl(): Point;
get tr(): Point;
get bl(): Point;
get br(): Point;
get top(): Point;
get right(): Point;
get bottom(): Point;
get left(): Point;
/**
*
* @param {BBox} bbox
* @returns
*/
isEqual(bbox: BBox): boolean;
/**
*
* @returns
*/
clone(): BBox;
/**
*
* @param subBBox
*/
add(...subBBox: BBox[]): BBox;
/**
*
* @param subBBox
*/
merge(...subBBox: BBox[]): BBox;
/**
* bbox
* @param subBBox
* @param direction
*/
cut(subBBox: BBox, direction: DIRECTION): BBox;
/**
*
* @param gap
*/
shrink(gap: Padding): BBox;
/**
* get the gap of two bbox, if not exceed, then 0
* @param bbox
* @returns [top, right, bottom, left]
*/
exceed(bbox: BBox): number[];
/**
*
* @returns
*/
size(): number;
}
/**
* bbox region bbox
* @param bbox
* @param region
*/
export declare const getRegionBBox: (bbox: BBox, region: Region) => BBox;
/**
* bbox points
* @param bbox
*/
export declare function toPoints(bbox: Partial<BBox>): any[];