nx.graphic.Topology.StageMixin - Next UI Toolkit

#

API Docs for: trial
Show: Inherited Protected Private Deprecated

# nx.graphic.Topology.StageMixin Class

Module: nx.graphic.Topology

Topology stage class

- Index
- Methods
- Properties
- Events

## Item Index

### Methods

- adaptToContainer
- adjustLayout
- fit
- move
- resize
- zoom
- zoomByBound

### Properties

- adaptive
- enableSmartNode
- height
- padding
- scalable
- stage
- width

### Events

- fit
- ready
- resizeStage

## Methods

### `adaptToContainer`

()

Make topology adapt to container,container should set width/height

### `adjustLayout`

()

If enable enableSmartNode, this function will auto adjust the node's overlapping and set the nodes to right size

### `fit`

()

Make topology graphic fit stage

### `move`

(

- `x`
- `y`
- `[duration]`

)

Move topology

#### Parameters:

- `x` Number
- `y` Number
- `[duration]` Number optional

  default is 0

### `resize`

(

- `width`
- `height`

)

Resize topology

#### Parameters:

- `width` Number
- `height` Number

### `zoom`

(

- `value`

)

Zoom topology

#### Parameters:

- `value` Number

### `zoomByBound`

(

- `inBound`
- `[callback]`
- `[context]`
- `[duration]`

)

Zoom topology by a bound

#### Parameters:

- `inBound` Object

  e.g {left:Number,top:Number,width:Number,height:Number}

- `[callback]` Function optional

  callback function

- `[context]` Object optional

  callback context

- `[duration]` Number optional

  set the transition time, unit is second

## Properties

### `adaptive`

Boolean

Set to true will adapt to topology's outside container, set to ture will ignore width/height

### `enableSmartNode`

Boolean

Enabling the smart node feature, set to false will improve the performance

### `height`

Number

height Set/get topology's height.

### `padding`

Number

Set/get stage's padding.

### `scalable`

Boolean

Set/get topology's scalability

### `stage`

nx.graphic.Component

Get the topology's stage component

### `width`

Number

Set/get topology's width.

## Events

### `fit`

Fired when after topology fit to stage

#### Event Payload:

- `sender` Object

  trigger instance

- `event` Object

  original event object

### `ready`

Fired when topology appended to container with with& height

#### Event Payload:

- `sender` Object

  trigger instance

- `event` Object

  original event object

### `resizeStage`

Fired when topology's stage changed

#### Event Payload:

- `sender` Object

  trigger instance

- `event` Object

  original event object