Constructor
new EmperorController(scatter, biplot, divId, webglcanvasopt) → {EmperorController}
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
scatter |
DecompositionModel | A decomposition object that represents the scatter-represented objects. |
|
biplot |
DecompositionModel | An optional decomposition object that represents the arrow-represented objects. Can be null or undefined. |
|
divId |
string | The element id where the controller should instantiate itself. |
|
webglcanvas |
node |
<optional> |
the canvas to use to render the information. This parameter is optional, and should rarely be set. But is useful for external applications like SAGE2. |
- Source:
Returns:
- Type
- EmperorController
Members
$divId :node
jQuery object where the object lives in.
Type:
- node
- Source:
$optionsButton :Node
jQuery object To show the context menu (as an alternative toright-clicking on the plot).The context menu that this button shows is created in the _buildUImethod.
Type:
- Node
- Source:
$plotBanner :node
Div with the number of visible samples
Type:
- node
- Source:
$plotMenu :node
Internal div where the plots live in (jQuery object).
Type:
- node
- Source:
$plotSpace :node
Internal div where the menus live in (jQuery object).
Type:
- node
- Source:
controllers :object
Holds a reference to all the tabs (view controllers) in the $plotMenu
.
Type:
- object
- Source:
decModels :MultiModel
MultiModel object containing all DecompositionModels
Type:
- MultiModel
- Source:
decViews :object
Object with all the available decomposition views.
Type:
- object
- Source:
GRID_SCALE :float
Scaling constant for grid dimensions (read only).
Type:
- float
- Source:
height :float
Height of the object.
Type:
- float
- Source:
ready :function
Callback to execute when all the view controllers have been successfullyloaded.
Type:
- function
- Source:
renderer :THREE.Renderer
Object in charge of doing the rendering of the scenes.
Type:
- THREE.Renderer
- Source:
SCENE_VIEW_SCALE :float
Scaling constant for scene plot view dimensions
Type:
- float
- Source:
sceneViews :Array.<ScenePlotView3D>
List of the scene plots views being rendered.
Type:
- Array.<ScenePlotView3D>
- Source:
UIState :UIState
The state shared across one instance of the UI
Type:
- UIState
- Source:
width :float
Width of the object.
Type:
- float
- Source:
Methods
addDecompositionView(key, value)
Add a new decomposition view
Parameters:
Name | Type | Description |
---|---|---|
key |
String | New name for the decomposition view. |
value |
DecompositionView | The decomposition view that will be added. |
- Source:
Throws:
Error if key
already exists, or if value
is not a
decomposition view.
addSceneView()
Helper method to add additional ScenePlotViews (i.e. another plot)
- Source:
addTab(dvdict, viewConstructor)
Helper method to add tabs to the controller.
Parameters:
Name | Type | Description |
---|---|---|
dvdict |
Array.<DecompositionView> | Dictionary of DecompositionViews. |
viewConstructor |
EmperorViewControllerABC | Constructor of the view controller. |
- Source:
exportToVega()
Open in Vega editor
- Source:
loadConfig(json)
Load a settings file and set all controller variables.
This method will trigger a rendering callback.
Parameters:
Name | Type | Description |
---|---|---|
json |
object | Information about the emperor session to load. |
- Source:
render()
Helper method to render sceneViews, gets called every time the browser indicates we can render a new frame, however it only triggers the appropriate rendering functions if something has changed since the last frame.
- Source:
resize(the, the)
Helper method to resize the plots
Parameters:
Name | Type | Description |
---|---|---|
the |
width | width of the entire plotting space |
the |
height | height of the entire plotting space |
- Source:
saveConfig()
Write settings file for the current controller settings
The format is as follows: a javascript object with the camera position stored in the 'cameraPosition' key and the quaternion in the 'cameraQuaternion' key. Each controller in this.controllers is then saved by calling toJSON on them, and the resulting object saved under the same key as the controllers object.
- Source:
screenshot(typeopt)
Save the current canvas view to a new window
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
type |
string |
<optional> |
png | Format to save the file as: ('png', 'svg') |
- Source:
updatePlotBanner()
Updates the plot banner based on the number of visible elements and the scene's background color.
- Source: