echarts icon indicating copy to clipboard operation
echarts copied to clipboard

graph links的source和target有问题

Open feeee opened this issue 10 years ago • 3 comments

graph links的source和target有问题,现在source和target用的是node.data的数组key去连线的,而文档标的是graph.node 的 name,换成name后线出不来,建议用id来获取node。

建议src/data/Graph.js 129行改为:

    if (typeof n1 === 'number') {
        n1 = this.getNodeById(n1);
    }
    if (typeof n2 === 'number') {
        n2 = this.getNodeById(n2);
    }

feeee avatar May 31 '16 10:05 feeee

我刚提交了跟你相似的问题,才看到你的。用你的方式,直接解决了我的问题。

hbwhypw avatar May 31 '16 10:05 hbwhypw

name 和 数组 index 都是可以的,如果有 id 优先取 id

pissang avatar May 31 '16 10:05 pissang

image 看了源码,可以这么解决,把links里面的source/target全部换成字符串就oK了!

yinyihui avatar Jun 15 '17 03:06 yinyihui