Package: effect
Module: Graph
Creates a graph constructor for the specified graph kind.
When to use
Use when the graph kind is selected dynamically. Prefer directed or
undirected when the kind is known statically.
Example (Constructing by kind)
import { Graph } from "effect"
const makeGraph = Graph.make("directed")
const graph = makeGraph<string, number>((mutable) => {
Graph.addNode(mutable, "A")
})
console.log(graph.type) // "directed"
See
directed for constructing a directed graph directlyundirected for constructing an undirected graph directlySignature
declare const make: <T extends Kind>(type: T) => <N, E>(mutate?: (mutable: MutableGraph<N, E, T>) => undefined) => Graph<N, E, T>
Since v4.0.0