Skip to content

Instantly share code, notes, and snippets.

@jakkaj
Created April 14, 2017 06:16
Show Gist options
  • Save jakkaj/2cc7a86dab64f4112efd079de5cc9adc to your computer and use it in GitHub Desktop.
Save jakkaj/2cc7a86dab64f4112efd079de5cc9adc to your computer and use it in GitHub Desktop.
Test run of GraphViz generation in Node
var viz = require('viz.js');
var fs = require('fs');
var svg2png = require("svg2png");
var result = viz("digraph { x -> y -> z; }", { format: "svg" });
svg2png(result)
.then(buffer => fs.writeFile("dest.png", buffer))
.catch(e => console.error(e));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment