(labels: readonly { index: number; from: { x: number; y: number }; to: { x: number; y: number }; size: { width: number; height: number } }[],
blockers: readonly ScreenRect[])
| 71 | * frei steht. Ein spaeteres Label weicht den frueheren aus wie den Namen. |
| 72 | */ |
| 73 | export function pathLabelSpots(labels: readonly { index: number; from: { x: number; y: number }; to: { x: number; y: number }; size: { width: number; height: number } }[], |
| 74 | blockers: readonly ScreenRect[]): Map<number, { t: number; rect: ScreenRect }> { |
| 75 | const placed: ScreenRect[] = []; |
| 76 | const spots = new Map<number, { t: number; rect: ScreenRect }>(); |
| 77 | for (const { index, from, to, size } of labels) { |
| 78 | const choice = placeAlongSegment(from, to, size, blockers, placed); |
| 79 | if (choice.overlap > 0) continue; |
| 80 | placed.push(choice.rect); |
| 81 | spots.set(index, { t: choice.t, rect: choice.rect }); |
| 82 | } |
| 83 | return spots; |
| 84 | } |
| 85 | |
| 86 | export function PathLayer({ nodes, path, namedRoots }: { |
| 87 | nodes: readonly GraphNode[]; |
no test coverage detected