gremlin-graphviz
Use Graphviz to visualize Gremlin graphs.
This module is a mashup of gremlin-v3 and
node-graphviz.
Usage
You must first install the Graphviz package in a platform-specific manner.
Check out the unit tests for more, but here is a taste:
var Gremlin = require('gremlin-v3');
var gremlin = new Gremlin();
var TinkerFactory = gremlin.java.import('com.tinkerpop.gremlin.tinkergraph.structure.TinkerFactory');
var gremlinGraph = gremlin.wrap(TinkerFactory.createClassicSync());
var gremlinGraphviz = require('gremlin-graphviz');
gremlinGraphviz(gremlinGraph).
then(function (graphvizGraph) {
var dotGraph = graphvizGraph.to_dot();
graphvizGraph.use = 'fdp';
graphvizGraph.output('png', function (data) {
require('fs').writeFileSync('graph.png', data);
}, function (code, stdout, stderr) {
throw new Error('fdp failed: ' + stderr);
});
});