| 725 | degree.set(l.target, (degree.get(l.target) ?? 0) + 1); |
| 726 | } |
| 727 | const widthOf = (id: string): number => { |
| 728 | const info = infos.get(id); |
| 729 | // A cut step wears ` …` after its name and the anchor its ● mark before |
| 730 | // it; size for both, or the CSS ellipsis eats the name's tail instead |
| 731 | // (`/scan-to-verif…` for `/scan-to-verify …`). |
| 732 | const cut = info?.step.cut != null ? ' …' : ''; |
| 733 | const mark = info?.step.anchor ? '● ' : ''; |
| 734 | return Math.max( |
| 735 | nodeWidth(mark + (info?.label ?? id) + cut, info?.sub ?? ''), |
| 736 | ((degree.get(id) ?? 0) + 1) * PORT_PITCH |
| 737 | ); |
| 738 | }; |
| 739 | |
| 740 | // Regions in the order the walk met them — the screen's own source order. |
| 741 | interface Region { |