JSDoc: Class: ScaleViewController

# Class: ScaleViewController

## ScaleViewController

ScaleViewController

Alters the scale of points displayed on the screen.

## Constructor

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

##### Parameters:

Name | Type | Description
--- | --- | ---
`container` | Node | Container node to create the controller in.
`decompViewDict` | Object | This 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:
  - scale-view-controller.js, line 28

##### Returns:

Type
  ScaleViewController

### Extends

- EmperorAttributeABC

### 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

#### $globalDiv :Node

jQuery node for global scale bar container div

##### Type:

- Node

Source:
  - scale-view-controller.js, line 49

#### $gridDiv :Node

jQuery element for the div containing the slickgrid of sample information

##### Type:

- Node

Inherited From:
  - EmperorAttributeABC#$gridDiv
Source:
  - view-controller.js, line 260

#### $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

#### $scaledLabel :Node

jQuery node for label of $scaledValues

##### Type:

- Node

Source:
  - scale-view-controller.js, line 42

#### $scaledValue :Node

jQuery node for checkbox controlling whether to scale by values or not

##### Type:

- Node

Source:
  - scale-view-controller.js, line 37

#### $sliderGlobal :Node

jQuery node for global scale bar

##### Type:

- Node

Source:
  - scale-view-controller.js, line 59

#### active :Boolean

Indicates whether the tab is front most

##### Type:

- Boolean

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

#### activeViewKey :String

This is the key of the active decomposition view.

##### Type:

- String

Inherited From:
  - EmperorAttributeABC#activeViewKey
Source:
  - view-controller.js, line 246

#### bodyGrid :Slick.Grid

Container that lists the metadata categories described under the`metadataField` column and the attribute that can be modified.

##### Type:

- Slick.Grid

Inherited From:
  - EmperorAttributeABC#bodyGrid
Source:
  - view-controller.js, line 384

#### decompViewDict :Object

This is object is keyed by unique identifiers and the values areDecompositionView objects referring to a set of objects presented onscreen. This dictionary will usually be shared by all the tabs in theapplication. This argument is passed by reference.

##### Type:

- Object

Inherited From:
  - EmperorAttributeABC#decompViewDict
Source:
  - view-controller.js, line 255

#### 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

#### metadataField :String

Metadata column name.

##### Type:

- String

Inherited From:
  - EmperorAttributeABC#metadataField
Source:
  - view-controller.js, line 269

#### title :String

Human-readable title of the tab.

##### Type:

- String

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

### Methods

#### fromJSON(Parsed)

Decodes JSON string and modifies its own instance variables accordingly.

##### Parameters:

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

Overrides:
  - EmperorAttributeABC#fromJSON
Source:
  - scale-view-controller.js, line 166

#### getActiveDecompViewKey() → {String}

Retrieves the metadata field currently being controlled

Inherited From:
  - EmperorAttributeABC#getActiveDecompViewKey
Source:
  - view-controller.js, line 324

##### Returns:

A key corresponding to the active decomposition view.

Type
  String

#### getScale(values, scaled)

Helper function to get the scale for each metadata value

##### Parameters:

Name | Type | Description
--- | --- | ---
`values` | Array.<String> | The values to get scale for
`scaled` | Boolean | Whether or not to scale by values or just reset to standard scale (1.0)

Source:
  - scale-view-controller.js, line 242

##### Throws:

No or one numeric value in category and trying to scale by value

Type
  Error

#### getSlickGridDataset() → {Array}

Retrieves the underlying data in the slick grid

Inherited From:
  - EmperorAttributeABC#getSlickGridDataset
Source:
  - view-controller.js, line 344

##### Returns:

Returns an array of objects displayed by the body grid.

Type
  Array

#### resize(width, height)

Resizes the container and the individual elements.

Note, the consumer of this class, likely the main controller should call the resize function any time a resizing event happens.

##### Parameters:

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

Overrides:
  - EmperorAttributeABC#resize
Source:
  - scale-view-controller.js, line 194

#### 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

#### setActiveDecompViewKey(k)

Changes the metadata column name to control.

##### Parameters:

Name | Type | Description
--- | --- | ---
`k` | String | Key corresponding to active decomposition view.

Inherited From:
  - EmperorAttributeABC#setActiveDecompViewKey
Source:
  - view-controller.js, line 333

#### 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

#### setMetadataField(m)

Changes the metadata column name to control.

##### Parameters:

Name | Type | Description
--- | --- | ---
`m` | String | Metadata column name to control.

Inherited From:
  - EmperorAttributeABC#setMetadataField
Source:
  - view-controller.js, line 312

#### setPlottableAttributes(scope, scale, group)

Helper function to set the scale of plottable

##### Parameters:

Name | Type | Description
--- | --- | ---
`scope` | Object | The scope where the plottables exist
`scale` | Boolean | New scaling factor of the plottables (1.0 being standard scale)
`group` | Array.<Object> | list of mesh objects that should be changed in scope

Source:
  - scale-view-controller.js, line 221

#### setSlickGridDataset(data)

Changes the underlying data in the slick grid

##### Parameters:

Name | Type | Description
--- | --- | ---
`data` | Array | data.

Inherited From:
  - EmperorAttributeABC#setSlickGridDataset
Source:
  - view-controller.js, line 353

#### toJSON() → {Object}

Converts the current instance into a JSON string.

Overrides:
  - EmperorAttributeABC#toJSON
Source:
  - scale-view-controller.js, line 154

##### Returns:

JSON ready representation of self.

Type
  Object