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/01/10 15:51:23 UTC

[incubator-echarts-examples] branch next updated (fba4f4e -> e27fd23)

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

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


    from fba4f4e  also build examples for gl
     new 5b66d93  Error handling when failed to generate option in build-example
     new e27fd23  fix graphgl-npm-dep example

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .gitignore                        |  1 +
 e2e/main.js                       |  8 ++++++-
 public/data-gl/graphgl-npm-dep.js |  8 +++----
 tool/build-example.js             | 48 +++++++++++++++++++++++++++------------
 4 files changed, 45 insertions(+), 20 deletions(-)


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


[incubator-echarts-examples] 01/02: Error handling when failed to generate option in build-example

Posted by sh...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 5b66d9346648121e3ae4d20667f9c88ab45c389a
Author: pissang <bm...@gmail.com>
AuthorDate: Sun Jan 10 23:33:07 2021 +0800

    Error handling when failed to generate option in build-example
---
 e2e/main.js           |  8 +++++++-
 tool/build-example.js | 48 +++++++++++++++++++++++++++++++++---------------
 2 files changed, 40 insertions(+), 16 deletions(-)

diff --git a/e2e/main.js b/e2e/main.js
index a18a20f..27101bc 100644
--- a/e2e/main.js
+++ b/e2e/main.js
@@ -462,7 +462,11 @@ async function runExamples(jsFiles, result) {
     try {
         const IGNORE_LOG = [
             'A cookie associated with a cross-site resource at',
-            'A parser-blocking, cross site'
+            'A parser-blocking, cross site',
+            // For ECharts GL
+            'RENDER WARNING',
+            'GL ERROR',
+            'GL_INVALID_OPERATION'
         ];
 
         const browser = await puppeteer.launch({
@@ -470,6 +474,8 @@ async function runExamples(jsFiles, result) {
             args: [
                 '--headless',
                 '--hide-scrollbars',
+                // https://github.com/puppeteer/puppeteer/issues/4913
+                '--use-gl=egl',
                 '--mute-audio'
             ]
         });
diff --git a/tool/build-example.js b/tool/build-example.js
index 4e4a334..417634e 100644
--- a/tool/build-example.js
+++ b/tool/build-example.js
@@ -68,8 +68,13 @@ const BASE_URL = `http://localhost:${PORT}`;
 const SCREENSHOT_PAGE_URL = `${BASE_URL}/tool/screenshot.html`;
 
 const IGNORE_LOG = [
+    // For BMap
     'A cookie associated with a cross-site resource at',
-    'A parser-blocking, cross site'
+    'A parser-blocking, cross site',
+    // For ECharts GL
+    'RENDER WARNING',
+    'GL ERROR',
+    'GL_INVALID_OPERATION'
 ];
 
 async function convertToWebP(filePath) {
@@ -114,7 +119,7 @@ async function takeScreenshot(
         try {
             await page.goto(url, {
                 waitUntil: 'networkidle0',
-                timeout: 10000
+                timeout: 20000
             });
         }
         catch (e) {
@@ -132,19 +137,25 @@ async function takeScreenshot(
         fse.ensureDirSync(thumbDir);
 
         // Save option for further tests.
-        const option = await page.evaluate(() => {
-            return _$getEChartsOption()
-        });
-        const optionStr = optionToJson(option);
-
-        fse.ensureDirSync(`${rootDir}public/${sourceFolder}/option/`);
-        fs.writeFileSync(`${rootDir}public/${sourceFolder}/option/${basename}.json`, optionStr, 'utf-8');
+        try {
+            const option = await page.evaluate(() => {
+                return _$getEChartsOption()
+            });
+            const optionStr = optionToJson(option);
+            fse.ensureDirSync(`${rootDir}public/${sourceFolder}/option/`);
+            fs.writeFileSync(`${rootDir}public/${sourceFolder}/option/${basename}.json`, optionStr, 'utf-8');
+        }
+        catch (e) {
+            console.error(chalk.red('Failed to generate option'));
+            console.error(chalk.red(e));
+        }
 
         await page.screenshot({
             path: filePathTmpRaw,
             type: 'png'
         });
 
+
         await sharp(filePathTmpRaw)
             .resize(OUTPUT_IMAGE_WIDTH, OUTPUT_IMAGE_WIDTH * DEFAULT_PAGE_RATIO)
             .toFile(filePathTmp);
@@ -213,11 +224,17 @@ async function takeScreenshot(
     for (let theme of themeList) {
         for (let fileName of files) {
             const basename = path.basename(fileName, '.js');
-            tasks.push({
-                buildThumb: BUILD_THUMBS && screenshotBlackList.indexOf(basename) < 0,
-                theme,
-                basename
-            })
+            if (
+                !matchPattern || matchPattern.some(function (pattern) {
+                    return minimatch(basename, pattern);
+                })
+            ) {
+                tasks.push({
+                    buildThumb: BUILD_THUMBS && screenshotBlackList.indexOf(basename) < 0,
+                    theme,
+                    basename
+                });
+            }
         }
     }
 
@@ -229,6 +246,7 @@ async function takeScreenshot(
             || basename === 'lines3d-taxi-chengdu'
             || basename === 'map3d-colorful-cities'
 
+            // TODO Examples that can't work temporary.
             || basename === 'bar3d-music-visualization'
         ) {
             return;
@@ -278,7 +296,7 @@ async function takeScreenshot(
             await browser.close();
             throw new Error(e.toString());
         }
-    }, sourceFolder === 'data-gl' ? 4 : 16);
+    }, sourceFolder === 'data-gl' ? 2 : 16);
 
     if (BUILD_THUMBS) {
         server.close();


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


[incubator-echarts-examples] 02/02: fix graphgl-npm-dep example

Posted by sh...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit e27fd23544a07dbe5800654223fbaa93fcc78545
Author: pissang <bm...@gmail.com>
AuthorDate: Sun Jan 10 23:50:42 2021 +0800

    fix graphgl-npm-dep example
---
 .gitignore                        | 1 +
 public/data-gl/graphgl-npm-dep.js | 8 ++++----
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/.gitignore b/.gitignore
index 8e50c5a..8b72324 100644
--- a/.gitignore
+++ b/.gitignore
@@ -13,5 +13,6 @@ public/vendors/echarts/map/raw
 /public/css
 /public/asset
 /public/data/option
+/public/data-gl/option
 
 tmp
\ No newline at end of file
diff --git a/public/data-gl/graphgl-npm-dep.js b/public/data-gl/graphgl-npm-dep.js
index 5b8ac35..27f3662 100644
--- a/public/data-gl/graphgl-npm-dep.js
+++ b/public/data-gl/graphgl-npm-dep.js
@@ -6,8 +6,8 @@ titleCN: 1w 节点 2w7 边的NPM 依赖图
 */
 
 $.when(
-    $.getJSON(ROOT_PATH + "/data-gl/asset/data/npmdep.json"),
-    $.getScript(ROOT_PATH + "/vendors/echarts/extension/graph-modularity.js")
+    $.getJSON(ROOT_PATH + '/data-gl/asset/data/npmdep.json'),
+    $.getScript('https://cdn.jsdelivr.net/npm/echarts-graph-modularity@2/dist/echarts-graph-modularity.js')
 ).done(function (res) {
     var data = res[0];
     var nodes = data.nodes.map(function (nodeName, idx) {
@@ -44,7 +44,7 @@ $.when(
     myChart.setOption({
         backgroundColor: '#000',
         series: [{
-            color: ["rgb(203,239,15)", "rgb(73,15,239)","rgb(15,217,239)","rgb(30,15,239)","rgb(15,174,239)","rgb(116,239,15)","rgb(239,15,58)","rgb(15,239,174)","rgb(239,102,15)","rgb(239,15,15)","rgb(15,44,239)","rgb(239,145,15)","rgb(30,239,15)","rgb(239,188,15)","rgb(159,239,15)","rgb(159,15,239)","rgb(15,239,44)","rgb(15,239,87)","rgb(15,239,217)","rgb(203,15,239)","rgb(239,15,188)","rgb(239,15,102)","rgb(239,58,15)","rgb(239,15,145)","rgb(116,15,239)","rgb(15,131,239)","rgb(73,239, [...]
+            color: ['rgb(203,239,15)', 'rgb(73,15,239)','rgb(15,217,239)','rgb(30,15,239)','rgb(15,174,239)','rgb(116,239,15)','rgb(239,15,58)','rgb(15,239,174)','rgb(239,102,15)','rgb(239,15,15)','rgb(15,44,239)','rgb(239,145,15)','rgb(30,239,15)','rgb(239,188,15)','rgb(159,239,15)','rgb(159,15,239)','rgb(15,239,44)','rgb(15,239,87)','rgb(15,239,217)','rgb(203,15,239)','rgb(239,15,188)','rgb(239,15,102)','rgb(239,58,15)','rgb(239,15,145)','rgb(116,15,239)','rgb(15,131,239)','rgb(73,239, [...]
             type: 'graphGL',
             nodes: nodes,
             edges: edges,
@@ -57,7 +57,7 @@ $.when(
                 opacity: 0.05
             },
             itemStyle: {
-                opacity: 1,
+                opacity: 1
                 // borderColor: '#fff',
                 // borderWidth: 1
             },


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