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/05/02 11:39:43 UTC

[incubator-echarts] branch dev updated (39f90fc -> ef25a6b)

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

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


    from 39f90fc  tweak example.
     new f1fbe38  Merge remote-tracking branch 'origin/dev'
     add 5f8163c  tweak license.
     add 0ba8769  4.1.0.rc2
     new 7991282  Merge branch 'master' of https://github.com/apache/incubator-echarts
     new 7729afc  Merge remote-tracking branch 'origin/dev'
     new 54947c8  add focus node adjacency for sankey view
     new ef25a6b  update the focus node adjacency interactive

The 5 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:
 LICENSE                                  |  51 ++++-
 build/addHeader.js                       |  21 +--
 build/preamble.js                        |   1 +
 dist/echarts-en.common.js                |   8 +-
 dist/echarts-en.common.min.js            |   1 +
 dist/echarts-en.js                       |  40 +++-
 dist/echarts-en.js.map                   |   2 +-
 dist/echarts-en.min.js                   |   1 +
 dist/echarts-en.simple.js                |   8 +-
 dist/echarts-en.simple.min.js            |   1 +
 dist/echarts.common.js                   |   8 +-
 dist/echarts.common.min.js               |   1 +
 dist/echarts.js                          |  40 +++-
 dist/echarts.js.map                      |   2 +-
 dist/echarts.min.js                      |   1 +
 dist/echarts.simple.js                   |   8 +-
 dist/echarts.simple.min.js               |   1 +
 dist/extension/bmap.min.js               |   1 +
 dist/extension/dataTool.min.js           |   1 +
 index.common.js                          |   1 +
 index.js                                 |   1 +
 index.simple.js                          |   1 +
 src/chart/graph/GraphView.js             |   2 +-
 src/chart/graph/graphAction.js           |   2 +-
 src/chart/sankey/SankeySeries.js         |   2 +
 src/chart/sankey/SankeyView.js           | 162 +++++++++++++++-
 src/chart/sankey/sankeyAction.js         |   6 +
 src/chart/themeRiver/themeRiverVisual.js |   2 +-
 src/chart/tree/TreeSeries.js             |   1 +
 src/chart/tree/TreeView.js               |   1 +
 test/sankey-test.html                    | 314 +++++++++++++++----------------
 test/sankey.html                         |   1 +
 32 files changed, 483 insertions(+), 210 deletions(-)

-- 
To stop receiving notification emails like this one, please contact
deqingli@apache.org.

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


[incubator-echarts] 05/05: update the focus node adjacency interactive

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

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

commit ef25a6b3bf4c7ddf886128a8bb24c26aec7a4b54
Author: deqingli <an...@gmail.com>
AuthorDate: Wed May 2 19:16:22 2018 +0800

    update the focus node adjacency interactive
---
 src/chart/sankey/SankeyView.js |  10 +-
 test/sankey-test.html          | 317 ++++++++++++++++++++---------------------
 test/sankey.html               |   1 +
 3 files changed, 160 insertions(+), 168 deletions(-)

diff --git a/src/chart/sankey/SankeyView.js b/src/chart/sankey/SankeyView.js
index 5068f31..3bfcf75 100644
--- a/src/chart/sankey/SankeyView.js
+++ b/src/chart/sankey/SankeyView.js
@@ -294,7 +294,7 @@ export default echarts.extendChartView({
         var itemModel = data.getItemModel(dataIndex);
         var edgeDataIndex = payload.edgeDataIndex;
         
-        if (!dataIndex && !edgeDataIndex) {
+        if (dataIndex == null && edgeDataIndex == null) {
             return;
         }
         var node = graph.getNodeByIndex(dataIndex);
@@ -309,8 +309,8 @@ export default echarts.extendChartView({
 
         if (node) {
             fadeInItem(node, nodeOpacityPath);
-            var focusNodeAdjacency = itemModel.get('focusNodeAdjacency');
-            if (focusNodeAdjacency === 'outEdges') {
+            var focusNodeAdj = itemModel.get('focusNodeAdjacency');
+            if (focusNodeAdj === 'outEdges') {
                 zrUtil.each(node.outEdges, function (edge) {
                     if (edge.dataIndex < 0) {
                         return;
@@ -319,7 +319,7 @@ export default echarts.extendChartView({
                     fadeInItem(edge.node2, nodeOpacityPath);
                 });
             }
-            else if (focusNodeAdjacency === 'inEdges') {
+            else if (focusNodeAdj === 'inEdges') {
                 zrUtil.each(node.inEdges, function (edge) {
                     if (edge.dataIndex < 0) {
                         return;
@@ -328,7 +328,7 @@ export default echarts.extendChartView({
                     fadeInItem(edge.node1, nodeOpacityPath);
                 });
             }
-            else if (focusNodeAdjacency === 'allEdges') {
+            else if (focusNodeAdj === 'allEdges') {
                 zrUtil.each(node.edges, function (edge) {
                     if (edge.dataIndex < 0) {
                         return;
diff --git a/test/sankey-test.html b/test/sankey-test.html
index f7df01c..336c70b 100644
--- a/test/sankey-test.html
+++ b/test/sankey-test.html
@@ -16,178 +16,169 @@
         </style>
         <div id="main"><div>
         <script>
-            require([
-                'echarts'
-                // 'echarts/chart/sankey',
-                // 'echarts/component/tooltip'
-                ], function (echarts) {
+            require(['echarts'], function (echarts) {
 
-                    var chart = echarts.init(document.getElementById('main'), null, {
+                var chart = echarts.init(document.getElementById('main'), null, {});
 
-                    });
+                window.onresize = function () {
+                    chart.resize();
+                };
 
-                    window.onresize = function () {
-                        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}
+                //     ]
+                // };
 
-                    // chart.on('click', function (params) {
-                    //     console.log(params, params.data);
-                    // });
-
-                    // 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: [
+                        {
+                            name: 'a'
+                        }, 
+                        {
+                            name: 'b'
+                        },
+                        {
+                            name: 'a1'
+                        },
+                        {
+                            name: 'b1'
+                        },
+                        {
+                            name: 'c'
+                        },
+                        {
+                            name: 'e'
+                        }
+                    ],
+                    links: [
+                        {
+                            source: 'a',
+                            target: 'a1',
+                            value: 5
+                        },
+                        {
+                            source: 'e',
+                            target: 'b',
+                            value: 3
+                        },
+                        {
+                            source: 'a',
+                            target: 'b1',
+                            value: 3
+                        },
+                        {
+                            source: 'b1',
+                            target: 'a1',
+                            value: 1
+                        }, 
+                        {
+                            source: 'b1',
+                            target: 'c',
+                            value: 2
+                        },
+                        {
+                            source: 'b',
+                            target: 'c',
+                            value: 1
+                        }
+                    ]
+                };
 
-                    var testData =  {
-                        nodes: [
-                            {
-                                name: 'a'
-                            }, 
-                            {
-                                name: 'b'
-                            },
-                            {
-                                name: 'a1'
+                chart.setOption({
+                    color: ['#67001f', '#b2182b', '#d6604d', '#f4a582', '#fddbc7', '#d1e5f0', '#92c5de', '#4393c3', '#2166ac', '#053061'],
+                    tooltip: {
+                        trigger: 'item',
+                        triggerOn: 'mousemove'
+                    },
+                    animation: false,
+                    series: [
+                        {
+                            type: 'sankey',
+                            layout:'none',
+                            bottom: '10%',
+                            // focusNodeAdjacency: 'allEdges',
+                            data: testData.nodes,
+                            links: testData.links,
+                            label: {
+                                position: 'left'
                             },
-                            {
-                                name: 'b1'
-                            },
-                            {
-                                name: 'c'
-                            },
-                            {
-                                name: 'e'
-                            }
-                        ],
-                        links: [
-                            {
-                                source: 'a',
-                                target: 'a1',
-                                value: 5
-                            },
-                            {
-                                source: 'e',
-                                target: 'b',
-                                value: 3
-                            },
-                            {
-                                source: 'a',
-                                target: 'b1',
-                                value: 3
-                            },
-                            {
-                                source: 'b1',
-                                target: 'a1',
-                                value: 1
-                            }, 
-                            {
-                                source: 'b1',
-                                target: 'c',
-                                value: 2
-                            },
-                            {
-                                source: 'b',
-                                target: 'c',
-                                value: 1
-                            }
-                        ]
-                    };
-
-                    chart.setOption({
-                        color: ['#67001f', '#b2182b', '#d6604d', '#f4a582', '#fddbc7', '#d1e5f0', '#92c5de', '#4393c3', '#2166ac', '#053061'],
-                        tooltip: {
-                            trigger: 'item',
-                            triggerOn: 'mousemove'
-                        },
-                        animation: false,
-                        series: [
-                            {
-                                type: 'sankey',
-                                layout:'none',
-                                bottom: '10%',
-                                data: testData.nodes,
-                                links: testData.links,
-                                label: {
-                                    position: 'left'
-                                },
-                                // Used to test when the data is null whether it is work well. 
-                                // data: [],
-                                // links: [],
-                                lineStyle: {
-                                    normal: {
-                                        color: 'source',
-                                        curveness: 0.5
-                                    }
+                            // Used to test when the data is null whether it is work well. 
+                            // data: [],
+                            // links: [],
+                            lineStyle: {
+                                normal: {
+                                    color: 'source',
+                                    curveness: 0.5
                                 }
                             }
-                        ]
-                    });
+                        }
+                    ]
                 });
+            });
         </script>
     </body>
 </html>
\ No newline at end of file
diff --git a/test/sankey.html b/test/sankey.html
index d8dec76..a2f7332 100644
--- a/test/sankey.html
+++ b/test/sankey.html
@@ -53,6 +53,7 @@
                                 {
                                     type: 'sankey',
                                     layout:'none',
+                                    focusNodeAdjacency: 'allEdges',
                                     data: data.nodes,
                                     links: data.links,
                                     lineStyle: {

-- 
To stop receiving notification emails like this one, please contact
deqingli@apache.org.

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


[incubator-echarts] 02/05: Merge branch 'master' of https://github.com/apache/incubator-echarts

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

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

commit 7991282ce2db096657c7c0fdc251d9cc0f4c7e8f
Merge: f1fbe38 0ba8769
Author: deqingli <an...@gmail.com>
AuthorDate: Wed May 2 17:12:16 2018 +0800

    Merge branch 'master' of https://github.com/apache/incubator-echarts

 DISCLAIMER                              |  12 +
 LICENSE                                 |  53 ++++-
 build/addHeader.js                      |  21 +-
 build/preamble.js                       |   1 +
 dist/echarts-en.common.js               | 243 +++++++++++---------
 dist/echarts-en.common.min.js           |   3 +-
 dist/echarts-en.js                      | 286 ++++++++++++++---------
 dist/echarts-en.js.map                  |   2 +-
 dist/echarts-en.min.js                  |   3 +-
 dist/echarts-en.simple.js               | 238 ++++++++++---------
 dist/echarts-en.simple.min.js           |   3 +-
 dist/echarts.common.js                  | 243 +++++++++++---------
 dist/echarts.common.min.js              |   3 +-
 dist/echarts.js                         | 286 ++++++++++++++---------
 dist/echarts.js.map                     |   2 +-
 dist/echarts.min.js                     |   3 +-
 dist/echarts.simple.js                  | 238 ++++++++++---------
 dist/echarts.simple.min.js              |   3 +-
 dist/extension/bmap.min.js              |   1 +
 dist/extension/dataTool.min.js          |   1 +
 index.common.js                         |   1 +
 index.js                                |   1 +
 index.simple.js                         |   1 +
 src/chart/graph/forceHelper.js          |   7 +
 src/chart/line/helper.js                |   4 +-
 src/chart/line/poly.js                  |  84 +++----
 src/chart/tree/layoutHelper.js          |   7 +
 src/chart/treemap/treemapLayout.js      |  11 +-
 src/component/axis/CartesianAxisView.js |   5 +-
 src/component/marker/markerHelper.js    |   2 +-
 src/coord/Axis.js                       |   5 +-
 src/coord/axisTickLabelBuilder.js       |  85 ++++---
 src/coord/cartesian/Grid.js             |   8 +-
 src/coord/polar/polarCreator.js         |  10 +-
 src/data/helper/dataStackHelper.js      |  36 ++-
 src/helper.js                           |   9 +-
 src/layout/barGrid.js                   |   2 +-
 src/layout/barPolar.js                  |   2 +-
 src/layout/points.js                    |   4 +-
 src/scale/Time.js                       |   8 +-
 src/util/array/nest.js                  |   7 +
 test/area-stack.html                    | 370 +++++++++++++++++++++++++++++-
 test/axis-interval2.html                | 112 +++++++++
 test/smooth.html                        | 391 ++++++++++++++++++++++++++++++--
 44 files changed, 1989 insertions(+), 828 deletions(-)

-- 
To stop receiving notification emails like this one, please contact
deqingli@apache.org.

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


[incubator-echarts] 04/05: add focus node adjacency for sankey view

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

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

commit 54947c80e694ec36d398f8da29515f3d62699c38
Author: deqingli <an...@gmail.com>
AuthorDate: Wed May 2 17:25:09 2018 +0800

    add focus node adjacency for sankey view
---
 src/chart/graph/GraphView.js             |   2 +-
 src/chart/graph/graphAction.js           |   2 +-
 src/chart/sankey/SankeySeries.js         |   2 +
 src/chart/sankey/SankeyView.js           | 162 +++++++++++++++++++++++++++++--
 src/chart/sankey/sankeyAction.js         |   6 ++
 src/chart/themeRiver/themeRiverVisual.js |   2 +-
 src/chart/tree/TreeSeries.js             |   1 +
 src/chart/tree/TreeView.js               |   1 +
 test/sankey-test.html                    |   3 +
 9 files changed, 169 insertions(+), 12 deletions(-)

diff --git a/src/chart/graph/GraphView.js b/src/chart/graph/GraphView.js
index c0a7a59..ceb64a5 100644
--- a/src/chart/graph/GraphView.js
+++ b/src/chart/graph/GraphView.js
@@ -132,7 +132,7 @@ export default echarts.extendChartView({
             var itemModel = data.getItemModel(idx);
             // Update draggable
             el.off('drag').off('dragend');
-            var draggable = data.getItemModel(idx).get('draggable');
+            var draggable = itemModel.get('draggable');
             if (draggable) {
                 el.on('drag', function () {
                     if (forceLayout) {
diff --git a/src/chart/graph/graphAction.js b/src/chart/graph/graphAction.js
index ee62c2e..6f7bc13 100644
--- a/src/chart/graph/graphAction.js
+++ b/src/chart/graph/graphAction.js
@@ -19,7 +19,7 @@
 
 import * as echarts from '../../echarts';
 import {updateCenterAndZoom} from '../../action/roamHelper';
-import '../focusNodeAdjacencyAction';
+import '../helper/focusNodeAdjacencyAction';
 
 var actionInfo = {
     type: 'graphRoam',
diff --git a/src/chart/sankey/SankeySeries.js b/src/chart/sankey/SankeySeries.js
index 1835c09..f1f0339 100644
--- a/src/chart/sankey/SankeySeries.js
+++ b/src/chart/sankey/SankeySeries.js
@@ -112,6 +112,8 @@ var SankeySeries = SeriesModel.extend({
         // control if the node can move or not
         draggable: true,
 
+        focusNodeAdjacency: 'outEdges',
+
         // the number of iterations to change the position of the node
         layoutIterations: 32,
 
diff --git a/src/chart/sankey/SankeyView.js b/src/chart/sankey/SankeyView.js
index 180f491..5068f31 100644
--- a/src/chart/sankey/SankeyView.js
+++ b/src/chart/sankey/SankeyView.js
@@ -24,6 +24,43 @@
 
 import * as graphic from '../../util/graphic';
 import * as echarts from '../../echarts';
+import * as zrUtil from 'zrender/src/core/util';
+
+var nodeOpacityPath = ['itemStyle', 'opacity'];
+var lineOpacityPath = ['lineStyle', 'opacity'];
+
+function getItemOpacity(item, opacityPath) {
+    return item.getVisual('opacity') || item.getModel().get(opacityPath);
+}
+
+function fadeOutItem(item, opacityPath, opacityRatio) {
+    var el = item.getGraphicEl();
+
+    var opacity = getItemOpacity(item, opacityPath);
+    if (opacityRatio != null) {
+        opacity == null && (opacity = 1);
+        opacity *= opacityRatio;
+    }
+
+    el.downplay && el.downplay();
+    el.traverse(function (child) {
+        if (child.type !== 'group') {
+            child.setStyle('opacity', opacity);
+        }
+    });
+}
+
+function fadeInItem(item, opacityPath) {
+    var opacity = getItemOpacity(item, opacityPath);
+    var el = item.getGraphicEl();
+
+    el.highlight && el.highlight();
+    el.traverse(function (child) {
+        if (child.type !== 'group') {
+            child.setStyle('opacity', opacity);
+        }
+    });
+}
 
 var SankeyShape = graphic.extendShape({
     shape: {
@@ -180,10 +217,11 @@ export default echarts.extendChartView({
 
             rect.dataType = 'node';
         });
-
-        var draggable = seriesModel.get('draggable');
-        if (draggable) {
-            nodeData.eachItemGraphicEl(function (el, dataIndex) {
+       
+        nodeData.eachItemGraphicEl(function (el, dataIndex) {
+            var itemModel = nodeData.getItemModel(dataIndex);
+            // var draggable = seriesModel.get('draggable');
+            if (itemModel.get('draggable')) {
                 el.drift = function (dx, dy) {
                     this.shape.x += dx;
                     this.shape.y += dy;
@@ -199,9 +237,45 @@ export default echarts.extendChartView({
         
                 el.draggable = true;
                 el.cursor = 'move';
-            });
-        }
-        
+
+            }
+            
+            if (itemModel.get('focusNodeAdjacency')) {
+                el.off('mouseover').on('mouseover', function () {
+                    api.dispatchAction({
+                        type: 'focusNodeAdjacency',
+                        seriesId: seriesModel.id,
+                        dataIndex: el.dataIndex
+                    });
+                });
+                el.off('mouseout').on('mouseout', function () {
+                    api.dispatchAction({
+                        type: 'unfocusNodeAdjacency',
+                        seriesId: seriesModel.id
+                    })
+                });
+            }
+        });
+
+        edgeData.eachItemGraphicEl(function (el, dataIndex) {
+            var edgeModel = edgeData.getItemModel(dataIndex);
+            if (edgeModel.get('focusNodeAdjacency')) {
+                el.off('mouseover').on('mouseover', function () {
+                    api.dispatchAction({
+                        type: 'focusNodeAdjacency',
+                        seriesId: seriesModel.id,
+                        edgeDataIndex: el.dataIndex
+                    });
+                });
+                el.off('mouseout').on('mouseout', function () {
+                    api.dispatchAction({
+                        type: 'unfocusNodeAdjacency',
+                        seriesId: seriesModel.id,
+                    });
+                })
+            }
+        });
+
         if (!this._data && seriesModel.get('animation')) {
             group.setClipPath(createGridClipShape(group.getBoundingRect(), seriesModel, function () {
                 group.removeClipPath();
@@ -211,7 +285,77 @@ export default echarts.extendChartView({
         this._data = seriesModel.getData();
     },
 
-    dispose: function () {}
+    dispose: function () {},
+
+    focusNodeAdjacency: function (seriesModel, ecModel, api, payload) {
+        var data = this._model.getData();
+        var graph = data.graph;
+        var dataIndex = payload.dataIndex;
+        var itemModel = data.getItemModel(dataIndex);
+        var edgeDataIndex = payload.edgeDataIndex;
+        
+        if (!dataIndex && !edgeDataIndex) {
+            return;
+        }
+        var node = graph.getNodeByIndex(dataIndex);
+        var edge = graph.getEdgeByIndex(edgeDataIndex);
+
+        graph.eachNode(function (node) {
+            fadeOutItem(node, nodeOpacityPath, 0.1);
+        });
+        graph.eachEdge(function (edge) {
+            fadeOutItem(edge, lineOpacityPath, 0.1);
+        });
+
+        if (node) {
+            fadeInItem(node, nodeOpacityPath);
+            var focusNodeAdjacency = itemModel.get('focusNodeAdjacency');
+            if (focusNodeAdjacency === 'outEdges') {
+                zrUtil.each(node.outEdges, function (edge) {
+                    if (edge.dataIndex < 0) {
+                        return;
+                    }
+                    fadeInItem(edge, lineOpacityPath);
+                    fadeInItem(edge.node2, nodeOpacityPath);
+                });
+            }
+            else if (focusNodeAdjacency === 'inEdges') {
+                zrUtil.each(node.inEdges, function (edge) {
+                    if (edge.dataIndex < 0) {
+                        return;
+                    }
+                    fadeInItem(edge, lineOpacityPath);
+                    fadeInItem(edge.node1, nodeOpacityPath);
+                });
+            }
+            else if (focusNodeAdjacency === 'allEdges') {
+                zrUtil.each(node.edges, function (edge) {
+                    if (edge.dataIndex < 0) {
+                        return;
+                    }
+                    fadeInItem(edge, lineOpacityPath);
+                    fadeInItem(edge.node1, nodeOpacityPath);
+                    fadeInItem(edge.node2, nodeOpacityPath);
+                });
+            }
+        }
+        if (edge) {
+            fadeInItem(edge, lineOpacityPath);
+            fadeInItem(edge.node1, nodeOpacityPath);
+            fadeInItem(edge.node2, nodeOpacityPath);
+        }
+    },
+
+    unfocusNodeAdjacency: function (seriesModel, ecModel, api, payload) {
+        var graph = this._model.getGraph();
+
+        graph.eachNode(function (node) {
+            fadeOutItem(node, nodeOpacityPath);
+        });
+        graph.eachEdge(function (edge) {
+            fadeOutItem(edge, lineOpacityPath);
+        });
+    }
 });
 
 // add animation to the view
@@ -232,4 +376,4 @@ function createGridClipShape(rect, seriesModel, cb) {
     }, seriesModel, cb);
 
     return rectEl;
-}
\ No newline at end of file
+}
diff --git a/src/chart/sankey/sankeyAction.js b/src/chart/sankey/sankeyAction.js
index 8683eec..5a0ad64 100644
--- a/src/chart/sankey/sankeyAction.js
+++ b/src/chart/sankey/sankeyAction.js
@@ -17,7 +17,13 @@
 * under the License.
 */
 
+/**
+ * @file The interactive action of sankey view
+ * @author Deqing Li(annong035@gmail.com)
+ */
+
 import * as echarts from '../../echarts';
+import '../helper/focusNodeAdjacencyAction';
 
 echarts.registerAction({
     type: 'dragNode',
diff --git a/src/chart/themeRiver/themeRiverVisual.js b/src/chart/themeRiver/themeRiverVisual.js
index 13da281..78d8394 100644
--- a/src/chart/themeRiver/themeRiverVisual.js
+++ b/src/chart/themeRiver/themeRiverVisual.js
@@ -19,7 +19,7 @@
 
 /**
  * @file Visual encoding for themeRiver view
- * @author  Deqing Li(annong035@gmail.com)
+ * @author Deqing Li(annong035@gmail.com)
  */
 
 import {createHashMap} from 'zrender/src/core/util';
diff --git a/src/chart/tree/TreeSeries.js b/src/chart/tree/TreeSeries.js
index 635a7b0..8d632a1 100644
--- a/src/chart/tree/TreeSeries.js
+++ b/src/chart/tree/TreeSeries.js
@@ -19,6 +19,7 @@
 
 /**
  * @file Create data struct and define tree view's series model
+ * @author Deqing Li(annong035@gmail.com)
  */
 
 import SeriesModel from '../../model/Series';
diff --git a/src/chart/tree/TreeView.js b/src/chart/tree/TreeView.js
index 483e41b..247813a 100644
--- a/src/chart/tree/TreeView.js
+++ b/src/chart/tree/TreeView.js
@@ -19,6 +19,7 @@
 
 /**
  * @file  This file used to draw tree view
+ * @author Deqing Li(annong035@gmail.com)
  */
 
 import * as zrUtil from 'zrender/src/core/util';
diff --git a/test/sankey-test.html b/test/sankey-test.html
index a609d96..f7df01c 100644
--- a/test/sankey-test.html
+++ b/test/sankey-test.html
@@ -172,6 +172,9 @@
                                 bottom: '10%',
                                 data: testData.nodes,
                                 links: testData.links,
+                                label: {
+                                    position: 'left'
+                                },
                                 // Used to test when the data is null whether it is work well. 
                                 // data: [],
                                 // links: [],

-- 
To stop receiving notification emails like this one, please contact
deqingli@apache.org.

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


[incubator-echarts] 03/05: Merge remote-tracking branch 'origin/dev'

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

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

commit 7729afcdb0143f573bf80b28e66ee5599e2d5002
Merge: 7991282 39f90fc
Author: deqingli <an...@gmail.com>
AuthorDate: Wed May 2 17:14:11 2018 +0800

    Merge remote-tracking branch 'origin/dev'

 test/geoScatter.html  |  11 +-
 test/touch-slide.html | 509 ++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 516 insertions(+), 4 deletions(-)

-- 
To stop receiving notification emails like this one, please contact
deqingli@apache.org.

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


[incubator-echarts] 01/05: Merge remote-tracking branch 'origin/dev'

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

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

commit f1fbe388dc1f6d9e02cd9b9989ee1787d37e637a
Merge: 66f6e07 646dec6
Author: deqingli <an...@gmail.com>
AuthorDate: Thu Apr 26 20:03:12 2018 +0800

    Merge remote-tracking branch 'origin/dev'

 src/chart/graph/graphAction.js                     | 26 +---------------
 .../focusNodeAdjacencyAction.js}                   | 35 ++--------------------
 2 files changed, 3 insertions(+), 58 deletions(-)

-- 
To stop receiving notification emails like this one, please contact
deqingli@apache.org.

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