var BasePipe = require('../basePipe'),
util = require('util');
util.inherits(PathPipe, BasePipe);
function PathPipe(graph) {
if (!(this instanceof PathPipe)) {
return new PathPipe(graph);
}
this._graph = graph;
BasePipe.call(this);
}
PathPipe.prototype._moveNext = function () {
if (this._sourcePipe.moveNext()) {
this._current = this._sourcePipe.getCurrentPath();
return true;
}
return false;
};
Path Pipe
PathPipe allows clients to understand how traversal algorithm reached given node. It takes as a source any type of
BasePipe
child, and emits array of objects (vertices, edges, etc.) through which it went to reach final pointExample of traversal for Graph of Gods: