Skip to content

Commit 125a6ef

Browse files
committed
refactor(lib): drop step-graph helpers left in chart-geometry
1 parent db8396a commit 125a6ef

1 file changed

Lines changed: 0 additions & 40 deletions

File tree

‎src/lib/chart-geometry.ts‎

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -97,43 +97,3 @@ export function formatCompact(value: number): string {
9797
return value.toLocaleString();
9898
}
9999

100-
/**
101-
* The step-graph's node layout runs along one axis at a time — a compact
102-
* preview reads left to right, an expanded trace pane reads top to bottom —
103-
* so the same edge-drawing and default-ordering helpers serve both instead of
104-
* a bespoke path builder per orientation.
105-
*/
106-
export type StepGraphLayoutAxis = "horizontal" | "vertical";
107-
108-
export type StepGraphEdgeEndpoint = { readonly from: string; readonly to: string };
109-
110-
/** Every step connects to the next, in array order — the default edge set
111-
* when a caller has no real DAG dependency data to draw. */
112-
export function sequentialStepEdges(stepIds: readonly string[]): readonly StepGraphEdgeEndpoint[] {
113-
const edges: StepGraphEdgeEndpoint[] = [];
114-
for (let i = 0; i < stepIds.length - 1; i++) {
115-
const from = stepIds[i];
116-
const to = stepIds[i + 1];
117-
if (from !== undefined && to !== undefined) edges.push({ from, to });
118-
}
119-
return edges;
120-
}
121-
122-
/**
123-
* An SVG path for one node-to-node connector, straight and inset from both
124-
* node centers by `inset` so the line meets each node's edge rather than
125-
* running through its label. Returns `""` for a degenerate (near-zero-length)
126-
* connector — an arrowhead with nothing to point along would be a rendering
127-
* artifact, not information.
128-
*/
129-
export function buildStepGraphEdgePath(from: Point, to: Point, inset: number): string {
130-
const dx = to.x - from.x;
131-
const dy = to.y - from.y;
132-
const length = Math.hypot(dx, dy);
133-
if (length <= inset * 2) return "";
134-
const ux = dx / length;
135-
const uy = dy / length;
136-
const start = { x: from.x + ux * inset, y: from.y + uy * inset };
137-
const end = { x: to.x - ux * inset, y: to.y - uy * inset };
138-
return linePath([start, end]);
139-
}

0 commit comments

Comments
 (0)