nx.graphic.Topology.NodeMixin - Next UI Toolkit

#

API Docs for: trial
Show: Inherited Protected Private Deprecated

# nx.graphic.Topology.NodeMixin Class

Module: nx.graphic.Topology

Node mixin class

- Index
- Methods
- Properties

## Item Index

### Methods

- addNode
- addNodeSet
- eachNode
- getNode
- removeNode
- zoomByNodes

### Properties

- enableSmartLabel
- nodeDraggable
- nodeInstanceClass
- nodeSetInstanceClass
- showIcon
- selectedNodes

## Methods

### `addNode`

(

- `obj`
- `inOption`

)

Add a node to topology

#### Parameters:

- `obj` Object
- `inOption` Object

#### Returns:

:

### `addNodeSet`

(

- `obj`
- `[inOption]`
- `[parentNodeSet]`

)

Add a nodeSet

#### Parameters:

- `obj` Object
- `[inOption]` Object optional
- `[parentNodeSet]` Object optional

#### Returns:

:

### `eachNode`

(

- `callback`
- `context`

)

Traverse each node

#### Parameters:

- `callback` Object
- `context` Object

### `getNode`

(

- `id`

)

Get node by node id

#### Parameters:

- `id` Object

#### Returns:

:

### `removeNode`

(

- `arg`

)
Boolean

Remove a node

#### Parameters:

- `arg` Object

#### Returns:

Boolean:

### `zoomByNodes`

(

- `[callback]`
- `[context]`
- `nodes`

)

Zoom topology to let the passing nodes just visible at the screen

#### Parameters:

- `[callback]` Function optional

  callback function

- `[context]` Object optional

  callback context

- `nodes` Array

  nodes collection

## Properties

### `enableSmartLabel`

Unknown

Enable smart label

### `nodeDraggable`

Unknown

Set node's draggable

### `nodeInstanceClass`

Unknown

Node instance class name, support function

### `nodeSetInstanceClass`

Unknown

NodeSet instance class name, support function

### `showIcon`

Unknown

Show or hide node's icon

### ``

NodeConfig

All node's config. key is node's property, support super binding value could be a single string eg: color:'#f00' value could be a an expression eg: label :'{model.id}' value could be a function eg iconType : function (model,instance){ return 'router'} value could be a normal binding expression eg : label :'{#label}'

### ``

NodeSetConfig

All nodeSet's config. key is node's property, support super binding value could be a single string eg: color:'#f00' value could be a an expression eg: label :'{model.id}' value could be a function eg iconType : function (model,instance){ return 'router'} value could be a normal binding expression eg : label :'{#label}'

### `selectedNodes`

nx.data.ObservableCollection

All selected nodes, could direct add/remove nodes to this collection