Constructor
new ScalarViewControllerABC(uiState, container, title, helpmenu, min, max, step, decompViewDict) → {ScalarViewControllerABC}
Parameters:
Name | Type | Description |
---|---|---|
uiState |
UIState | The shared state |
container |
Node | Container node to create the controller in. |
title |
String | The name/title of the tab. |
helpmenu |
String | description helper description. |
min |
Float | Minimum value for the attribute. |
max |
Float | Maximum value for the attribute. |
step |
Float | Size of the step for an attribute slider. |
decompViewDict |
Object | This object is keyed by unique identifiers and the values are DecompositionView objects referring to a set of objects presented on screen. This dictionary will usually be shared by all the tabs in the application. This argument is passed by reference. |
- Source:
Returns:
Extends
Members
$body :Node
jQuery element for the body, which contains the lowermost elementsdisplayed in tab. This goes below the header.
Type:
- Node
- Inherited From:
- Source:
$canvas :Node
jQuery element for the canvas, which contains the header and the body.
Type:
- Node
- Inherited From:
- Source:
$container :Node
jQuery element for the parent container.
Type:
- Node
- Inherited From:
- Source:
$globalDiv :Node
jQuery node for global scale bar container div
Type:
- Node
- Source:
$gridDiv :Node
jQuery element for the div containing the slickgrid of sample information
Type:
- Node
- Inherited From:
- Source:
$header :Node
jQuery element for the header which contains the uppermost elementsdisplayed in a tab.
Type:
- Node
- Inherited From:
- Source:
$scaledLabel :Node
jQuery node for label of $scaledValues
Type:
- Node
- Source:
$scaledValue :Node
jQuery node for checkbox controlling whether to scale by values or not
Type:
- Node
- Source:
$sliderGlobal :Node
jQuery node for global scale bar
Type:
- Node
- Source:
active :Boolean
Indicates whether the tab is front most
Type:
- Boolean
- Inherited From:
- Default Value:
- false
- Source:
bodyGrid :Slick.Grid
Container that lists the metadata categories described under themetadata column and the attribute that can be modified.
Type:
- Slick.Grid
- Inherited From:
- Source:
decompViewDict :Object
This is object is keyed by unique identifiers and the values areDecompositionView objects referring to a set of objects presented onscreen. This dictionary will usually be shared by all the tabs in theapplication. This argument is passed by reference.
Type:
- Object
- Inherited From:
- Source:
description :String
Human-readable description of the tab.
Type:
- String
- Inherited From:
- Source:
enabled :Boolean
Indicates if tab can be accessed.
Type:
- Boolean
- Inherited From:
- Default Value:
- true
- Source:
identifier :String
Unique hash identifier for the tab instance.
Type:
- String
- Inherited From:
- Default Value:
- "EMPtab-xxxxxxx"
- Source:
ready :function
Callback to execute when all the elements in the UI for this controllerhave been loaded. Note, that this functionality needs to be implementedby subclasses, as EmperorViewController does not have any UI components.
Type:
- function
- Inherited From:
- Source:
title :String
Human-readable title of the tab.
Type:
- String
- Inherited From:
- Source:
UIState :UIState
The shared state
Type:
- UIState
- Inherited From:
- Source:
Methods
decompositionName()
Get the name of the decomposition selected in the metadata menu.
- Inherited From:
- Source:
forceRefresh()
Writes the current settings to the active decomposition view(s). Will be called when the decomposition view is swapped out for a different view type.
- Inherited From:
- Source:
fromJSON(Parsed)
Decodes JSON string and modifies its own instance variables accordingly.
Parameters:
Name | Type | Description |
---|---|---|
Parsed |
Object | JSON string representation of self. |
- Overrides:
- Source:
getMetadataField()
Get the name of the selected category in the metadata menu.
- Inherited From:
- Source:
getScale(values, scaled)
Helper function to get the scale for each metadata value
Parameters:
Name | Type | Description |
---|---|---|
values |
Array.<String> | The values to get scale for |
scaled |
Boolean | Whether or not to scale by values or just reset to standard scale (1.0) |
- Source:
Throws:
-
No or one numeric value in category and trying to scale by value
- Type
- Error
getSlickGridDataset() → {Array}
Retrieves the underlying data in the slick grid
- Inherited From:
- Source:
Returns:
Returns an array of objects displayed by the body grid.
- Type
- Array
getView()
Get the view that's currently selected by the metadata menu.
- Inherited From:
- Source:
hasMetadataField(m) → {Bool}
Check if a metadata field is present
Parameters:
Name | Type | Description |
---|---|---|
m |
String | Metadata column to check if is present. |
- Inherited From:
- Source:
Returns:
Whether or not the metadata field is present.
- Type
- Bool
refreshMetadata()
Update the metadata selection menu.
Performs some additional logic to avoid duplicating decomposition names.
Note that decompositions won't be updated if they have the same name and same metadata headers, if the only things changing are coordinates, or metadata values, the changes should be performed directly on the objects themselves.
- Inherited From:
- Source:
resize(width, height)
Resizes the container and the individual elements.
Note, the consumer of this class, likely the main controller should call the resize function any time a resizing event happens.
Parameters:
Name | Type | Description |
---|---|---|
width |
float | the container width. |
height |
float | the container height. |
- Overrides:
- Source:
scaleValue(val, min, range) → {float}
Scaling function to use when the attribute is based on a metadata category (used in getScale).
Parameters:
Name | Type | Description |
---|---|---|
val |
float | The metadata value for the current sample. |
min |
float | The minimum metadata value in the dataset. |
range |
float | The span of the metadata values. |
- Source:
Returns:
Attribute value
- Type
- float
setActive(trulse)
Sets whether or not the tab is visible.
Parameters:
Name | Type | Description |
---|---|---|
trulse |
Boolean | option to activate tab (i.e. move tab to foreground). |
- Inherited From:
- Source:
setAllPlottableAttributes()
Method to do global updates to only the current view
Note, needs to be overriden by the subclass.
- Source:
setEnabled(trulse)
Sets whether or not elements in the tab can be modified.
Parameters:
Name | Type | Description |
---|---|---|
trulse |
Boolean | option to enable elements. |
- Overrides:
- Source:
setMetadataField(m)
Changes the selected value in the metadata menu.
Parameters:
Name | Type | Description |
---|---|---|
m |
String | Metadata column name to control. When the category is
|
- Inherited From:
- Source:
Throws:
-
Argument
m
must be a metadata category in one of the decomposition views. - Type
- Error
setPlottableAttributes()
Helper function to set the scale of plottable.
Note, needs to be overriden by the subclass.
- Source:
setSlickGridDataset(data)
Changes the underlying data in the slick grid
Parameters:
Name | Type | Description |
---|---|---|
data |
Array | data. |
- Inherited From:
- Source:
toJSON() → {Object}
Converts the current instance into a JSON string.
- Overrides:
- Source:
Returns:
JSON ready representation of self.
- Type
- Object