| 151 | function mark(label, from, to) { marks.push({ label, from, to }); } |
| 152 | |
| 153 | async function state(page) { |
| 154 | return page.evaluate(() => { |
| 155 | const fit = globalThis.__atlasGalaxyFit?.measure?.(); |
| 156 | const galaxy = globalThis.__atlasGalaxy; |
| 157 | return { |
| 158 | canvas: window.__probeCanvasId?.() ?? null, |
| 159 | fits: galaxy?.fits ?? null, nodes: galaxy?.nodes ?? null, drawnEdges: galaxy?.drawnEdges ?? null, |
| 160 | outside: fit?.outside ?? null, inside: fit?.inside ?? null, camera: fit?.camera ?? null, |
| 161 | viewport: fit?.viewport ?? null, |
| 162 | toolbar: document.querySelector('.atlas-graph-exploration')?.textContent?.replace(/\s+/g, ' ').trim() ?? '', |
| 163 | }; |
| 164 | }); |
| 165 | } |
| 166 | |
| 167 | async function open(page, project, workspace) { |
| 168 | await page.goto(`${ORIGIN}/?project=${encodeURIComponent(project)}&workspace=${workspace}`, { waitUntil: 'domcontentloaded' }); |