Class: ScenePlotView3D

ScenePlotView3D(uiState, renderer, decViews, decModels, container, xView, yView, width, height) → {ScenePlotView3D}

ScenePlotView3D

Represents a three dimensional scene in THREE.js.

Constructor

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

Parameters:
Name Type Description
uiState UIState

shared UIState state object

renderer THREE.renderer

THREE renderer object.

decViews Object

dictionary of DecompositionViews shown in this scene

decModels MultiModel

MultiModel of DecompositionModels shown in this scene (with extra global data about them)

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

Axes color.

Type:
  • String
Default Value:
  • '#FFFFFF' (white)
Source:

backgroundColor :String

Background color.

Type:
  • String
Default Value:
  • '#000000' (black)
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 in scatter mode, 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:

parallelCam :THREE.OrthographicCamera

Camera used to display the parallel plot scene.

Type:
  • THREE.OrthographicCamera
Source:

scatterCam :THREE.OrthographicCamera

Camera used to display the scatter scene.

Type:
  • THREE.OrthographicCamera
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:

buildCamController()

Builds a camera controller (for scatter or parallel plot)

Source:

buildCamera()

Builds a camera (for scatter or parallel plot)

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 String

A CSS-compatible value that specifies the color of the labels, these labels will be positioned at the end of the axes line. If the color value is null the labels will be removed.

Source:

drawAxesWithColor(color)

Draw the axes lines in the plot

Parameters:
Name Type Description
color String

A CSS-compatible value that specifies the color of each of the axes lines, the length of these lines is determined by the global dimensionRanges property computed in decModels. If the color value is null the lines will be removed.

Source:

getScalingConstant() → {Number}

Calculate a scaling constant for the text in the scene.

It is important that this factor is calculated based on all the elements in a scene, and that it is the same for all the text elements in the scene. Otherwise, some text will be bigger than other.

Source:
Returns:

The scaling factor to use for labels.

Type
Number

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

recenterCamera()

Recenter the position of the camera to the initial default.

Source:

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:

updateCameraAspectRatio()

Resets the aspect ratio of the camera according to the current size of the plot space.

Source:

updateCameraTarget()

Updates the target and dimensions of the camera and control

The target of the scene depends on the coordinate space of the data, by default it is set to zero, but we need to make sure that the target is reasonable for the data.

Source:

(inner) showText()

The functions showText and copyToClipboard are used in the 'click' and 'dblclick' events.

When a sample is clicked we show a legend at the bottom left of the view. If this legend is clicked, we copy the sample name to the clipboard. When a sample is double-clicked we directly copy the sample name to the clipboard and add the legend at the bottom left of the view.

Source: