~rbdr/graphviz-to-grafn

Convert graphviz diagrams to grafn code
a597c682 — Ruben Beltran del Rio 3 years ago
Initial version

refs

main
browse  log 

clone

read-only
https://git.sr.ht/~rbdr/graphviz-to-grafn
read/write
git@git.sr.ht:~rbdr/graphviz-to-grafn

You can also use your local clone with git send-email.

#Graphviz to Grafn

Converts graphviz .dot files to Grafn javascript code. This lets you define your application flow using a diagram editor first, and then fill out the functionality.

#How can I use it?

#As a Library

const Fs = require('fs/promises');
const GraphvizToGrafn = require('grafn-to-graphviz');

async function convert() {
  const graphvizCode = await Fs.read('/path/to/graphviz.dot');
  const grafnCode = await GraphvizToGrafn(graphvizCode.toString());

  console.log(grafnCode); // will print the JS code
}

#As a Binary

$ npm install -g graphviz-to-grafn
$ cat ./path/to/graphviz.dot | g2g > grafn_code.js