nx.graphic.Topology.LinkMixin - Next UI Toolkit

#

API Docs for: trial
Show: Inherited Protected Private Deprecated

# nx.graphic.Topology.LinkMixin Class

Module: nx.graphic.Topology

Links mixin class

- Index
- Methods
- Properties

## Item Index

### Methods

- addLink
- attachLayer
- eachLink
- fadeOut
- getLayer
- getLink
- insertLayerAfter
- prependLayer
- removeLink

### Properties

- linkSetInstanceClass
- nodeInstanceClass
- supportMultipleLink
- fade
- fadeActivePriority
- forceFade
- layers
- layersMap

## Methods

### `addLink`

(

- `obj`
- `inOption`

)
nx.graphic.Topology.Link

Add a link to topology

#### Parameters:

- `obj` JSON
- `inOption` Config

#### Returns:

nx.graphic.Topology.Link:

### `attachLayer`

(

- `name`
- `layer`

)

attach a layer to topology, that should be subclass of nx.graphic.Topology.Layer

#### Parameters:

- `name` String

  handler to get this layer

- `layer` Object

  <String,nx.graphic.Topology.Layer> Could be string of a layer's class name, or a reference of a layer

### `eachLink`

(

- `callback`
- `context`

)

Traverse each link

#### Parameters:

- `callback` Object

- `context` Object

### `fadeOut`

(

- `[force]`
- `[callback]`
- `[context]`

)

fade out layer

#### Parameters:

- `[force]` Boolean optional

  force layer fade out and can't fade in

- `[callback]` Function optional

  callback after fade out

- `[context]` Object optional

  callback context

### `getLayer`

(

- `name`

)

Get a layer reference by name

#### Parameters:

- `name` String

  The name you pass to topology when you attacherLayer/prependLayer/insertLayerAfter

#### Returns:

:

Instance of a layer

### `getLink`

(

- `id`

)

Get link by link id

#### Parameters:

- `id` Object

#### Returns:

:

### `insertLayerAfter`

(

- `name`
- `layer`
- `upsideLayerName`

)

Insert a layer under a certain layer, that should be subclass of nx.graphic.Topology.Layer

#### Parameters:

- `name` String

  handler to get this layer

- `layer` Object

  <String,Object> Could be string of a layer's class name, or a reference of a layer

- `upsideLayerName` String

  name of upside layer

### `prependLayer`

(

- `name`
- `layer`

)

Prepend a layer to topology, that should be subclass of nx.graphic.Topology.Layer

#### Parameters:

- `name` String

  handler to get this layer

- `layer` Object

  <String,nx.graphic.Topology.Layer> Could be string of a layer's class name, or a reference of a layer

### `removeLink`

(

- `arg`

)
Boolean

Remove a link

#### Parameters:

- `arg` String

#### Returns:

Boolean:

## Properties

### `linkSetInstanceClass`

Unknown

LinkSet instance class name, support function

### `nodeInstanceClass`

Unknown

Link instance class name, support function

### `supportMultipleLink`

Boolean

Is topology support Multiple link , is false will highly improve performance

### ``

LinkConfig

All link's config. key is link'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}'

### ``

LinkSetConfig

All linkSet's config. key is link'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}'

### `fade`

Unknown

Get fade status.

### `fadeActivePriority`

Unknown

Set active priority over highlight.

### `forceFade`

Unknown

Force layer fade.

### `layers`

Unknown

### `layersMap`

Unknown