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

    • Rest ...args: never[]

    Returns DefaultConnect

    Example

    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);

    Example

    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);

Generated using TypeDoc