How to use the graphlib.json function in graphlib

To help you get started, we’ve selected a few graphlib examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github DefinitelyTyped / DefinitelyTyped / graphlib / graphlib-tests.ts View on Github external
function test_graph() {
  var g = new graphlib.Graph();
  g.setEdge('a', 'b');
  g.setEdge('a', 'b', 1.023);

  g.edge('a', 'b');
  g.edge({v: 'a', w: 'b'});

  graphlib.json.read(graphlib.json.write(g));

  graphlib.alg.dijkstra(g, 'a', e => g.edge(e));
  graphlib.alg.dijkstraAll(g, e => g.edge(e));
  graphlib.alg.dijkstraAll(g);

  graphlib.alg.findCycles(g);
  graphlib.alg.isAcyclic(g);
  graphlib.alg.prim(g, e => g.edge(e));
  graphlib.alg.tarjan(g);
  graphlib.alg.topsort(g);
}
github pattern-lab / patternlab-node / core / lib / pattern_graph.js View on Github external
clone: function () {
    const json = graphlib.json.write(this.graph);
    const graph = graphlib.json.read(json);
    return new PatternGraph(graph, this.timestamp, this.version);
  },
github kube-HPC / hkube / core / pipeline-driver / lib / nodes / nodes-map.js View on Github external
getJSONGraph() {
        return graphlib.json.write(this._graph);
    }
github pattern-lab / patternlab-node / core / lib / pattern_graph.js View on Github external
clone: function () {
    const json = graphlib.json.write(this.graph);
    const graph = graphlib.json.read(json);
    return new PatternGraph(graph, this.timestamp, this.version);
  },
github teambit / bit / src / scope / graph / scope-graph.ts View on Github external
serialize(graph: Graph = this.graph) {
    return GraphLib.json.write(graph);
  }
}
github teambit / bit / src / scope / graph / scope-graph.js View on Github external
serialize(graph: ?Object = this.graph) {
    return GraphLib.json.write(graph);
  }
}