glejeune / node-graphviz

Node.js interface to the GraphViz graphing tool
http://algorithmique.net
MIT License
197 stars 58 forks source link

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

Closed shobhitg closed 11 years ago

shobhitg commented 11 years ago

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...

glejeune commented 11 years ago

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())