View unanswered posts | View active topics It is currently 2022-07-06 9:37



Reply to topic  [ 3 posts ] 
 画布根据拓扑节点个数自动缩放 
Author Message
新手上路

Joined: 2020-09-03 16:44
Posts: 4
Post 画布根据拓扑节点个数自动缩放
一行设置10个节点,超过10个后换行,节点多的时候画布高度很大,请问画布能否根据节点自动缩放节点,最终能在一屏中把所有节点展示


2021-10-26 9:26
Profile
TWaver开发组
User avatar

Joined: 2017-02-22 10:01
Posts: 487
Post Re: 画布根据拓扑节点个数自动缩放
试试:
Code:
var callback = function (e) {
          if (e.kind === 'validateEnd') {
            network.removeViewListener(callback);
            network.zoomOverview();
          }
        };
        network.addViewListener(callback);


2021-10-28 9:20
Profile
新手上路

Joined: 2020-09-03 16:44
Posts: 4
Post Re: 画布根据拓扑节点个数自动缩放
Paddy wrote:
试试:
Code:
var callback = function (e) {
          if (e.kind === 'validateEnd') {
            network.removeViewListener(callback);
            network.zoomOverview();
          }
        };
        network.addViewListener(callback);



好用,多谢多谢


2021-11-01 17:26
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 3 posts ] 

Who is online

Users browsing this forum: No registered users and 10 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: