function read(json) {
  var g = new Graph(json.options).setGraph(json.value);
  json.nodes.forEach(function(entry) {
    g.setNode(entry.v, entry.value);
    if (entry.parent) {
      g.setParent(entry.v, entry.parent);
    }
  });
  json.edges.forEach(function(entry) {
    g.setEdge({ v: entry.v, w: entry.w, name: entry.name }, entry.value);
  });
  return g;
}
Takes JSON as input and returns the graph representation.

@example
var g2 = graphlib.json.read(JSON.parse(str));
g2.nodes();
// ['a', 'b']
g2.edges()
// [ { v: 'a', w: 'b' } ]