Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

@mischnic/dot-svg

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mischnic/dot-svg

**[Demo](https://dot-wasm.now.sh/)**

latest
npmnpm
Version
0.0.0
Version published
Weekly downloads
210
-50.7%
Maintainers
1
Weekly downloads
 
Created
Source

dot-svg

Demo

Render .dot Graphs into SVGs right in your browser (or in node without any native module).

Usage

The package exports a promise that resolves to a dotToSVG function. This is necessary because this function can only be called after the WASM module was loaded.

const render = require("@mischnic/dot-svg");

render.then(function(dotToSVG) {
	try {
		const svg = dotToSVG(document.querySelector("textarea").value);
	} catch(e){
		console.error(e);
	}
	// ...
});

For examples, see this node example or this more complete browser example, which is also hosted as a demo at https://dot-wasm.now.sh/


For the most part this is a reduced version fo the unmaintained https://github.com/mdaines/viz.js .

FAQs

Package last updated on 09 Mar 2020

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