(id: string)
| 601 | // What a box leads to reads before what reaches it, and each side in the |
| 602 | // order the picture puts the other end — down the page, then across. |
| 603 | const place = (id: string): number => { |
| 604 | const n = nodeById.get(id); |
| 605 | return n ? n.y * 100000 + n.x : 0; |
| 606 | }; |
| 607 | for (const list of stubs.values()) { |
| 608 | list.sort((a, b) => (a.dir === b.dir ? place(a.other) - place(b.other) : a.dir === 'out' ? -1 : 1)); |
| 609 | } |