JSDoc: Class: ScenePlotView3D

# Class: ScenePlotView3D

## ScenePlotView3D

ScenePlotView3D

Represents a three dimensional scene in THREE.js.

## Constructor

#### new ScenePlotView3D(renderer, decViews, container, xView, yView, width, height) → {ScenePlotView3D}

##### Parameters:

Name | Type | Description
--- | --- | ---
`renderer` | THREE.renderer | THREE renderer object.
`decViews` | Object | dictionary of DecompositionViews shown in this scene
`container` | Node | Div where the scene will be rendered.
`xView` | Float | Horizontal position of the rendered scene in the container element.
`yView` | Float | Vertical position of the rendered scene in the container element.
`width` | Float | The width of the renderer
`height` | Float | The height of the renderer

Source:
  - sceneplotview3d.js, line 31

##### Returns:

An instance of ScenePlotView3D.

Type
  ScenePlotView3D

### Members

#### axesColor :integer

Axes color.

##### Type:

- integer

Default Value:
  - 0xFFFFFF (white)
Source:
  - sceneplotview3d.js, line 64

#### backgroundColor :integer

Background color.

##### Type:

- integer

Default Value:
  - 0x000000 (black)
Source:
  - sceneplotview3d.js, line 70

#### camera :THREE.PerspectiveCamera

Camera used to display the scene.

##### Type:

- THREE.PerspectiveCamera

Source:
  - sceneplotview3d.js, line 84

#### control :THREE.OrbitControls

Object used to interact with the scene. By default it uses the mouse.

##### Type:

- THREE.OrbitControls

Source:
  - sceneplotview3d.js, line 113

#### dimensionRanges :Object

Object with "min" and "max" attributes each of which is an array with the ranges that covers all of the decomposition views.

##### Type:

- Object

Source:
  - sceneplotview3d.js, line 141

#### EVENTS :Array.<String>

Events allowed for callbacks. DO NOT EDIT.

##### Type:

- Array.<String>

Source:
  - sceneplotview3d.js, line 153

#### height :Float

Height of the scene.

##### Type:

- Float

Source:
  - sceneplotview3d.js, line 58

#### light :THREE.DirectionalLight

Object used to light the scene, by default is set to a light and transparent color (0x99999999).

##### Type:

- THREE.DirectionalLight

Source:
  - sceneplotview3d.js, line 96

#### needsUpdate :Boolean

True when changes have occured that require re-rendering of the canvas

##### Type:

- Boolean

Source:
  - sceneplotview3d.js, line 129

#### visibleDimensions :Array.<Integer>

Array of integers indicating the index of the visible dimension at each axis ([x, y, z]).

##### Type:

- Array.<Integer>

Source:
  - sceneplotview3d.js, line 135

#### width :Float

Width of the scene.

##### Type:

- Float

Source:
  - sceneplotview3d.js, line 53

#### xView :Float

Horizontal position of the scene.

##### Type:

- Float

Source:
  - sceneplotview3d.js, line 43

#### yView :Float

Vertical position of the scene.

##### Type:

- Float

Source:
  - sceneplotview3d.js, line 48

### Methods

#### checkUpdate()

Convenience method to check if this or any of the decViews under this need rendering

Source:
  - sceneplotview3d.js, line 441

#### drawAxesLabelsWithColor(color)

Draw the axes labels for each visible dimension.

The text in the labels is determined using the percentage explained by each dimension and the abbreviated name of a single decomposition object. Note that we arbitrarily use the first one, as all decomposition objects presented in the same scene should have the same percentages explained by each axis.

##### Parameters:

Name | Type | Description
--- | --- | ---
`color` | Integer | An integer in hexadecimal that specifies the color of the labels, these labels will be positioned at the end of the axes line.

Source:
  - sceneplotview3d.js, line 329

#### drawAxesWithColor(color)

Draw the axes lines in the plot

##### Parameters:

Name | Type | Description
--- | --- | ---
`color` | Integer | An integer in hexadecimal that specifies the color of each of the axes lines, the length of these lines is determined by the dimensionRanges property.

Source:
  - sceneplotview3d.js, line 302

#### off(eventType, handler)

Interface to unsubscribe a function from an event type, see the EVENTS property.

##### Parameters:

Name | Type | Description
--- | --- | ---
`eventType` | String | The type of event to unsubscribe from.
`handler` | function | Function to remove from the subscribers list.

Source:
  - sceneplotview3d.js, line 587

##### Throws:

If the given eventType is unknown.

Type
  Error

#### on(eventType, handler)

Interface to subscribe to event types in the canvas, see the EVENTS property.

##### Parameters:

Name | Type | Description
--- | --- | ---
`eventType` | String | The type of event to subscribe to.
`handler` | function | Function to call when `eventType` is triggered, receives two parameters, a string with the name of the object, and the object itself i.e. f(objectName, object).

Source:
  - sceneplotview3d.js, line 567

##### Throws:

If the given eventType is unknown.

Type
  Error

#### removeAxes()

Helper method to remove the axis lines from the scene

Source:
  - sceneplotview3d.js, line 390

#### removeAxesLabels()

Helper method to remove the axis labels from the scene

Source:
  - sceneplotview3d.js, line 399

#### render()

Convenience method to re-render the contents of the scene.

Source:
  - sceneplotview3d.js, line 499

#### resize(xView, yView, width, height)

Resizes and relocates the scene.

##### Parameters:

Name | Type | Description
--- | --- | ---
`xView` | Float | New horizontal location.
`yView` | Float | New vertical location.
`width` | Float | New scene width.
`height` | Float | New scene height.

Source:
  - sceneplotview3d.js, line 426

#### setCameraAspectRatio(winAspect)

Sets the aspect ratio of the camera according to the current size of the scene.

##### Parameters:

Name | Type | Description
--- | --- | ---
`winAspect` | Float | ratio of width to height of the scene.

Source:
  - sceneplotview3d.js, line 411