| 154 | } |
| 155 | |
| 156 | async state() { |
| 157 | return this.page.evaluate(() => { |
| 158 | const fit = globalThis.__atlasGalaxyFit?.measure?.(); |
| 159 | const galaxy = globalThis.__atlasGalaxy; |
| 160 | const status = [...document.querySelectorAll('.atlas-galaxy-toolbar, .atlas-galaxy-scope-status, [role="status"]')] |
| 161 | .map((el) => el.textContent?.trim()).filter(Boolean).slice(0, 6); |
| 162 | return { |
| 163 | url: location.pathname + location.search, |
| 164 | canvas: window.__probeCanvasId?.() ?? null, |
| 165 | canvases: document.querySelectorAll('canvas').length, |
| 166 | galaxy: galaxy ? { |
| 167 | nodes: galaxy.nodes, fits: galaxy.fits, targetChanges: galaxy.targetChanges, |
| 168 | highlighted: galaxy.highlightedCount, lastTargetQn: galaxy.lastTargetQn, mode: galaxy.mode, |
| 169 | headline: galaxy.headline, drawnEdges: galaxy.drawnEdges, edgeNote: galaxy.edgeNote, |
| 170 | lastFit: galaxy.lastFit, |
| 171 | } : null, |
| 172 | fit: fit ? { |
| 173 | nodes: fit.nodes, inside: fit.inside, outside: fit.outside, behind: fit.behind, |
| 174 | marginPx: fit.marginPx, box: fit.box, fill: fit.fill, camera: fit.camera, worst: fit.worst, |
| 175 | } : null, |
| 176 | status, |
| 177 | }; |
| 178 | }); |
| 179 | } |
| 180 | |
| 181 | async shot(label, note, options = {}) { |
| 182 | this.n += 1; |