ligie generates mermaid-js diagrams (.md, .svg, .png) from basic graph structures.
const graph = {
"a": ["b", "c", "d"];
"b": [],
"c": ["d"],
"d": []
};
const outDir = process.cwd();
const mermaid = generateMermaid(graph, outDir, { orientation: "LR" });
await mermaid.toMarkdown(); // 1.
await mermaid.toSvg(); // 2.
await mermaid.toPng(); // 3.
For the 1), a markdown file will include a graph diagram:
graph LR;
a --> b
a --> c
a --> d
c --> d