(route: EdgeRoute)
| 397 | return from > to ? 'down' : from < to ? 'up' : 'level'; |
| 398 | }; |
| 399 | const sidesOf = (route: EdgeRoute): { source: 'top' | 'bottom'; target: 'top' | 'bottom' } => { |
| 400 | if (!directional || route === 'down') return { source: 'bottom', target: 'top' }; |
| 401 | if (route === 'up') return { source: 'top', target: 'bottom' }; |
| 402 | return { source: 'top', target: 'top' }; |
| 403 | }; |
| 404 | const portCount = new Map<string, { top: number; bottom: number }>( |
| 405 | modules.map((m) => [m.id, { top: 0, bottom: 0 }]) |
| 406 | ); |