| 225 | |
| 226 | /** Der Ansichts-Umschalter: sein Rahmen, seine Rolle und was der aktive Chip sagt. */ |
| 227 | const viewToggle = (page) => |
| 228 | page.evaluate(() => { |
| 229 | const group = document.querySelector('[data-testid="atlas-graph-mode"]'); |
| 230 | if (group === null) { |
| 231 | return null; |
| 232 | } |
| 233 | const style = window.getComputedStyle(group); |
| 234 | const chips = [...group.querySelectorAll('[data-testid="atlas-graph-mode-chip"]')].map((chip) => ({ |
| 235 | mode: chip.getAttribute('data-mode') ?? '', |
| 236 | pressed: chip.getAttribute('aria-pressed') ?? '', |
| 237 | active: chip.getAttribute('data-active') === 'true', |
| 238 | hint: chip.getAttribute('data-hint') ?? '', |
| 239 | disabled: chip.hasAttribute('disabled'), |
| 240 | })); |
| 241 | return { |
| 242 | role: group.getAttribute('role') ?? '', |
| 243 | borderWidth: Number.parseFloat(style.borderTopWidth) || 0, |
| 244 | borderStyle: style.borderTopStyle, |
| 245 | chips, |
| 246 | }; |
| 247 | }); |
| 248 | |
| 249 | /** Die vier Griffe, in Pixeln und mit ihrer Marke. */ |
| 250 | const handles = (page) => |