(n, cols = 12)
| 51 | |
| 52 | // Generate a messy (gaps, overlaps) layout |
| 53 | function generateMessyLayout(n, cols = 12) { |
| 54 | const layout = []; |
| 55 | for (let i = 0; i < n; i++) { |
| 56 | layout.push({ |
| 57 | i: String(i), |
| 58 | x: Math.floor(Math.random() * (cols - 2)), |
| 59 | y: Math.floor(Math.random() * (n / 2)), |
| 60 | w: 1 + Math.floor(Math.random() * 3), |
| 61 | h: 1 + Math.floor(Math.random() * 3) |
| 62 | }); |
| 63 | } |
| 64 | return layout; |
| 65 | } |
| 66 | |
| 67 | // Check if a layout has any overlaps (ignoring static items overlapping each other) |
| 68 | function hasOverlaps(layout) { |
no outgoing calls
no test coverage detected
searching dependent graphs…