You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 7-8.RSVP
Socket
Socket
Sign inDemoInstall

viz.js

Package Overview
Dependencies
Maintainers
1
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

viz.js

Graphviz on web via Emscripten


Version published
Weekly downloads
53K
decreased by-12.68%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

Viz.js

A hack to put Graphviz on the web. You should probably check out dagre, though:

https://github.com/cpettitt/dagre
https://github.com/cpettitt/dagre-d3

To render as SVG (produces an XML string):

svg = Viz("digraph { a -> b; }", "svg");

See examples here:

http://mdaines.github.io/viz.js/example.html
http://mdaines.github.io/viz.js/form.html

Compiled versions are available on the releases page:

https://github.com/mdaines/viz.js/releases

This project is based on work by Satoshi Ueyama and Brenton Partridge:

https://github.com/gyuque/livizjs
https://github.com/bpartridge/graphviz.js

Thanks to the following contributors:

jbogard
KylePDavis
siefkenj
srathbun
vmarkovtsev

Usage

Viz(src, format="svg", engine="dot", options=null)
  • src is the string representation of the graph written in Dot language.
  • format is the graph output format in terms of dot -T. Since the result of the function is returned as a string, the only sane formats are "dot" and "svg". Typically, one would use "svg" to display the rendered result.
  • engine is the Graphviz layout engine to use. Can be any from "dot", "neato", "circo", "twopi" or others. Usually, one is satisfied with "dot" or "neato".
  • options are the array of extra command line arguments which are virtually added to the corresponding engine invocation (thanks to GVC API's gvParseArgs()). To get an idea what such options can be, execute "dot --help" in your system's terminal. As an example, options=["-n"] makes neato enter "no layout" mode to render graphs already converted to "dot" output format as-is.

FAQs

Package last updated on 19 Jun 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc