feat(FN-4549): complete Step 4 — align edges and bounds to measured heights

Fusion-Task-Id: FN-4549
Fusion-Task-Lineage: 7c6b974d-cad9-418c-bf02-9d8490725c6e
This commit is contained in:
Fusion
2026-05-14 20:21:51 -07:00
committed by gsxdsm
parent d3dd9bd38c
commit 7b35a5b426
3 changed files with 29 additions and 12 deletions

View File

@@ -172,11 +172,13 @@ export function useGraphInteraction() {
const nodeWidth = layoutOptions?.nodeWidth ?? 280;
const nodeHeight = layoutOptions?.nodeHeight ?? 100;
const entries = Array.from(positions.values());
const minX = Math.min(...entries.map((p) => p.x));
const minY = Math.min(...entries.map((p) => p.y));
const maxX = Math.max(...entries.map((p) => p.x + nodeWidth));
const maxY = Math.max(...entries.map((p) => p.y + nodeHeight));
const entries = Array.from(positions.entries());
const minX = Math.min(...entries.map(([, p]) => p.x));
const minY = Math.min(...entries.map(([, p]) => p.y));
const maxX = Math.max(...entries.map(([, p]) => p.x + nodeWidth));
const maxY = Math.max(
...entries.map(([taskId, p]) => p.y + (layoutOptions?.measuredHeights?.get(taskId) ?? nodeHeight)),
);
const graphWidth = Math.max(1, maxX - minX);
const graphHeight = Math.max(1, maxY - minY);