Viz.js
This project builds Graphviz with Emscripten and provides a simple wrapper for using it in the browser.
Getting Viz.js
Install with Bower:
bower install viz.js
Or with npm:
npm install viz.js
Or get it from the releases page.
"Lite" Version
Viz.js releases include a smaller version called viz-lite.js
. This omits Expat and the NEATO layout plugin.
Usage
Rendering a graph as SVG:
var svg = Viz("digraph { a -> b; }");
The input to Viz()
is a graph in the DOT language. The output svg
is an SVG XML string.
For more information, see the API documentation.
Building Viz.js
To build from source, you will need to install the Emscripten SDK.
To download the sources and build everything:
make