提交 ed636dd9 编写于 作者: S sushuang
......@@ -60,7 +60,6 @@ export default echarts.extendChartView({
// generate a bezire Curve for each edge
graph.eachEdge(function (edge) {
var curve = new SankeyShape();
curve.dataIndex = edge.dataIndex;
curve.seriesIndex = seriesModel.seriesIndex;
curve.dataType = 'edge';
......
......@@ -395,7 +395,7 @@ function ascendingDepth(a, b) {
}
function ascending(a, b) {
return a < b ? -1 : a > b ? 1 : a === b ? 0 : NaN;
return a - b;
}
function getEdgeValue(edge) {
......
......@@ -11,13 +11,18 @@ export default function (ecModel, payload) {
var graph = seriesModel.getGraph();
var nodes = graph.nodes;
if (nodes.length) {
nodes.sort(function (a, b) {
return a.getLayout().value - b.getLayout().value;
var minValue = Infinity;
var maxValue = -Infinity;
zrUtil.each(nodes, function (node) {
var nodeValue = node.getLayout().value;
if (nodeValue < minValue) {
minValue = nodeValue;
}
if (nodeValue > maxValue) {
maxValue = nodeValue;
}
});
var minValue = nodes[0].getLayout().value;
var maxValue = nodes[nodes.length - 1].getLayout().value;
zrUtil.each(nodes, function (node) {
var mapping = new VisualMapping({
type: 'color',
......
......@@ -119,6 +119,9 @@
},
{
name: 'c'
},
{
name: 'e'
}
],
links: [
......@@ -128,15 +131,10 @@
value: 5
},
{
source: 'a',
source: 'e',
target: 'b',
value: 3
},
{
source: 'b',
target: 'a',
value: 8
},
{
source: 'a',
target: 'b1',
......@@ -151,6 +149,11 @@
source: 'b1',
target: 'c',
value: 2
},
{
source: 'b',
target: 'c',
value: 1
}
]
};
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册