Q.Consts.INTERACTION_MODE_CREATE_SIMPLE_EDGE = "create.simple.edge"; Q.Consts.INTERACTION_MODE_CREATE_EDGE = "create.edge"; Q.Consts.INTERACTION_MODE_CREATE_SHAPE = "create.shape"; Q.Consts.INTERACTION_MODE_CREATE_LINE = "create.line";可以直接从一个节点拖拽连接到另一个节点,也可以创建中间拐点的连线
graph.interactionMode = Q.Consts.INTERACTION_MODE_CREATE_EDGE;
graph.editable = true; graph.interactionMode = Q.Consts.INTERACTION_MODE_DEFAULT;
graph.interactionMode = Q.Consts.INTERACTION_MODE_CREATE_SHAPE;
graph.interactionMode = Q.Consts.INTERACTION_MODE_CREATE_LINE;
graph.editable = true; graph.interactionMode = Q.Consts.INTERACTION_MODE_DEFAULT;
graph.html.oncontextmenu = function(evt){
Q.stopEvent(evt);
showMenu(evt, graph);
}
graph.addCustomInteraction({
onstart: function (evt) {
menu.hide();
}
});

原文:http://my.oschina.net/nosand/blog/308609