| 392 | // that asked for a port pitch needs it now: a hub with nineteen lines |
| 393 | // leaving its bottom edge is widened to hold them. |
| 394 | const routeOf = (link: { source: string; target: string }): EdgeRoute => { |
| 395 | const from = layer.get(link.source) ?? 0; |
| 396 | const to = layer.get(link.target) ?? 0; |
| 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' }; |