You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by sh...@apache.org on 2021/07/16 14:11:06 UTC

[echarts-examples] branch dev updated: fix gl screenshot

This is an automated email from the ASF dual-hosted git repository.

shenyi pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/echarts-examples.git


The following commit(s) were added to refs/heads/dev by this push:
     new 3c38b61  fix gl screenshot
3c38b61 is described below

commit 3c38b6196c9103c7af009ecd5ef5044d48cc7325
Author: pissang <bm...@gmail.com>
AuthorDate: Fri Jul 16 22:10:28 2021 +0800

    fix gl screenshot
---
 tool/build-example.js | 11 +++++++----
 tool/screenshot.html  |  1 +
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/tool/build-example.js b/tool/build-example.js
index 016592b..8b9a1aa 100644
--- a/tool/build-example.js
+++ b/tool/build-example.js
@@ -107,8 +107,8 @@ async function takeScreenshot(
                     return;
                 }
                 timeout += 100;
-                if (timeout >= 20000 + videoEnd) {
-                    console.error(fileBase + ' download timeout.');
+                if (timeout >= 20000 + +videoEnd) {
+                    console.error(fileBase + '.webm download timeout.');
                     resolve();
                     return;
                 }
@@ -125,7 +125,7 @@ async function takeScreenshot(
         width: (shotWidth || DEFAULT_PAGE_WIDTH),
         height: (shotWidth || DEFAULT_PAGE_WIDTH) * DEFAULT_PAGE_RATIO
     });
-    let url = `${SCREENSHOT_PAGE_URL}?c=${basename}&t=${theme}`;
+    let url = `${SCREENSHOT_PAGE_URL}?c=${basename}&t=${theme}&s=${sourceFolder}`;
 
     if (hasVideo) {
         url += `&start=${videoStart}&end=${videoEnd}`;
@@ -229,7 +229,10 @@ async function takeScreenshot(
             // await fs.promises.writeFile('./test.mp4', ffmpeg.FS('readFile', `${fileBase}.webp`));
             // ffmpeg.exit(0);
             shell.exec(`ffmpeg -y -i ${fileBase}.webm -s ${OUTPUT_IMAGE_WIDTH}x${OUTPUT_IMAGE_HEIGHT} -f webp ${fileBase}.webp`);
-            fs.unlinkSync(webmFile);
+            try {
+                fs.unlinkSync(webmFile);
+            }
+            catch(e) {}
         }
 
     }
diff --git a/tool/screenshot.html b/tool/screenshot.html
index 0570e90..57b113a 100644
--- a/tool/screenshot.html
+++ b/tool/screenshot.html
@@ -7,6 +7,7 @@
     <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/lodash@3.10.1/index.min.js"></script>
     <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/dat.gui@0.6.5/build/dat.gui.min.js"></script>
     <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/echarts-nightly/dist/echarts.js"></script>
+    <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/echarts-gl/dist/echarts-gl.js"></script>
     <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/echarts@5.0.0-alpha.2/map/js/china.js"></script>
     <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/echarts@5.0.0-alpha.2/map/js/world.js"></script>
     <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/echarts@5/dist/extension/dataTool.js"></script>

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org