Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mischnic/dot-svg
Render Graphviz dot Graphs into SVGs in the browser
https://github.com/mischnic/dot-svg
emscripten graphviz graphviz-dot svg wasm
Last synced: 3 months ago
JSON representation
Render Graphviz dot Graphs into SVGs in the browser
- Host: GitHub
- URL: https://github.com/mischnic/dot-svg
- Owner: mischnic
- License: mit
- Created: 2019-06-01T16:17:37.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-01-05T09:30:08.000Z (almost 2 years ago)
- Last Synced: 2023-04-10T11:35:50.789Z (over 1 year ago)
- Topics: emscripten, graphviz, graphviz-dot, svg, wasm
- Language: JavaScript
- Homepage:
- Size: 577 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# dot-svg
**[Demo](https://dot-wasm.now.sh/)**
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.
```js
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](./demo-node.js) or [this more complete browser example](./demo-browser), 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 .