(width: number, height: number)
| 31 | * desktop canvas allows a few dozen and a narrow panel only a handful. |
| 32 | */ |
| 33 | export function labelCapForArea(width: number, height: number): number { |
| 34 | const density = width < 520 ? 58_000 : 30_000; |
| 35 | const floor = width < 520 ? 4 : 6; |
| 36 | return Math.max(floor, Math.floor((width * height) / density)); |
| 37 | } |
| 38 | |
| 39 | function overlaps(a: LabelBox, b: LabelBox): boolean { |
| 40 | return ( |