import { type GraphBase } from "https://deno.land/x/rimbu@1.0.0/graph/custom/common/index.ts";
const { Builder } = GraphBase;
Type Parameters
optional
Tp extends GraphBase.Types = GraphBase.TypesProperties
readonly
context: WithGraphValues<Tp, N, unknown>["context"]Returns the context
associated to this collection instance.
Methods
addGraphElement(element: GraphElement<N>): boolean
Adds the given element
graph element to the builder, where a graph element
is either a one-element tuple containing a node, or a two-element tuple containing
two nodes indicating a connection.
addGraphElements(elements: StreamSource<GraphElement<N>>): boolean
Adds the graph elements in the given elements
StreamSource to the graph.
removeNodes<UN = N>(nodes: StreamSource<RelatedTo<N, UN>>): boolean
Removes the given nodes
, and any of their connections, from the graph.
connectAll(connections: StreamSource<WithGraphValues<Tp, N, unknown>["link"]>): boolean
Adds the connections in given connections
StreamSource
to the graph.
disconnectAll<UN = N>(connections: StreamSource<Link<RelatedTo<N, UN>>>): boolean
Removes all connections from the given connections
StreamSource
from the graph.
build(): WithGraphValues<Tp, N, unknown>["normal"]
Returns an immutable Graph containing the links in this Builder instance.