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 |
Returns:
- Type
- DecompositionView
Members
allModels :MultiModel
All models in the current scene and global metrics about them
Type:
- MultiModel
axesColor :integer
Axes color.
Type:
- integer
axesOrientation :Array.<integer>
Orientation of the axes, -1
means the axis is flipped, 1
means the
axis is not flipped.
Type:
- Array.<integer>
backgroundColor :integer
Background color.
Type:
- integer
count :integer
Number of samples represented in the view.
Type:
- integer
decomp :DecompositionModel
The decomposition model that the view represents.
Type:
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>
ellipsoids :Array.<THREE.Mesh>
Array of THREE.Mesh objects on screen (represent confidence intervals).
Type:
- Array.<THREE.Mesh>
lines :Object
Object with THREE.LineSegments for the procrustes edges. Has a left and a right attribute.
Type:
- Object
markers :Array.<THREE.Mesh>
Array of THREE.Mesh objects on screen (represent samples).
Type:
- Array.<THREE.Mesh>
needsSwapMarkers :boolean
Flag indicating old markers must be removed from the scene tree.
Type:
- boolean
oldMarkers :Array.<THREE.Mesh>
Meshes to be swapped out of scene when markers are modified.
Type:
- Array.<THREE.Mesh>
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>
UIState :UIState
The shared state for the UI
Type:
- UIState
visibleDimensions :Array.<integer>
Top visible dimensions
Type:
- Array.<integer>
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 |
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 |
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.
getGeometryFactor()
Calculate the appropriate size for a geometry based on the first dimension's range.
getTubes()
Retrieve a shallow copy of concatenated static and dynamic tube arrays
getVisibleCount() → {Number}
Get the number of visible elements
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. |
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. |
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 |
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. |
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. |
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. |
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. |
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. |
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. |
toggleLabelVisibility()
Toggles the visibility of arrow labels
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.