View unanswered posts | View active topics It is currently 2019-12-10 5:37



Reply to topic  [ 3 posts ] 
 【求助】network.setLinkPathFunction后link的流动效果消失 
Author Message
新手上路

Joined: 2017-03-12 18:59
Posts: 6
Post 【求助】network.setLinkPathFunction后link的流动效果消失
如题,link流动效果单独设置可以成功, 但是配置network.setLinkPathFunction想画自定义曲线,流动就失效了。贴了部分代码跪求大神帮忙,代码都是从demo里头搬过来的用的,不知问题何在。

// 全局设置流动
topo_public.network.setLinkFlowEnabled(true);
topo_public.network.setLinkFlowInterval(1000);

//link的样式设置
this.s('link.width', _context.LINK_WIDTH);
this.s('link.color', _context.colorMap.green);
this.s('link.flow', true).s('link.flow.color', 'white');
this.s('link.pattern', [3, 10]

//setLinkPathFunction的回调
function(linkUI, defaultPoints){
var f = linkUI.getFromPoint();
var t = linkUI.getToPoint();
var to =t;
var from = f;
var points = new twaver.List();
points.add(from);
points.add(to);
var dx = Math.abs(from.x - to.x);
var dy = Math.abs(from.y - to.y);
var cps = new twaver.List();
if(to.y < from.y){
cps.add({x: from.x + 3*dx/5, y: from.y - dy/21});
cps.add({x: from.x + 2*dx/5, y: from.y - 19*dy/21});
cps.add(to);
}else{
cps.add({x: from.x + 3*dx/5, y: from.y + dy/21});
cps.add({x: from.x + 2*dx/5, y: from.y + 19*dy/21});
cps.add(to);
}
points.removeAt(1);
points.add(cps);
return points;
}


2017-03-17 16:20
Profile
TWaver开发组
User avatar

Joined: 2017-02-22 10:01
Posts: 400
Post Re: 【求助】network.setLinkPathFunction后link的流动效果消失
您好,现有产品只考虑了直线,其他暂时没考虑,属于产品的bug,我们已经记录了,等更新到产品里了会通知您。


2017-03-19 17:31
Profile
新手上路

Joined: 2019-08-15 13:58
Posts: 1
Post Re: 【求助】network.setLinkPathFunction后link的流动效果消失
你好,请问该bug解决了么?我现在使用流动效果的时候,一个控制点的link有流动效果,但2个控制点的却没有,请问这是为什么,有解决办法么?谢谢


2019-08-15 14:29
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 3 posts ] 

Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron