(n: FlowNode)
| 142 | const out = nodes.map((n) => ({ ...n, position: { ...n.position } })); |
| 143 | |
| 144 | const getBox = (n: FlowNode): Box => { |
| 145 | const dim = nodeDimensions.get(n.id) || { width: DEFAULT_NODE_WIDTH, height: DEFAULT_NODE_HEIGHT }; |
| 146 | return { id: n.id, x: n.position.x, y: n.position.y, w: dim.width, h: dim.height }; |
| 147 | }; |
| 148 | |
| 149 | // We only push nodes "forward" (down in TB, right in LR) to preserve flow direction. |
| 150 | const maxIters = 10; |