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:
Returns:

An instance of ScenePlotView3D.

Type
ScenePlotView3D

Members

axesColor :integer

Axes color.

Type:
  • integer
Default Value:
  • 0xFFFFFF (white)
Source:

backgroundColor :integer

Background color.

Type:
  • integer
Default Value:
  • 0x000000 (black)
Source:

camera :THREE.PerspectiveCamera

Camera used to display the scene.

Type:
  • THREE.PerspectiveCamera
Source:

control :THREE.OrbitControls

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

Type:
  • THREE.OrbitControls
Source:

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:

EVENTS :Array.<String>

Events allowed for callbacks. DO NOT EDIT.

Type:
  • Array.<String>
Source:

height :Float

Height of the scene.

Type:
  • Float
Source:

light :THREE.DirectionalLight

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

Type:
  • THREE.DirectionalLight
Source:

needsUpdate :Boolean

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

Type:
  • Boolean
Source:

visibleDimensions :Array.<Integer>

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

Type:
  • Array.<Integer>
Source:

width :Float

Width of the scene.

Type:
  • Float
Source:

xView :Float

Horizontal position of the scene.

Type:
  • Float
Source:

yView :Float

Vertical position of the scene.

Type:
  • Float
Source:

Methods

addDecompositionsToScene()

Adds all the decomposition views to the current scene.

Source:

checkUpdate()

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

Source:

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:

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:

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:
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:
Throws:

If the given eventType is unknown.

Type
Error

removeAxes()

Helper method to remove the axis lines from the scene

Source:

removeAxesLabels()

Helper method to remove the axis labels from the scene

Source:

render()

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

Source:

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:

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: