Class: DecompositionView

DecompositionView(multiModel, modelKey) → {DecompositionView}

DecompositionView

Contains all the information on how the model is being presented to the user.

Constructor

new DecompositionView(multiModel, modelKey) → {DecompositionView}

Parameters:
Name Type Description
multiModel MultiModel

A multi model object with all models

modelKey string

The key referencing the target model within the multiModel

Source:
Returns:
Type
DecompositionView

Members

allModels :MultiModel

All models in the current scene and global metrics about them

Type:
  • MultiModel
Source:

axesColor :integer

Axes color.

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

axesOrientation :Array.<integer>

Orientation of the axes, -1 means the axis is flipped, 1 means the axis is not flipped.

Type:
  • Array.<integer>
Source:

backgroundColor :integer

Background color.

Type:
  • integer
Default Value:
  • '#000000' (black)
Source:

count :integer

Number of samples represented in the view.

Type:
  • integer
Source:

decomp :DecompositionModel

The decomposition model that the view represents.

Type:
Source:

dynamicTubes :Array.<THREE.Mesh>

Dynamic tubes covering the final tube segment of a trajectory Must be rebuilt each frame by the animations controller

Type:
  • Array.<THREE.Mesh>
Source:

ellipsoids :Array.<THREE.Mesh>

Array of THREE.Mesh objects on screen (represent confidence intervals).

Type:
  • Array.<THREE.Mesh>
Source:

lines :Object

Object with THREE.LineSegments for the procrustes edges. Has a left and a right attribute.

Type:
  • Object
Source:

markers :Array.<THREE.Mesh>

Array of THREE.Mesh objects on screen (represent samples).

Type:
  • Array.<THREE.Mesh>
Source:

needsSwapMarkers :boolean

Flag indicating old markers must be removed from the scene tree.

Type:
  • boolean
Source:

oldMarkers :Array.<THREE.Mesh>

Meshes to be swapped out of scene when markers are modified.

Type:
  • Array.<THREE.Mesh>
Source:

staticTubes :Array.<THREE.Mesh>

Static tubes objects covering an entire trajectory. Can use setDrawRange on the underlying geometry to display just part of the trajectory.

Type:
  • Array.<THREE.Mesh>
Source:

UIState :UIState

The shared state for the UI

Type:
  • UIState
Source:

visibleDimensions :Array.<integer>

Top visible dimensions

Type:
  • Array.<integer>
Source:

Methods

changeVisibleDimensions(newDims)

Change the visible coordinates

Parameters:
Name Type Description
newDims Array.<integer>

An Array of integers in which each integer is the index to the principal coordinate to show

Source:

flipVisibleDimension(index)

Reorient one of the visible dimensions.

Parameters:
Name Type Description
index integer

The index of the dimension to re-orient, if this dimension is not visible i.e. not in this.visibleDimensions, then the method will return right away.

Source:

getAndClearOldMarkers()

Called as part of the swap operation to change out objects in the scene, this function atomically clears the swap flag, clears the old markers, and returns what the old markers were.

Source:

getGeometryFactor()

Calculate the appropriate size for a geometry based on the first dimension's range.

Source:

getTubes()

Retrieve a shallow copy of concatenated static and dynamic tube arrays

Source:

getVisibleCount() → {Number}

Get the number of visible elements

Source:
Returns:

The number of visible elements in this view.

Type
Number

groupByColor(names) → {Object}

Group by color

Parameters:
Name Type Description
names Array

An array of strings with the sample names.

Source:
Returns:

Mapping of colors to objects.

Type
Object

hideEdgesForPlottables(plottables)

Hide edges where plottables are present.

Parameters:
Name Type Description
plottables Array.<Plottable>

An array of plottables for which the edges should be hidden. If this object is not supplied, all the edges are hidden.

Source:

setCategory(attributes, setPlottableAttributes, category) → {Array.<object>}

Change the plottables attributes based on the metadata category using the provided setPlottableAttributes function

Parameters:
Name Type Description
attributes object

Key:value pairs of elements and values to change in plottables.

setPlottableAttributes function

Helper function to change the values of plottables, in general this should be implemented in the controller but it can be nullable if not needed. setPlottableAttributes should receive: the scope where the plottables exist, the value to be applied to the plottables and the plotables to change. For more info see ColorViewController.setPlottableAttribute

category string

The category/column in the mapping file

Source:
See:
  • ColorViewController.setPlottableAttribute
Returns:

Array of objects to be consumed by Slick grid.

Type
Array.<object>

setColor(color, group)

Set the color for a group of plottables.

Parameters:
Name Type Description
color Object

An object that can be interpreted as a color by the THREE.Color class. Can be either a string like '#ff0000' or a number like 0xff0000, or a CSS color name like 'red', etc.

group Array.<Plottable>

An array of plottables for which the color should be set. If this object is not provided, all the plottables in the view will have the color set.

Source:

setEmissive(emissive, group)

Set the emissive attribute of the markers

Parameters:
Name Type Description
emissive Bool

Whether the object should be emissive.

group Array.<Plottable>

An array of plottables for which the emissive attribute will be set. If this object is not provided, all the plottables in the view will be have the scale set.

Source:

setOpacity(opacity, group)

Set the opacity for a group of plottables.

Parameters:
Name Type Description
opacity Float

The opacity value (from 0 to 1) for the selected objects.

group Array.<Plottable>

An array of plottables for which the opacity should be set. If this object is not provided, all the plottables in the view will be have the opacity set.

Source:

setScale(scale, group)

Set the scale for a group of plottables.

Parameters:
Name Type Description
scale Float

The scale to set for the objects, relative to the original size. Should be a positive and non-zero value.

group Array.<Plottable>

An array of plottables for which the scale should be set. If this object is not provided, all the plottables in the view will be have the scale set.

Source:

setVisibility(visible, group)

Set the visibility for a group of plottables.

Parameters:
Name Type Description
visible Bool

Whether or not the objects should be visible.

group Array.<Plottable>

An array of plottables for which the visibility should be set. If this object is not provided, all the plottables in the view will be have the visibility set.

Source:

showEdgesForPlottables(plottables)

Hide edges where plottables are present.

Parameters:
Name Type Description
plottables Array.<Plottable>

An array of plottables for which the edges should be hidden. If this object is not supplied, all the edges are hidden.

Source:

toggleLabelVisibility()

Toggles the visibility of arrow labels

Source:
Throws:

if this method is called on a scatter type.

Type
Error

updatePositions()

Update the position of the markers, arrows and lines.

This method is called by flipVisibleDimension and by changeVisibleDimensions and will naively change the positions even if they haven't changed.

Source: