UNPKG

@gravity-ui/graph

Version:

Modern graph editor component

19 lines (18 loc) 887 B
/** * Creates a Path2D object that represents a triangle pointing towards the direction defined by * two points, with its tip at a parameterized position along the line and a given height and base width. * * @param {Object} start - The starting point of the vector. * @param {Object} end - The ending point of the vector. * @param {number} [height=10] - The height of the triangle from the base to the tip. * @param {number} [baseWidth=5] - The width of the triangle's base. * @param {number} [t=1] - A parameter [0, 1] that determines where the tip of the triangle is placed along the line. 0 - start point, 1 - end point * @returns {Path2D} The Path2D object representing the triangle. */ export declare function trangleArrowForVector(start: { x: number; y: number; }, end: { x: number; y: number; }, height?: number, baseWidth?: number, t?: number): Path2D;