nx.graphic.Topology.Graph - Next UI Toolkit

#

API Docs for: trial
Show: Inherited Protected Private Deprecated

# nx.graphic.Topology.Graph Class

Module: nx.graphic.Topology

Topology graph model class

- Index
- Methods
- Properties
- Events

## Item Index

### Methods

- getData
- insertData
- setData

### Properties

- autoLayout
- data
- dataProcessor
- graph
- identityKey

### Events

- afterSetData
- beforeSetData
- insertData
- topologyGenerated

## Methods

### `getData`

() JSON

Get topology data, recommend use topo.data()

#### Returns:

JSON:

### `insertData`

(

- `data`

)

Insert data to topology

#### Parameters:

- `data` JSON

  should be {nodes:[],links:[]}

### `setData`

(

- `data`
- `[callback]`
- `[context]`

)

Set data to topology, recommend use topo.data(data)

#### Parameters:

- `data` JSON

  should be {nodes:[],links:[]}

- `[callback]` Object optional
- `[context]` Object optional

## Properties

### `autoLayout`

Boolean

Set the use force layout, recommand use dataProcessor:'force'

### `data`

JSON

set/get the topology' data, data should follow Common Topology Data Definition

### `dataProcessor`

String

Pre data processor, it could be 'force'/'quick'. It could also support register a new processor

### `graph`

nx.data.ObservableGraph

Topology graph object

### `identityKey`

String

Identity the node and link mapping key, default is index

## Events

### `afterSetData`

Fired after process data

#### Event Payload:

- `sender` Object

  trigger instance

- `event` Object

  original event object

### `beforeSetData`

Fired before start process data

#### Event Payload:

- `sender` Object

  Trigger instance

- `data` JSON

  event object

### `insertData`

Fired after insert data

#### Event Payload:

- `sender` Object

  trigger instance

- `event` Object

  original event object

### `topologyGenerated`

Fired when all topology elements generated

#### Event Payload:

- `sender` Object

  trigger instance

- `event` Object

  original event object