// 实例化graph对象
const graph = new mxGraph(container)
this.graph = graph
// 设置样式
let style = graph.getStylesheet().getDefaultEdgeStyle();
style[mxConstants.STYLE_ROUNDED] = true;
style[mxConstants.STYLE_EDGE] = mxEdgeStyle.ElbowConnector;
graph.alternateEdgeStyle = 'elbow=vertical';
// 模型开始
graph.getModel().beginUpdate();
try {
const v1 = graph.insertVertex(parent, null, 'Hello', 20, 20, 80, 30)
const v2 = graph.insertVertex(parent, null, 'World!', 200, 150, 80, 30)
const v3 = graph.insertVertex(parent, null, 'Node One!', 300, 150, 80, 30)
const e1 = graph.insertEdge(parent, null, '', v1, v2)
} finally {
graph.getModel().endUpdate()
}