MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / arcPath

Function arcPath

ui/src/lib/filecode-model.ts:450–456  ·  view source on GitHub ↗
(fromLine: number, toLine: number, depth: number)

Source from the content-addressed store, hash-verified

448 * sweep 0 runs anticlockwise, which passes left going DOWN and right going up.
449 */
450export function arcPath(fromLine: number, toLine: number, depth: number): string {
451 const y0 = lineCentre(fromLine);
452 const y1 = lineCentre(toLine);
453 const ry = Math.max(1, Math.abs(y1 - y0) / 2);
454 const sweep = y1 > y0 ? 0 : 1;
455 return `M${ARC_COLUMN},${y0} A${depth.toFixed(1)},${ry.toFixed(1)} 0 0 ${sweep} ${ARC_COLUMN},${y1}`;
456}
457
458/**
459 * The arcs to draw: everything when there are few, otherwise the focused

Callers 2

buildFileArcsFunction · 0.85

Calls 1

lineCentreFunction · 0.85

Tested by

no test coverage detected