nx.data.ObservableGraph - Next UI Toolkit

#

API Docs for: trial
Show: Inherited Protected Private Deprecated

# nx.data.ObservableGraph Class

Extends nx.data.ObservableObject
Module: nx.data

ObservableGraph class

- Index
- Methods
- Properties
- Events

## Item Index

### Methods

- clear
- clearBinding
- dispose
- get
- getBinding
- getBound
- getData
- getJSON
- gets
- has
- insertData
- notify
- set
- setBinding
- setData
- unwatch

### Properties

- identityKey

### Events

- endGenerate
- insertData
- setData
- startGenerate

## Methods

### `clear`

()

Clear graph data

### `clearBinding`

(

- `prop`

)

Inherited from nx.Observable:

Clear binding for specified property.

#### Parameters:

- `prop` Object

### `dispose`

()

Inherited from nx.Observable

Dispose current object.

### `get`

(

- `name`

)

Inherited from nx.data.ObservableObject:

Get specified property value.

#### Parameters:

- `name` String

#### Returns:

:

### ``

(

- `names`
- `handler`
- `context`

)

Inherited from nx.Observable:

#### Parameters:

- `names` Object
- `handler` Object
- `context` Object

### `getBinding`

(

- `prop`

)

Inherited from nx.Observable:

Get existing binding object for specified property.

#### Parameters:

- `prop` Object

#### Returns:

:

### `getBound`

() X: number, y: number, width: number, height: number, maxX: number, maxY: number

Get visible vertices data bound

#### Returns:

X: number, y: number, width: number, height: number, maxX: number, maxY: number:

}

### `getData`

() Object

Get original data

#### Returns:

Object:

### `getJSON`

(

- `[inData]`

)
Nodes: Array, links: Array,nodeSet:Array

Get original json object

#### Parameters:

- `[inData]` Object optional

#### Returns:

Nodes: Array, links: Array,nodeSet:Array:

}

### `gets`

() Object

Inherited from nx.data.ObservableObject:

Get all properties.

#### Returns:

Object:

### `has`

(

- `name`

)
Boolean

Inherited from nx.data.ObservableObject:

Check whether current object has specified property.

#### Parameters:

- `name` String

#### Returns:

Boolean:

### `insertData`

(

- `inData`

)

Insert data, data should follow Common Topology Data Definition

#### Parameters:

- `inData` Object

### `notify`

(

- `names`
- `oldValue`

)

Inherited from nx.Observable:

#### Parameters:

- `names` Object
- `oldValue` Object

### `set`

(

- `name`
- `value`

)

Inherited from nx.data.ObservableObject:

Set specified property value.

#### Parameters:

- `name` String
- `value`

### `setBinding`

(

- `prop`
- `expr`
- `source`

)

Inherited from nx.Observable:

Set binding for specified property.

#### Parameters:

- `prop` Object
- `expr` Object
- `source` Object

### `setData`

(

- `inData`

)

Set data, data should follow Common Topology Data Definition

#### Parameters:

- `inData` Object

### `unwatch`

(

- `names`
- `handler`
- `context`

)

Inherited from nx.Observable:

#### Parameters:

- `names` Object
- `handler` Object
- `context` Object

## Properties

### `identityKey`

String

Use this attribute of original data as vertex's id and link's mapping key default is index, if not set use array's index as id

Default: 'index'

## Events

### `endGenerate`

Fired when finish generate topology elements

#### Event Payload:

- `sender` Object

  trigger instance

- `event` Object

  original event object

### `insertData`

Trigger when insert data to ObservableGraph

#### Event Payload:

- `sender` Object

  event trigger

- `data` Object

  data, which been processed by data processor

### `setData`

Trigger when set data to ObservableGraph

#### Event Payload:

- `sender` Object

  event trigger

- `data` Object

  data, which been processed by data processor

### `startGenerate`

Fired when start generate topology elements

#### Event Payload:

- `sender` Object

  trigger instance

- `event` Object

  original event object