将边锁定到 mxGraph 中的顶点

mat*_*ash 3 mxgraph

给定 javascript Hello World 示例 ( mxgraph/javascript/examples/helloworld.html):如果您单击并拖动边,它将移动,以便不再连接到顶点。我想修改helloworld.html,以便边缘无法与顶点解耦。我怎样才能做到这一点?

mat*_*ash 5

将以下代码放在 try-finally 块之前:

graph.setAllowDanglingEdges(false);
graph.setDisconnectOnMove(false);
Run Code Online (Sandbox Code Playgroud)

这在文档中进行了解释。