MCPcopy Index your code
hub / github.com/apache/echarts / snapshot

Function snapshot

theme/tool/thumb.js:31–49  ·  view source on GitHub ↗
(browser, themePath)

Source from the content-addressed store, hash-verified

29}
30
31async function snapshot(browser, themePath) {
32 let themeName = path.basename(themePath, '.js');
33 let code = fs.readFileSync(themePath, 'utf-8');
34
35 let page = await browser.newPage();
36 await page.evaluateOnNewDocument(code);
37 await page.setViewport({ width: 1200, height: 1200 });
38 try {
39 await page.goto('http://localhost/echarts/theme/tool/thumb.html#' + themeName);
40 await wait(200);
41 await page.screenshot({ path: __dirname + '/../thumb/' + themeName + '.png' });
42 }
43 catch (e) {
44 console.log(e);
45 }
46 await page.close();
47
48 console.log('Updated ' + themeName);
49}
50
51glob('../*.js', async function (err, themePathList) {
52

Callers 1

thumb.jsFile · 0.85

Calls 2

waitFunction · 0.85
closeMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…