function pvVertex(obj, g) {
    this.id = obj.id;
    this.vertex = obj.vertex;

    // strip out the actual edge objects
    this.outEdges = _.map(obj.outEdges, function(d) { return d.id; });
    this._g = g;
}

pvVertex.prototype.isVertex = function() {
    return true;
};

function pvEdge(obj, g) {
    _.assign(this, obj);
    this._g = g;
}

pvEdge.prototype.isVertex = function() {
    return false;
};

// TODO this pretty much mirrors what we have serverside...for now. ugh.
// pipeviz datastore
function pvGraph(gdata) {
    // contains all objects, vertices and edges, keyed by objid
    this._objects = {};

    var that = this;
    var o = this._objects;
    _.each(gdata, function(d) {
        // capture vertex
        o[d.id] = new pvVertex(d, that);
        // and its out-edges
        _.each(d.outEdges, function(d2) { o[d2.id] = new pvEdge(d2, that); });
    });
}

pvGraph.prototype.get = function(id) {
    return this._objects[id];
};

pvGraph.prototype.verticesWithType = function(typ) {
    return _.filter(this._objects, function(d) {
        return  d.isVertex() && d.vertex.type === typ;
    });
};

@@ -270,16 +270,87 @@
 ue;%0A%7D;%0A%0A
+pvVertex.prototype.Typ = function() %7B%0A    return this.vertex.type;%0A%7D;%0A%0A
 function
@@ -475,16 +475,79 @@
 se;%0A%7D;%0A%0A
+pvEdge.prototype.Typ = function() %7B%0A    return this.etype;%0A%7D;%0A%0A
 // TODO 
@@ -1251,11 +1251,891 @@
     %7D);%0A
-
 %7D;%0A
+%0Avar filters = %7B%0A    vertices: function(d) %7B%0A        return d.isVertex();%0A    %7D,%0A    edges: function(d) %7B%0A        return !d.isVertex();%0A    %7D%0A%7D;%0A%0Avar isType = function(typ) %7B%0A    return function(d) %7B%0A        return typ === d.Typ();%0A    %7D;%0A%7D;%0A%0A// Returns a graphlib.Graph object representing the graph(s) of all known%0A// commit objects.%0ApvGraph.prototype.commitGraph = function() %7B%0A    var g = new graphlib.Graph();%0A    var that = this;%0A%0A    //_.each(_.filter(this._objects, filters.vertices), function(vertex) %7B%0A    _.each(_.filter(this._objects, function(d) %7B return filters.vertices(d) && isType(%22commit%22)(d); %7D), function(commit) %7B%0A        g.setNode(commit.id);%0A        _.each(_.filter(_.map(commit.outEdges, function(edgeId) %7B return that.get(edgeId); %7D), isType(%22version%22)), function (edge) %7B%0A            g.setEdge(commit.id, edge.id);%0A        %7D);%0A    %7D);%0A%0A    return g;%0A%7D;%0A%0A

Add funcs thing to build commit subgraph