interacting后为判断方法
const graph =new Graph({
container: document.getElementById('container'),
interacting: function (cellView) {
if (cellView.cell.getData() != undefined && !cellView.cell.getData().disableMove) {
return { nodeMovable: false }
}
return true
},
})
添加节点的时候添加属性data,disableMove 为true可拖拽,false不可拖拽
graph.createNode({
id : 'node',
x : 20,
y : -65,
width: 120,
height: 60,
data: {
disableMove: false,//true为可拖拽,false不可拖拽
},
})