Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/rimbu/graph/custom/valued/interface/generic/valued-graph-base.ts>ValuedGraphBase

Rimbu is a TypeScript library focused on immutable, performant, and type-safe collections and other tools.
Go to Latest
namespace ValuedGraphBase
import { ValuedGraphBase } from "https://deno.land/x/rimbu@0.13.5/graph/custom/valued/interface/generic/valued-graph-base.ts";
interface ValuedGraphBase
import { type ValuedGraphBase } from "https://deno.land/x/rimbu@0.13.5/graph/custom/valued/interface/generic/valued-graph-base.ts";

Properties

readonly
context: WithGraphValues<Tp, N, V>["context"]

Returns the context associated to this collection instance.

Methods

getConnectionsFrom<UN = N>(node1: RelatedTo<N, UN>): WithGraphValues<Tp, N, V>["linkConnections"]

Returns a Map containing the nodes and connection values reachable from given node1 node as keys, and their corresponding values.

connect(
node1: N,
node2: N,
value: V,
): WithGraphValues<Tp, N, V>["nonEmpty"]

Returns the graph where given nodes node1 and node2 are connected with the given value.

modifyAt(
node1: N,
node2: N,
options: { ifNew?: OptLazyOr<V, Token>; ifExists?: (value: V, remove: Token) => V | Token; },
): WithGraphValues<Tp, N, V>["normal"]

Returns the graph with the connection between given node1 and node2 modified according to given options.

toBuilder(): WithGraphValues<Tp, N, V>["builder"]

Returns a builder object containing the entries of this collection.