(x: number, text: string, anchor: 'start' | 'middle' | 'end')
| 105 | // oder er steht links von seiner Linie, und in beiden Faellen ganz |
| 106 | // innerhalb des Bildes. |
| 107 | const span = (x: number, text: string, anchor: 'start' | 'middle' | 'end'): number[] => { |
| 108 | const width = text.length * DIAGRAM_LABEL_CHAR_WIDTH; |
| 109 | return anchor === 'end' ? [x - width, x] : [x, x + width]; |
| 110 | }; |
| 111 | const boxed = [ |
| 112 | ...diagram.loops.map((loop) => span(loop.labelX, loop.label, loop.labelAnchor)), |
| 113 | ...diagram.arrows |