Interface GraphOptions<N, E>

Options to create a graph.

Type Parameters

Hierarchy

  • GraphOptions

Properties

edges?: Edge<E>[]

An array of edge data representing the initial edges.

Each edge must have a unique ID.

The source and target of each edge must be present in nodes.

Example

[
{ id: 9, source: 1, target: 2, weight: 10 },
]
nodes?: Node<N>[]

An array of node data representing the initial nodes.

Each node must have a unique ID.

Example

[
{ id: 1, color: 'red' },
{ id: 2, color: 'blue' },
]
onChanged?: ((event: GraphChangedEvent<N, E>) => void)

Type declaration

tree?: TreeData<N> | TreeData<N>[]

Generated using TypeDoc