NGL@1.0.0-beta.7 Home Manual Reference Source Gallery
import StructureComponent from 'ngl/src/component/structure-component.js'
public class | source

StructureComponent

Extends:

Component → StructureComponent

Component wrapping a Structure object

Example:

// get a structure component by loading a structure file into the stage
stage.loadFile( "rcsb://4opj" ).then( function( structureComponent ){
    structureComponent.addRepresentation( "cartoon" );
    structureComponent.autoView();
} );

Constructor Summary

Public Constructor
public

constructor(stage: Stage, structure: Structure, params: ComponentParameters)

Create structure component

Member Summary

Public Members
public
public

Events emitted by the component

public

The wrapped structure

public
public
public get

Component type

Private Members
private

Method Summary

Public Methods
public

Add a new structure representation to the component

public

Add a new trajectory component to the structure

public

autoView(sele: String | Integer, duration: Integer): undefined

Automatically center and zoom the component

public
public
public
public

Rebuild all representations

public

Rebuild all trajectories

public
public

Set the default assembly

public
public
public
Private Methods
private

Initialize selection

Inherited Summary

From class Component
public get
public
public
public
public
public
public
public
public
public

Events emitted by the component

public
public
public
public
public
public
public

addAnnotation(position: Vector3, content: String | Element, params: Object): Annotation

Add an anotation object

public
public

Add a new representation to the component

public

autoView(duration: Integer): undefined

Automatically center and zoom the component

public
public

Iterator over each annotation and executing the callback

public

Iterator over each representation and executing the callback

public
public abstract
public
public
public
public
public

Remove all annotations from the component

public

Removes all representation components

public

Remove the give annotation from the component

public

Removes a representation component

public
public

Set position transform

public

Set rotation transform

public

Set scale transform

public
public

Set general transform.

public

Set the visibility of the component, including added representations

public
public

Public Constructors

public constructor(stage: Stage, structure: Structure, params: ComponentParameters) source

Create structure component

Override:

Component#constructor

Params:

NameTypeAttributeDescription
stage Stage

stage object the component belongs to

structure Structure

structure object to wrap

params ComponentParameters

component parameters

Public Members

public defaultAssembly source

public signals: StructureComponentSignals source

Events emitted by the component

Override:

Component#signals

public structure: Structure source

The wrapped structure

public structureView: StructureView source

View on StructureComponent#structure. Change its selection via StructureComponent#setSelection.

public trajList source

public get type: String source

Component type

Override:

Component#type

Private Members

private selection: Selection source

Selection for StructureComponent#structureView

Public Methods

public addRepresentation(type: String, params: StructureRepresentationParameters): RepresentationComponent source

Add a new structure representation to the component

Override:

Component#addRepresentation

Params:

NameTypeAttributeDescription
type String

the name of the representation, one of: axes, backbone, ball+stick, base, cartoon, contact, distance, helixorient, hyperball, label, licorice, line surface, ribbon, rocket, rope, spacefill, trace, tube, unitcell.

params StructureRepresentationParameters

representation parameters

Return:

RepresentationComponent

the created representation wrapped into a representation component object

public addTrajectory(trajPath: String | Frames, params: TrajectoryComponentParameters | TrajectoryParameters): TrajectoryComponent source

Add a new trajectory component to the structure

Params:

NameTypeAttributeDescription
trajPath String | Frames

path or frames object

params TrajectoryComponentParameters | TrajectoryParameters

parameters

Return:

TrajectoryComponent

the created trajectory component object

public autoView(sele: String | Integer, duration: Integer): undefined source

Automatically center and zoom the component

Override:

Component#autoView

Params:

NameTypeAttributeDescription
sele String | Integer
  • optional

selection string or duration if integer

duration Integer
  • optional

duration of the animation, defaults to 0

Return:

undefined

public dispose() source

Override:

Component#dispose

public getBoxUntransformed() source

Override:

Component#getBoxUntransformed

public getCenterUntransformed() source

Override:

Component#getCenterUntransformed

public rebuildRepresentations(): undefined source

Rebuild all representations

Return:

undefined

public rebuildTrajectories(): undefined source

Rebuild all trajectories

Return:

undefined

public removeTrajectory() source

public setDefaultAssembly(value: String): undefined source

Set the default assembly

Params:

NameTypeAttributeDescription
value String

assembly name

Return:

undefined

public setSelection(string: String): StructureComponent source

Set selection of StructureComponent#structureView

Params:

NameTypeAttributeDescription
string String

selection string

Return:

StructureComponent

this object

public setVisibility() source

Set the visibility of the component, including added representations

Override:

Component#setVisibility

public superpose() source

Private Methods

private initSelection(sele: String): undefined source

Initialize selection

Params:

NameTypeAttributeDescription
sele String

selection string

Return:

undefined