Skip to content

dot (graphviz) command implement by javascript (single binary)

License

Notifications You must be signed in to change notification settings

kaishuu0123/graphviz-dot.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

graphviz-dot.js

  • dot (graphviz) command implement by javascript. (single binary)
    • include converted graphviz by emscripten.

GOAL

Now Support Feature

  • support format: svg, pdf
  • pipe(stdin) input
    • cat dot_files/test.dot | dot.js -T svg

How to Use? (Tutorial)

  • use node.js
$ node bin/dot.js -T svg dot_files/test.dot -o test.svg
  • use single binary
$ graphviz-dot -T svg dot_files/test.dot -o test.svg

How it work?

  • converted graphviz by emscripten. (viz.js/viz-lite.js)
  • cross compile by pkg

BUILDING

  • use pkg (version: 4.2.6)
  • node.js version: v8.9.3
  • emscripten version: 1.37.22

BUILD viz-lite.js

$ cd viz.js
$ make viz-lite.js

BUILD graphviz-dot.js

$ pkg package.json --targets (you want to build platform.)
# example (for linux x64)
$ pkg package.json --targets node8-linux-x64
# example (for win x64)
$ pkg package.json --targets node8-win-x64
# All targets
$ pkg package.json --targets=linux-x64,linux-x86,macos-x64,win-x64,win-x86

Credits

This work is based off of several existing projects: