number of edges
get all edges as { v, w } descriptors
create a new graph containing only nodes that pass the filter, sharing the graph label
get the graph label passed to setGraph (includes width and height after layout)
check if the edge from v to w exists
An edge with a name is never found, since edges have no names.
Optionalname: stringcheck if an edge given by a descriptor exists
Optionalname?: stringedge name
source node id
target node id
check if a node exists
get incoming edge descriptors, optionally filtered to edges from w
Optionalw: stringalways false, since compound graphs are not supported
always true, since dagre graphs are directed
true if the graph has multiple edges between the same pair of nodes
get all neighbor node ids (predecessors and successors, deduplicated)
number of nodes
get all edge descriptors incident to v, optionally filtered to edges with w
Optionalw: stringget all node ids
get outgoing edge descriptors, optionally filtered to edges to w
Optionalw: stringget predecessor node ids
remove the edge from v to w
An edge with a name is never found, since edges have no names.
Optionalname: stringremove an edge given by a descriptor
Optionalname?: stringedge name
source node id
target node id
remove a node and all its edges
set the label used when setEdge adds an edge without one
As in dagre, a function is called with the source id, the target id, and
the edge name for each new edge, and anything else is used as is, so every
such edge shares the same object. Edges have no names, so the name is
always undefined.
add or update the edge from v to w
The label object is kept as is, and dagre.layout writes points onto it.
Fields such as minlen or weight are kept but don't affect layout.
Edges have no names, so setting one with a name throws, as dagre does for a graph that isn't a multigraph.
Optionallabel: EdgeLabelOptionalname: stringset the graph label, replacing any earlier one
The object is kept as is: dagre.layout reads its options, using defaults
for missing ones without writing them, and writes width and height onto it.
add or update a node
The label object is kept as is, and dagre.layout writes x and y onto it.
Optionallabel: NodeLabeladd edges between consecutive pairs of nodes
get sink node ids (no children)
get source node ids (no parents)
get successor node ids
dagre-compatible mutable graph backed by d3-dag
Accessed as
dagre.graphlib.Graph. Use with dagre.layout. Like dagre'sGraph, it takes the graph, node and edge label types as parameters, so node returns the node label withxandy, and edge returns the edge label withpoints.Example