glejeune/node-graphviz

Is it possible to create a stripped down version for browsers that only generates dot code?

shobhitg opened this issue · 1 comments

Hi,

This is a great Node module for Graphviz diagrams. Unfortunately this can't work in browsers because graphviz isn't available. But what if we could have a browser friendly stripped down version that generates dot code string.
And then I can use https://github.com/mdaines/viz.js to greate diagrams with that dot code in browsers without Node.JS.
Since the author understands his code best, I am requesting you if you can please create a stripped down version that just generates dot code?
Thanks...

You can use to_dot method of the Graph class :

var util = require('util'),
graphviz = require('../lib/graphviz');
var g = graphviz.digraph("G");

// ...

console.log(g.to_dot())