You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by de...@apache.org on 2018/09/21 03:50:55 UTC

[incubator-echarts] branch master updated: refactor(sankey): refactor the test of sankey

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

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


The following commit(s) were added to refs/heads/master by this push:
     new 8fc998a  refactor(sankey): refactor the test of sankey
     new 22da690  Merge branch 'master' of https://github.com/apache/incubator-echarts
8fc998a is described below

commit 8fc998a7a1de9e24d0d88d927bbbeab5f9b50f32
Author: deqingli <an...@gmail.com>
AuthorDate: Fri Sep 21 11:27:08 2018 +0800

    refactor(sankey): refactor the test of sankey
---
 src/chart/sankey/sankeyVisual.js |  4 +--
 test/sankey-horizontal.html      | 72 +---------------------------------------
 test/sankey.html                 |  3 +-
 3 files changed, 4 insertions(+), 75 deletions(-)

diff --git a/src/chart/sankey/sankeyVisual.js b/src/chart/sankey/sankeyVisual.js
index a0706f6..8c2ad6f 100644
--- a/src/chart/sankey/sankeyVisual.js
+++ b/src/chart/sankey/sankeyVisual.js
@@ -41,7 +41,7 @@ export default function (ecModel, payload) {
                     maxValue = nodeValue;
                 }
             });
-            
+
             zrUtil.each(nodes, function (node) {
                 var mapping = new VisualMapping({
                     type: 'color',
@@ -49,7 +49,7 @@ export default function (ecModel, payload) {
                     dataExtent: [minValue, maxValue],
                     visual: seriesModel.get('color')
                 });
-    
+
                 var mapValueToColor = mapping.mapValueToVisual(node.getLayout().value);
                 node.setVisual('color', mapValueToColor);
                 // If set itemStyle.normal.color
diff --git a/test/sankey-horizontal.html b/test/sankey-horizontal.html
index 0f8a295..d6716d8 100644
--- a/test/sankey-horizontal.html
+++ b/test/sankey-horizontal.html
@@ -44,75 +44,6 @@ under the License.
                     chart.resize();
                 };
 
-                // var data = {
-                //     nodes: [
-                //         {name: 'Brazil'},
-                //         {name: 'Canada'},
-                //         {name: 'Mexico'},
-                //         {name: 'USA'},
-                //         {name: 'Portugal'},
-                //         {name: 'France'},
-                //         {name: 'Spain'},
-                //         {name: 'England'},
-                //         {name: 'Angola'},
-                //         {name: 'Senegal'},
-                //         {name: 'Morocco'},
-                //         {name: 'South Africa'},
-                //         {name: 'Mali'},
-                //         {name: 'China'},
-                //         {name: 'India'},
-                //         {name: 'Japan'}
-                //     ],
-                //     links: [
-                //         {source: 'Brazil', target: 'Portugal', value: 5},
-                //         {source: 'Brazil', target: 'France', value: 1},
-                //         {source: 'Brazil', target: 'Spain', value: 1},
-                //         {source: 'Brazil', target: 'England', value: 1},
-                //         {source: 'Canada', target: 'Portugal', value: 1},
-                //         {source: 'Canada', target: 'France', value: 5},
-                //         {source: 'Canada', target: 'England', value: 1},
-                //         {source: 'Mexico', target: 'Portugal', value: 1},
-                //         {source: 'Mexico', target: 'France', value: 1},
-                //         {source: 'Mexico', target: 'Spain', value: 5},
-                //         {source: 'Mexico', target: 'England', value: 1},
-                //         {source: 'USA', target: 'Portugal', value: 1},
-                //         {source: 'USA', target: 'France', value: 1},
-                //         {source: 'USA', target: 'Spain', value: 1},
-                //         {source: 'USA', target: 'England', value: 5},
-                //         {source: 'Portugal', target: 'Angola', value: 2},
-                //         {source: 'Portugal', target: 'Senegal', value: 1},
-                //         {source:'Portugal', target: 'Morocco', value: 1},
-                //         {source: 'Portugal', target: 'South Africa', value: 3},
-                //         {source: 'France', target: 'Angola', value: 1},
-                //         {source: 'France', target: 'Senegal', value: 3},
-                //         {source: 'France', target: 'Mali', value: 3},
-                //         {source: 'France', target: 'Morocco', value: 3},
-                //         {source: 'France', target: 'South Africa', value: 1},
-                //         {source: 'Spain', target: 'Senegal', value: 1},
-                //         {source: 'Spain', target: 'Morocco', value: 3},
-                //         {source: 'Spain', target: 'South Africa', value: 1},
-                //         {source: 'England', target: 'Angola', value: 1},
-                //         {source: 'England', target: 'Senegal', value: 1},
-                //         {source: 'England', target: 'Morocco', value: 2},
-                //         {source: 'England', target: 'South Africa', value: 7},
-                //         {source: 'South Africa', target: 'China', value: 5},
-                //         {source: 'South Africa', target: 'India', value: 1},
-                //         {source: 'South Africa', target: 'Japan', value: 3},
-                //         {source: 'Angola', target: 'China', value: 5},
-                //         {source: 'Angola', target: 'India', value: 1},
-                //         {source: 'Angola', target: 'Japan', value: 3},
-                //         {source: 'Senegal', target: 'China', value: 5},
-                //         {source: 'Senegal', target: 'India', value: 1},
-                //         {source: 'Senegal', target: 'Japan', value: 3},
-                //         {source: 'Mali', target: 'China', value: 5},
-                //         {source: 'Mali', target: 'India', value: 1},
-                //         {source: 'Mali', target: 'Japan', value: 3},
-                //         {source: 'Morocco', target: 'China', value: 5},
-                //         {source: 'Morocco', target: 'India', value: 1},
-                //         {source: 'Morocco', target: 'Japan', value: 3}
-                //     ]
-                // };
-
                 var testData =  {
                     nodes: [
                         {
@@ -180,10 +111,9 @@ under the License.
                             type: 'sankey',
                             layout:'none',
                             bottom: '10%',
-                            // focusNodeAdjacency: 'allEdges',
+                            focusNodeAdjacency: true,
                             data: testData.nodes,
                             links: testData.links,
-                            orient: 'horizontal',
                             label: {
                                 position: 'left'
                             },
diff --git a/test/sankey.html b/test/sankey.html
index 118e5a6..961c8db 100644
--- a/test/sankey.html
+++ b/test/sankey.html
@@ -54,7 +54,6 @@ under the License.
                         console.log(params, params.data);
                     });
 
-
                     $.getJSON('./data/energy.json')
                     .done(function(data) {
 
@@ -73,7 +72,7 @@ under the License.
                                 {
                                     type: 'sankey',
                                     layout:'none',
-                                    focusNodeAdjacency: 'allEdges',
+                                    focusNodeAdjacency: true,
                                     data: data.nodes,
                                     links: data.links,
                                     lineStyle: {


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