View unanswered posts | View active topics It is currently 2021-12-05 18:49



Reply to topic  [ 2 posts ] 
 demo2样例里面的autoLayout多次点击布局会出现图消失 
Author Message
新手上路

Joined: 2020-03-04 16:25
Posts: 8
Post demo2样例里面的autoLayout多次点击布局会出现图消失
demo2/layout/AutoLayout.html

复现步骤,先点击round,再点击TopBottom,再点击BottomTop,图不居中且有时会超出可视范围


2021-03-23 12:03
Profile
TWaver开发组
User avatar

Joined: 2017-02-22 10:01
Posts: 485
Post Re: demo2样例里面的autoLayout多次点击布局会出现图消失
是布局完成之后没有overview的缘故,加上以下代码就可以了。
Code:
      autoLayouter.doLayout(evt.target.value,function(){
                     var callback = function(e) {
                      if (e.kind === 'validateEnd') {
                        network.removeViewListener(callback);
                        network.zoomOverview();
                      }
                    };
                    network.addViewListener(callback);
               });


2021-03-23 13:53
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 2 posts ] 

Who is online

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