Total Complexity | 3 |
Complexity/F | 1 |
Lines of Code | 19 |
Function Count | 3 |
Duplicated Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | import { ElementHandle } from 'puppeteer'; |
||
2 | import { TRANSITION_DURATION } from '../../src/utils/AppConsts'; |
||
3 | |||
4 | export async function waitForGraphStabilization() { |
||
5 | await page.waitFor(500); |
||
6 | } |
||
7 | |||
8 | export async function waitForAllTransitions() { |
||
9 | await page.waitFor(TRANSITION_DURATION); |
||
10 | } |
||
11 | |||
12 | // Replacement of element.boundingBox() - we need to get node positions within SVG container, not relative to main frame |
||
13 | export async function getElementBBox(element: ElementHandle<SVGGraphicsElement>) { |
||
14 | return await element.evaluate(el => { |
||
15 | const { x, y, width, height } = el.getBBox(); |
||
16 | return { x, y, width, height }; |
||
17 | }); |
||
18 | } |
||
19 |