View unanswered posts | View active topics It is currently 2020-10-21 18:18



Reply to topic  [ 5 posts ] 
 convas高宽为0 
Author Message
新手上路

Joined: 2018-05-07 11:06
Posts: 8
Post convas高宽为0
在页面中的div中添加twaver的拓扑,页面空白,convas高宽都为0,但是node和link的tooltip可以显示。


2018-06-20 18:15
Profile
新手上路

Joined: 2018-05-07 11:06
Posts: 8
Post Re: convas高宽为0
litingyuki@163.com wrote:
在页面中的div中添加twaver的拓扑,页面空白,convas高宽都为0,但是node和link的tooltip可以显示。


2018-06-20 18:16
Profile
新手上路

Joined: 2018-05-07 11:06
Posts: 8
Post Re: convas高宽为0
代码是这样的:设置network与myDiv 吻合 但是调试发现 canvas宽高为0
demo.Util.appendChild(network.getView(), document.getElementById('myDiv'), 0, 0, 0, 0);
network.setTouchInteractions();//可以响应
network.setMovableFunction(function (element) { return false; });
window.onresize = function (e) { network.invalidate(); };


2018-06-20 18:19
Profile
TWaver开发组
User avatar

Joined: 2018-04-16 16:11
Posts: 164
Post Re: convas高宽为0
不是很明白您的问题,您可以稍微整理一下思路么?

正常情况下,canvas宽高为0,画在上面的东西肯定是不能显示出来的。


2018-06-22 19:16
Profile
TWaver开发组
User avatar

Joined: 2018-04-16 16:23
Posts: 11
Post Re: convas高宽为0
您好:
将画布添加到Dom中后,设置画布大小之后即可正常使用
network.adjustBounds({
x:0,
y:0,
width:800,
height:400
});


2018-06-23 0:52
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 5 posts ] 

Who is online

Users browsing this forum: No registered users and 17 guests


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: