d3-dag
    Preparing search index...

    Variable dagreConst

    dagre: { graphlib: { Graph: typeof DagreGraph }; layout: {} } = ...

    dagre-compatible namespace backed by d3-dag

    Drop-in replacement for dagre using d3-dag's layout algorithms. Optionally pass a custom sugiyama or zherebko operator to layout for fine-tuned algorithm selection.

    Type Declaration

    • Readonlygraphlib: { Graph: typeof DagreGraph }

      graph constructors

      • ReadonlyGraph: typeof DagreGraph

        dagre-compatible graph class

    • Readonlylayout: {}

      run layout on a graph, mutating it in-place

      Sets x/y on node labels, points on edge labels, and width/height on the graph config.

      the graph to lay out

      optional Operator; graph config is applied on top

    import { dagre } from "d3-dag";

    const grf = new dagre.graphlib.Graph();
    grf.setGraph({});
    grf.setDefaultEdgeLabel(() => ({}));
    grf.setNode("a", { width: 40, height: 40 });
    grf.setNode("b", { width: 40, height: 40 });
    grf.setEdge("a", "b");
    dagre.layout(grf);
    const { x, y } = grf.node("a");