Skip to content

Function: fromEdgeList() ​

ts
function fromEdgeList(edges, options?): GraphData;

A graph from a list of edges: [source, target] or [source, target, value] tuples, or objects with those keys. Ends are node ids (strings or numbers), not indices. Edges without two usable ends are skipped.

Parameters ​

ParameterType
edgesIterable<readonly unknown[] | Readonly<Record<string, unknown>>>
optionsEdgeListOptions

Returns ​

GraphData

Released under the MIT License.