nx.graphic.Polygon - Next UI Toolkit

#

API Docs for: trial
Show: Inherited Protected Private Deprecated

# nx.graphic.Polygon Class

Extends nx.graphic.Path
Module: nx.graphic

SVG polygon component

- Index
- Methods
- Properties
- Events

## Item Index

### Methods

- animate
- append
- attach
- clearBinding
- destroy
- detach
- dispose
- getBinding
- getBound
- getContainer
- hide
- notify
- onAttach
- onChildAttach
- onChildDetach
- onDetach
- register
- remove
- resolve
- setBinding
- setStyle
- setTransform
- show
- unregister
- unwatch

### Properties

- class
- count
- model
- nodes
- owner
- parent
- scale
- translate
- translateX
- translateY
- visible

### Events

- animationCompleted
- dragend
- dragmove
- dragstart

## Methods

### `animate`

(

- `config`

)

Inherited from nx.graphic.Component:

Set animation for element,pass a config to this function { to :{ attr1:value, attr2:value, ... }, duration:Number, complete:Function }

#### Parameters:

- `config` JSON

### `append`

(

- `[parent]`

)

Inherited from nx.graphic.Component:

Append component's element to parent node or other dom element

#### Parameters:

- `[parent]` nx.graphic.Component optional

### `attach`

(

- `parent`
- `index`

)

Inherited from nx.ui.AbstractComponent:

Attach the component to parent.

#### Parameters:

- `parent` Object
- `index` Object

### `clearBinding`

(

- `prop`

)

Inherited from nx.Observable:

Clear binding for specified property.

#### Parameters:

- `prop` Object

### `destroy`

()

Inherited from nx.ui.AbstractComponent:

Destroy the component.

### `detach`

()

Inherited from nx.ui.AbstractComponent:

Detach the component from parent.

### `dispose`

()

Inherited from nx.Observable

Dispose the component.

### `getBinding`

(

- `prop`

)

Inherited from nx.Observable:

Get existing binding object for specified property.

#### Parameters:

- `prop` Object

#### Returns:

:

### `getBound`

() | ClientRect

Inherited from nx.graphic.Component:

Get component's bound, delegate element's getBoundingClientRect function

#### Returns:

| ClientRect:

### ``

(

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

)

Inherited from nx.Observable:

#### Parameters:

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

### `getContainer`

(

- `comp`

)
nx.dom.Element

Inherited from nx.ui.AbstractComponent:

Get the container for component.

#### Parameters:

- `comp` Object

#### Returns:

nx.dom.Element:

### `hide`

()

Inherited from nx.graphic.Component:

Hide component

### `notify`

(

- `names`
- `oldValue`

)

Inherited from nx.Observable:

#### Parameters:

- `names` Object
- `oldValue` Object

### `onAttach`

()

Inherited from nx.ui.AbstractComponent:

Template method for component attach.

### `onChildAttach`

()

Inherited from nx.ui.AbstractComponent:

Template method for child component attach.

### `onChildDetach`

()

Inherited from nx.ui.AbstractComponent:

Template method for child component detach.

### `onDetach`

()

Inherited from nx.ui.AbstractComponent:

Template method for component detach.

### `register`

(

- `name`
- `value`
- `force`

)

Inherited from nx.ui.AbstractComponent:

Register a resource.

#### Parameters:

- `name` Object
- `value` Object
- `force` Object

### `remove`

()

Inherited from nx.graphic.Component:

Remove component's element from dom tree

### `resolve`

(

- `name`

)
Any

Inherited from nx.ui.AbstractComponent:

Resolve a resource.

#### Parameters:

- `name` Object

#### Returns:

Any:

### `setBinding`

(

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

)

Inherited from nx.Observable:

Set binding for specified property.

#### Parameters:

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

### `setStyle`

(

- `key`
- `value`
- `[duration=0]`
- `[callback]`
- `[context]`

)

Inherited from nx.graphic.Component:

Set component's css style

#### Parameters:

- `key` String

  css key

- `value`

  css value

- `[duration=0]` Number optional

  set transition time

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

### `setTransform`

(

- `[translateX]`
- `[translateY]`
- `[scale]`
- `[duration=0]`

)

Inherited from nx.graphic.Component:

Set component's transform

#### Parameters:

- `[translateX]` Number optional

  x axle translate

- `[translateY]` Number optional

  y axle translate

- `[scale]` Number optional

  element's scale

- `[duration=0]` Number optional

  transition time, unite is second

### `show`

()

Inherited from nx.graphic.Component:

Show component

### `unregister`

(

- `name`

)

Inherited from nx.ui.AbstractComponent:

Unregister a resource.

#### Parameters:

- `name` Object

### `unwatch`

(

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

)

Inherited from nx.Observable:

#### Parameters:

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

## Properties

### `class`

Unknown

Inherited from nx.graphic.Component:

Set/get css class

### `count`

nx.data.Collection

Inherited from nx.ui.AbstractComponent:

### `model`

Any

Inherited from nx.ui.AbstractComponent:

### `nodes`

Unknown

Set/get point array to generate a polygon shape

### `owner`

nx.ui.AbstractComponent

Inherited from nx.ui.AbstractComponent:

### `parent`

nx.ui.AbstractComponent

Inherited from nx.ui.AbstractComponent:

### `scale`

Unknown

Inherited from nx.graphic.Component:

Set/get scale

### `translate`

Unknown

Inherited from nx.graphic.Component:

Set/get translate, it set/get as {x:number,y:number}

### `translateX`

Unknown

Inherited from nx.graphic.Component:

Set/get x translate

### `translateY`

Unknown

Inherited from nx.graphic.Component:

Set/get y translate

### `visible`

Unknown

Inherited from nx.graphic.Component:

Set/get element's visibility

## Events

### `animationCompleted`

Inherited from nx.graphic.Component:

Fired when animation completed

#### Event Payload:

- `sender` Object

  Trigger instance

- `event` Object

  original event object

### `dragend`

Inherited from nx.graphic.Component:

Fire when drag end

#### Event Payload:

- `sender` Object

  Trigger instance

- `event` Object

  original event object

### `dragmove`

Inherited from nx.graphic.Component:

Fire when drag move

#### Event Payload:

- `sender` Object

  Trigger instance

- `event` Object

  original event object , include delta[x,y] for the shift

### `dragstart`

Inherited from nx.graphic.Component:

Fire when drag start

#### Event Payload:

- `sender` Object

  Trigger instance

- `event` Object

  original event object