X6 icon indicating copy to clipboard operation
X6 copied to clipboard

希望增加只读功能

Open hooozen opened this issue 1 year ago • 6 comments

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 avatar Apr 26 '24 02:04 hooozen

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

x6-bot[bot] avatar Apr 26 '24 02:04 x6-bot[bot]

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

weijiatan456 avatar Apr 26 '24 07:04 weijiatan456

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

hooozen avatar Apr 26 '24 09:04 hooozen

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

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

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

xlz122 avatar Apr 28 '24 08:04 xlz122

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

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

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

成功

EziosWJ avatar May 23 '24 03:05 EziosWJ

这样每次变化都要去初始化一次

mxluomx avatar Jul 10 '24 07:07 mxluomx