Defines an abstract class for performing Graph Operations.
| Graph. | Defines an abstract class for performing Graph Operations. |
| Graph.Op | Generic Graph Operations. |
| Functions | |
| removeNode | Removes one or more Graph.Nodes from the visualization. |
| removeEdge | Removes one or more edges from the visualization. |
| sum | Adds a new graph to the visualization. |
| morph | This method will morph the current visualized graph into the new json representation passed in the method. |
Generic Graph Operations.
An abstract class holding unary and binary powerful graph operations such as removingNodes, removingEdges, adding two graphs and morphing.
Hypertree.Op, RGraph.Op and ST.Op.
The subclasses for this abstract class can be accessed by using the op property of the Hypertree, RGraph or ST instances created.
Hypertree.Op, RGraph.Op, ST.Op, Hypertree, RGraph, ST, Graph.
| Functions | |
| removeNode | Removes one or more Graph.Nodes from the visualization. |
| removeEdge | Removes one or more edges from the visualization. |
| sum | Adds a new graph to the visualization. |
| morph | This method will morph the current visualized graph into the new json representation passed in the method. |
removeNode: function( node, opt )
Removes one or more Graph.Nodes from the visualization. It can also perform several animations like fading sequentially, fading concurrently, iterating or replotting.
| node | The node’s id. Can also be an array having many ids. |
| opt | Animation options. It’s an object with optional properties |
var rg = new RGraph(canvas, config); //could be new ST or new Hypertree also.
rg.op.removeNode('nodeid', {
type: 'fade:seq',
duration: 1000,
hideLabels: false,
transition: Trans.Quart.easeOut
});
//or also
rg.op.removeNode(['someid', 'otherid'], {
type: 'fade:con',
duration: 1500
});
removeEdge: function( vertex, opt )
Removes one or more edges from the visualization. It can also perform several animations like fading sequentially, fading concurrently, iterating or replotting.
| vertex | An array having two strings which are the ids of the nodes connected by this edge (i.e [‘id1’, ‘id2’]). Can also be a two dimensional array holding many edges (i.e [[‘id1’, ‘id2’], [‘id3’, ‘id4’], ...]). |
| opt | Animation options. It’s an object with optional properties |
var rg = new RGraph(canvas, config); //could be new ST or new Hypertree also.
rg.op.removeEdge(['nodeid', 'otherid'], {
type: 'fade:seq',
duration: 1000,
hideLabels: false,
transition: Trans.Quart.easeOut
});
//or also
rg.op.removeEdge([['someid', 'otherid'], ['id3', 'id4']], {
type: 'fade:con',
duration: 1500
});
sum: function( json, opt )
Adds a new graph to the visualization.
The json graph (or tree) must at least have a common node with the current graph plotted by the visualization.
The resulting graph can be defined as follows http://mathworld.wolfram.com/GraphSum.html
| json | A json tree or graph structure. See also Loader.loadJSON. |
| opt | Animation options. It’s an object with optional properties |
//json contains a tree or graph structure.
var rg = new RGraph(canvas, config); //could be new ST or new Hypertree also.
rg.op.sum(json, {
type: 'fade:seq',
duration: 1000,
hideLabels: false,
transition: Trans.Quart.easeOut
});
//or also
rg.op.sum(json, {
type: 'fade:con',
duration: 1500
});
morph: function( json, opt )
This method will morph the current visualized graph into the new json representation passed in the method.
Can also perform multiple animations. The json object must at least have the root node in common with the current visualized graph.
| json | A json tree or graph structure. See also Loader.loadJSON. |
| opt | Animation options. It’s an object with optional properties |
//json contains a tree or graph structure.
var rg = new RGraph(canvas, config); //could be new ST or new Hypertree also.
rg.op.morph(json, {
type: 'fade',
duration: 1000,
hideLabels: false,
transition: Trans.Quart.easeOut
});
//or also
rg.op.morph(json, {
type: 'fade',
duration: 1500
});Removes one or more Graph.Nodes from the visualization.
removeNode: function( node, opt )
Removes one or more edges from the visualization.
removeEdge: function( vertex, opt )
Adds a new graph to the visualization.
sum: function( json, opt )
This method will morph the current visualized graph into the new json representation passed in the method.
morph: function( json, opt )
Loads a JSON structure to the visualization.
loadJSON: function( json, i )