JSDoc: Class: AxesController

# Class: AxesController

## AxesController

AxesController

Controls the axes that are displayed on screen as well as their orientation.

## Constructor

#### new AxesController(container, decompViewDict) → {AxesController}

##### Parameters:

Name | Type | Description
--- | --- | ---
`container` | Node | Container node to create the controller in.
`decompViewDict` | Object | This is object is keyed by unique identifiers and the values are DecompositionView objects referring to a set of objects presented on screen. This dictionary will usually be shared by all the tabs in the application. This argument is passed by reference.

Source:
  - axes-controller.js, line 29

##### Returns:

Type
  AxesController

### Extends

- EmperorViewControllerABC

### Members

#### $body :Node

jQuery element for the body, which contains the lowermost elementsdisplayed in tab. This goes below the header.

##### Type:

- Node

Inherited From:
  - EmperorViewControllerABC#$body
Source:
  - view-controller.js, line 53

#### $canvas :Node

jQuery element for the canvas, which contains the header and the body.

##### Type:

- Node

Inherited From:
  - EmperorViewControllerABC#$canvas
Source:
  - view-controller.js, line 47

#### $container :Node

jQuery element for the parent container.

##### Type:

- Node

Inherited From:
  - EmperorViewControllerABC#$container
Source:
  - view-controller.js, line 31

#### $header :Node

jQuery element for the header which contains the uppermost elementsdisplayed in a tab.

##### Type:

- Node

Inherited From:
  - EmperorViewControllerABC#$header
Source:
  - view-controller.js, line 59

#### $table :Node

The display table where information about currently visible axes isshown.

##### Type:

- Node

Source:
  - axes-controller.js, line 112

#### active :Boolean

Indicates whether the tab is front most

##### Type:

- Boolean

Inherited From:
  - EmperorViewControllerABC#active
Default Value:
  - false
Source:
  - view-controller.js, line 65

#### description :String

Human-readable description of the tab.

##### Type:

- String

Inherited From:
  - EmperorViewControllerABC#description
Source:
  - view-controller.js, line 41

#### enabled :Boolean

Indicates if tab can be accessed.

##### Type:

- Boolean

Inherited From:
  - EmperorViewControllerABC#enabled
Default Value:
  - true
Source:
  - view-controller.js, line 77

#### identifier :String

Unique hash identifier for the tab instance.

##### Type:

- String

Inherited From:
  - EmperorViewControllerABC#identifier
Default Value:
  - "EMPtab-xxxxxxx"
Source:
  - view-controller.js, line 71

#### svg :Node

The SVG node where the scree plot lives. For use with D3.

##### Type:

- Node

Source:
  - axes-controller.js, line 105

#### title :String

Human-readable title of the tab.

##### Type:

- String

Inherited From:
  - EmperorViewControllerABC#title
Source:
  - view-controller.js, line 36

### Methods

#### buildDisplayTable()

Create a table to display the visible axis information.

Note that when this method is executed the table is destroyed, if it exists, and recreated with the appropriate information.

Source:
  - axes-controller.js, line 139

#### colorChanged(name, color)

Callback to change color of the axes or the background

##### Parameters:

Name | Type | Description
--- | --- | ---
`name` | String | The name of the element to change, it can be either 'axes-color' or 'background-color'.
`color` | Integer | The color to set to the `name`. Should be in an RGB-like format.

Source:
  - axes-controller.js, line 388

#### flipAxis(index)

Callback to change the orientation of an axis

##### Parameters:

Name | Type | Description
--- | --- | ---
`index` | Integer | The index of the dimension to re-orient, note that if this index is not visible, this callback will take no effect.

Source:
  - axes-controller.js, line 363

#### fromJSON(Parsed)

Decodes JSON string and modifies its own instance variables accordingly.

##### Parameters:

Name | Type | Description
--- | --- | ---
`Parsed` | Object | JSON string representation of self.

Overrides:
  - EmperorViewControllerABC#fromJSON
Source:
  - axes-controller.js, line 432

#### resize(width, height)

Resizes the container, note that the body will take whatever space is available after considering the size of the header. The header shouldn't have height variable objects, once added their height shouldn't really change.

##### Parameters:

Name | Type | Description
--- | --- | ---
`width` | Float | the container width.
`height` | Float | the container height.

Inherited From:
  - EmperorViewControllerABC#resize
Source:
  - view-controller.js, line 156

#### setActive(trulse)

Sets whether or not the tab is visible.

##### Parameters:

Name | Type | Description
--- | --- | ---
`trulse` | Boolean | option to activate tab (i.e. move tab to foreground).

Inherited From:
  - EmperorViewControllerABC#setActive
Source:
  - view-controller.js, line 136

#### setEnabled(trulse)

Sets whether or not the tab can be modified or accessed.

##### Parameters:

Name | Type | Description
--- | --- | ---
`trulse` | Boolean | option to enable tab.

Inherited From:
  - EmperorViewControllerABC#setEnabled
Source:
  - view-controller.js, line 121

#### toJSON() → {Object}

Converts the current instance into a JSON string.

Overrides:
  - EmperorViewControllerABC#toJSON
Source:
  - axes-controller.js, line 414

##### Returns:

JSON ready representation of self.

Type
  Object

#### updateVisibleAxes(index, position)

Callback to reposition an axis into a new position.

##### Parameters:

Name | Type | Description
--- | --- | ---
`index` | Integer | The index of the dimension to set as a new visible axis, in the corresponding position indicated by `position`.
`position` | Integer | The position where the new axis will be set.

Source:
  - axes-controller.js, line 343