We could try something like faking the DOM under Node.js, but I found a better way. We can make our browser-based visualization libraries work for us under Node.js using a headless browser. This is a browser that has no user interface. You can think of it as a browser that is invisible.
I use Nightmare under Node.js to capture visualizations to PNG and PDF files and it works really well!