You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

49 lines
1.8 KiB

4 months ago
import type { DisplayObjectConfig } from '@antv/g';
import type { PathArray } from '@antv/util';
import type { Point } from '../../types';
import type { BaseEdgeStyleProps } from './base-edge';
import { BaseEdge } from './base-edge';
/**
* <zh/> 线
*
* <en/> Cubic Bezier curve style properties
*/
export interface CubicStyleProps extends BaseEdgeStyleProps {
/**
* <zh/> 线 `curveOffset` `curvePosition`
*
* <en/> Control points. Used to define the shape of the curve. If not specified, it will be calculated using `curveOffset` and `curvePosition`.
*/
controlPoints?: [Point, Point];
/**
* <zh/> 线`0-1`
*
* <en/> The relative position of the control point on the line, ranging from `0-1`
* @defaultValue 0.5
*/
curvePosition?: number | [number, number];
/**
* <zh/> 线
*
* <en/> The distance of the control point from the line
* @defaultValue 20
*/
curveOffset?: number | [number, number];
}
type ParsedCubicStyleProps = Required<CubicStyleProps>;
/**
* <zh/> 线
*
* <en/> Cubic Bezier curve
*/
export declare class Cubic extends BaseEdge {
static defaultStyleProps: Partial<CubicStyleProps>;
constructor(options: DisplayObjectConfig<CubicStyleProps>);
/**
* @inheritdoc
*/
protected getKeyPath(attributes: ParsedCubicStyleProps): PathArray;
protected getControlPoints(sourcePoint: Point, targetPoint: Point, curvePosition: [number, number], curveOffset: [number, number], controlPoints?: [Point, Point]): [Point, Point];
}
export {};