Graphology Operators
Miscellaneous operators to be used with graphology
.
Installation
npm install graphology-operators
Usage
Unary
Binary
reverse
Reverse the given graph's directed edges.
import {reverse} from 'graphology-operators';
import reverse from 'graphology-operators/reverse';
const reversedGraph = reverse(graph);
Arguments
- graph Graph: target graph.
union
Returns the union of the given graphs. Nodes & edges present in both graph will have their attributes merges with precedence given to the second graph.
import {union} from 'graphology-operators';
import union from 'graphology-operators/union';
const R = union(G, H);
Arguments
- G Graph: first graph.
- H Graph: second graph.