graph.op.js定义和提供对node和edge的添加和删除、折叠和伸展操作

来源:互联网 发布:net程序员是干嘛的 编辑:程序博客网 时间:2024/06/13 00:31


*/Graph.Op = {    options: {      type: 'nothing',      duration: 2000,      hideLabels: true,      fps:30    },        initialize: function(viz) {      this.viz = viz;    },  removeNode: function(node, opt) {}, //主要调用graph方法 viz.graph.removeNode(n[i]); removeEdge: function(vertex, opt) {},  //主要调用graph方法viz.graph.removeAdjacence(v[i][0], v[i][1]); sum: function(json, opt) {},  //Adds a new graph to the visualization.    /*Method: morph           This method will transform the current visualized graph into the new JSON representation passed in the method.        The JSON object must at least have the root node in common with the current visualized graph. */ morph: function(json, opt, extraModes) {},  /*    Method: contract     Collapses the subtree of the given node. The node will have a _collapsed=true_ property.*/   contract: function(node, opt) {},  /*    Method: expand     Expands the previously contracted subtree. The given node must have the _collapsed=true_ property. */   expand: function(node, opt) {},};




阅读全文
0 0