Function graphConnect

  • create a new Connect with default settings

    Connect operators create graphs from link data that contains ids to source and target nodes. By default it expects link data that are tuples of the source and target id as strings.

    Parameters

    • ...args: never[]

    Returns DefaultConnect

    If you want to build a graph with the default settings:

    const data = [
    ["Euler", "Lagrange"],
    ["Lagrange", "Fourier"],
    ["Lagrange", "Poisson"],
    ["Fourier", "Dirichlet"],
    ["Poisson", "Dirichlet"],
    ] as const;

    const builder = graphConnect();
    const grf = builder(data);

    If you want to use custom data:

    const data = [
    { source: "Euler", target: "Lagrange" },
    { source: "Lagrange", target: "Fourier" },
    ] as const;

    const builder = graphConnect()
    .sourceId(({ source }: { source: string }) => source)
    .targetId(({ target }: { target: string }) => target);
    const grf = builder(data);