Github上提交Issue有点麻烦,先记在这
在帮助文档中,updateLayout函数只有一个参数
但查阅Github源码后发现,updateLayout函数的调用操作会入栈,实际上这个函数有四个参数,源码链接
操作栈的使用涉及toolbar,后面再补
但是!!!就算传入stack参数也无法组织操作入栈
我也不知道什么原因,反正试了几种传参方法都不行(但没试过用Typescript)
最后参考源码,用以下写法更新布局
graphUpdateLayout() {
graph.get('layoutController').updateLayoutCfg({
linkDistance: 100,
nodeSpacing: 20,
nodeStrength: -100,
});
}
直接调用layoutController的updateLayoutCfg就不会入栈