希望增加只读功能
Describe the feature you'd like to request
增加全局的只读模式
Describe the solution you'd like
影响数据的交互被禁止, 但画布可以拖动和缩放进行查看. 相关插件也要同步生效, 例如编辑类的快捷键被禁止, dnd被禁止.
Describe alternatives you've considered
目前通过控制挂载节点的 pointer-events: none 来解决, 但无法缩放和拖动画布
Your Example Website or App
No response
Screenshots or Videos
No response
👋 @hooozen
Thanks for opening your first issue here! If you're reporting a 🐞 bug, please make sure you include steps to reproduce it. To help make it easier for us to investigate your issue, please follow the contributing guidelines. We get a lot of issues on this repo, so please be patient and we will get back to you as soon as we can.
设置: interacting: false 本来就有这个功能不是
@weijiatan456 谢谢! 之前没有注意到这个配置项. 我理解这个配置只有在初始化 Graph 的时候才可以定义吧. 如果想动态的更改画布的可交互性有没有已有的方法呢.
@weijiatan456 谢谢!之前没有注意到这个配置项。我明白这个配置只有在初始化图的时候才可以定义吧。如果想动态的改变的可交互性没有现有的方法呢。
可以设置为一个函数, 比如下面这样,非编辑return false, 编辑return true
interacting: function () { if (!edit) { return false; } return true; },
@weijiatan456 谢谢!之前没有注意到这个配置项。我明白这个配置只有在初始化图的时候才可以定义吧。如果想动态的改变的可交互性没有现有的方法呢。
可以设置为一个函数, 比如下面这样,非编辑return false, 编辑return true
interacting: function () { if (!edit) { return false; } return true; },
成功
这样每次变化都要去初始化一次