Nanometer Process Machine

    @thi.ng/dgraph-dot
    TypeScript icon, indicating that this package has built-in type declarations

    2.1.30 • Public • Published

    dgraph-dot

    npm version npm downloads Twitter Follow

    This project is part of the @thi.ng/umbrella monorepo.

    About

    Customizable Graphviz DOT serialization for @thi.ng/dgraph.

    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.

    Status

    STABLE - used in production

    Search or submit any issues for this package

    Installation

    yarn add @thi.ng/dgraph-dot

    ES module import:

    <script type="module" src="https://cdn.skypack.dev/@thi.ng/dgraph-dot"></script>

    Skypack documentation

    For Node.js REPL:

    # with flag only for < v16
    node --experimental-repl-await
    
    > const dgraphDot = await import("@thi.ng/dgraph-dot");
    

    Package sizes (brotli'd, pre-treeshake): ESM: 228 bytes

    Dependencies

    API

    Generated API 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)

    Authors

    Karsten Schmidt

    If this project contributes to an academic publication, please cite it as:

    @misc{thing-dgraph-dot,
      title = "@thi.ng/dgraph-dot",
      author = "Karsten Schmidt",
      note = "https://thi.ng/dgraph-dot",
      year = 2020
    }

    License

    © 2020 - 2022 Karsten Schmidt // Apache Software License 2.0

    Install

    npm i @thi.ng/dgraph-dot

    DownloadsWeekly Downloads

    87

    Version

    2.1.30

    License

    Apache-2.0

    Unpacked Size

    21.4 kB

    Total Files

    6

    Last publish

    Collaborators

    • thi.ng