Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

希望增加只读功能 #4282

Open
hooozen opened this issue Apr 26, 2024 · 5 comments
Open

希望增加只读功能 #4282

hooozen opened this issue Apr 26, 2024 · 5 comments

Comments

@hooozen
Copy link

hooozen commented Apr 26, 2024

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

@x6-bot
Copy link
Contributor

x6-bot bot commented Apr 26, 2024

👋 @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.

@weijiatan456
Copy link

设置: interacting: false
本来就有这个功能不是

@hooozen
Copy link
Author

hooozen commented Apr 26, 2024

@weijiatan456
谢谢! 之前没有注意到这个配置项. 我理解这个配置只有在初始化 Graph 的时候才可以定义吧. 如果想动态的更改画布的可交互性有没有已有的方法呢.

@xlz122
Copy link

xlz122 commented Apr 28, 2024

@weijiatan456 谢谢!之前没有注意到这个配置项。我明白这个配置只有在初始化图的时候才可以定义吧。如果想动态的改变的可交互性没有现有的方法呢。

可以设置为一个函数, 比如下面这样,非编辑return false, 编辑return true

interacting: function () {
if (!edit) {
return false;
}
return true;
},

@EziosWJ
Copy link

EziosWJ commented May 23, 2024

@weijiatan456 谢谢!之前没有注意到这个配置项。我明白这个配置只有在初始化图的时候才可以定义吧。如果想动态的改变的可交互性没有现有的方法呢。

可以设置为一个函数, 比如下面这样,非编辑return false, 编辑return true

interacting: function () { if (!edit) { return false; } return true; },

成功

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants