Skip to content

Latest commit

 

History

History
75 lines (53 loc) · 1.31 KB

tpl.readme.md

File metadata and controls

75 lines (53 loc) · 1.31 KB

About

{{pkg.description}}

This package acts as optional glue layer between the @thi.ng/dgraph and @thi.ng/dot packages. The latter is used to perform the actual Graphviz serialization. Please consult its readme & source code for visualization options.

{{meta.status}}

{{repo.supportPackages}}

{{repo.relatedPackages}}

{{meta.blogPosts}}

Installation

{{pkg.install}}

{{pkg.size}}

Dependencies

{{pkg.deps}}

{{repo.examples}}

API

{{pkg.docs}}

TODO

import { defDGraph } from "@thi.ng/dgraph";
import { toDot } from "@thi.ng/dgraph-dot";

// define dependency graph
const graph = defDGraph([
    ["a", "b"],
    ["a", "c"],
    ["b", "d"],
    ["c", "d"],
    ["c", "e"],
]);

// convert to graphviz format
console.log(toDot(graph, { id: (node) => node }));
// digraph g {
// "b"[label="b"];
// "c"[label="c"];
// "d"[label="d"];
// "e"[label="e"];
// "a"[label="a"];
// "b" -> "d";
// "c" -> "d";
// "c" -> "e";
// "a" -> "b";
// "a" -> "c";
// }

(Also see tests)