Added TSDocs for several public util functions & converted comments to TSDocs for internal functions

This commit is contained in:
Peter
2023-12-05 12:12:21 +01:00
parent f5da8c6b75
commit 4accceb202
3 changed files with 72 additions and 10 deletions
@@ -69,6 +69,17 @@ function getControlWithCurvature({ pos, x1, y1, x2, y2, c }: GetControlWithCurva
}
}
/**
* Get a bezier path from source to target handle
* @param params.sourceX - The x position of the source handle
* @param params.sourceY - The y position of the source handle
* @param params.sourcePosition - The position of the source handle
* @param params.targetX - The x position of the target handle
* @param params.targetY - The y position of the target handle
* @param params.targetPosition - The position of the target handle
* @param params.curvature - The curvature of the bezier edge
* @returns A path string you can use in an SVG, the labelX and labelY position (center of path) and offsetX, offsetY between source handle and label
*/
export function getBezierPath({
sourceX,
sourceY,