Skip to content

Latest commit

 

History

History
104 lines (61 loc) · 1.96 KB

GraphOptions.md

File metadata and controls

104 lines (61 loc) · 1.96 KB

@antv/graphlib / Exports / GraphOptions

Interface: GraphOptions<N, E>

Options to create a graph.

Type parameters

Name Type
N extends PlainObject
E extends PlainObject

Table of contents

Properties

Properties

edges

Optional 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 },
]

Defined in

src/types.ts:93


nodes

Optional 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' },
]

Defined in

src/types.ts:79


onChanged

Optional onChanged: (event: GraphChangedEvent<N, E>) => void

Type declaration

▸ (event): void

A listener function which will be called with a GraphChangedEvent whenever a graph change happened.

Parameters
Name Type
event GraphChangedEvent<N, E>
Returns

void

Defined in

src/types.ts:100


tree

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

Defined in

src/types.ts:95